Application Layer MCQs for NSCT

By the NSCT Exam Editorial Team · Updated 2026-11-24 · Facts checked against official sources on 2026-11-24

The application layer holds the protocols that applications use to talk across a network: HTTP for the web, DNS for names, SMTP for sending email, FTP for files and DHCP for automatic addressing. It is topic 6 of the Computer Networks and Cloud Computing area, which carries 10% of the NSCT according to HEC's Areas of Competencies. Networks averaged 39.6% accuracy in 2026, per the HEC NSCT report and APP.

Each protocol runs over the transport layer, so many questions ask which one uses TCP or UDP and on which port.

Protocol Transport Default port(s)
HTTP / HTTPS TCP (HTTP/3: UDP via QUIC) 80 / 443
DNS UDP, TCP for large replies and zone transfers 53
SMTP TCP 25 (587 for client submission)
POP3 / IMAP TCP 110 / 143
FTP TCP 21 control, 20 data (active mode)
DHCP UDP 67 server, 68 client

HTTP

HTTP (HyperText Transfer Protocol) is a stateless request-response protocol: the server does not remember earlier requests, and cookies add state on top. A request names a method (GET, POST, PUT, DELETE) and a URL; the response carries a status code.

Code Meaning
200 OK
301 / 302 Moved permanently / temporarily
304 Not Modified (cached copy still valid)
403 / 404 Forbidden / Not Found
500 Internal Server Error

Non-persistent HTTP opens a new TCP connection per object (2 RTTs each). Persistent HTTP reuses one connection, and HTTP/2 multiplexes many streams over it. Exam angle: a page with a base file and 8 images takes 18 RTTs non-persistent, 10 RTTs persistent without pipelining, and about 3 RTTs with pipelining.

DNS

DNS (Domain Name System) is a distributed, hierarchical database that maps names to addresses. Root servers point to TLD servers (.pk, .com), which point to the domain's authoritative servers. Your host usually sends a recursive query to a local resolver, which then queries the hierarchy iteratively and caches each answer for its TTL.

Common record types: A (IPv4 address), AAAA (IPv6), CNAME (alias), MX (mail server), NS (name server) and PTR (reverse lookup). Exam angle: a host that can ping an IP address but not a name has a DNS problem, not a routing one.

SMTP

SMTP (Simple Mail Transfer Protocol) pushes mail from a sender's client to its mail server and from server to server. Retrieval uses different protocols: POP3 downloads to one device, while IMAP keeps mail and folders on the server.

Example: Bob sends from webmail in his browser to Sara, who reads on her phone. The path is HTTP (browser to Bob's server), SMTP (Bob's server to Sara's server), then IMAP (Sara's server to her phone). Exam angle: SMTP is push; POP3 and IMAP are pull.

FTP

FTP (File Transfer Protocol) uses two TCP connections. The control connection on port 21 stays open for commands such as USER, RETR (download) and STOR (upload); a separate data connection opens for each file. Because commands travel on their own connection, FTP is said to send control information "out of band". It is also stateful, since the server tracks the user's current directory.

In active mode the server connects back to the client from port 20; in passive mode (PASV) the client opens the data connection, which works through NAT. Exam angle: FTP is stateful and out of band; HTTP is stateless and in band.

DHCP

DHCP (Dynamic Host Configuration Protocol) leases an IP address, subnet mask, default gateway and DNS server to a host. It follows four steps, known as DORA: Discover (broadcast from 0.0.0.0 to 255.255.255.255), Offer, Request and Acknowledge. It runs over UDP because the client has no address yet. Exam angle: an address in 169.254.0.0/16 means no DHCP server answered.

Common traps

Worked examples

Understanding. Which protocol converts www.hec.gov.pk into an IP address? Answer: DNS. The resolver follows root, .pk TLD and authoritative servers, or answers from its cache.

Application. A page has a base HTML file and 5 images. With non-persistent HTTP and up to 5 parallel connections, and an RTT of 30 ms, how long does it take, ignoring transmission time? Answer: 120 ms. The base file needs 2 RTTs (handshake plus request). All 5 images then load in parallel in 2 more RTTs: 4 × 30 = 120 ms.

Analysis. After joining a new Wi-Fi network, a laptop gets 192.168.0.23, can open http://142.250.181.14 by address, but cannot resolve any names. Other laptops are fine. What is wrong? Answer: the DNS setting. Addressing, the gateway and routing work, because traffic by IP succeeds. The laptop is probably using a manually set or unreachable DNS server instead of the one DHCP offered.

Practise

The quiz below has 100 Application Layer questions, which you can filter by tier and difficulty.

Practise: 100 questions

Interactive quiz loading. The first 10 questions are shown below.

  1. Which port does an HTTP server listen on by default?

    1. 443
    2. 21
    3. 25
    4. 80
    Show answer

    Answer: D. 80

    Plain HTTP uses TCP port 80. HTTPS (HTTP over TLS) uses 443, FTP control uses 21 and SMTP uses 25.

  2. Which DNS record type maps a host name to an IPv4 address?

    1. A
    2. AAAA
    3. MX
    4. CNAME
    Show answer

    Answer: A. A

    An A record holds an IPv4 address. AAAA holds an IPv6 address, MX names a domain's mail server and CNAME makes one name an alias of another.

  3. Which DNS record tells other mail servers where to deliver email for a domain?

    1. MX
    2. NS
    3. PTR
    4. A
    Show answer

    Answer: A. MX

    The MX (mail exchanger) record lists the mail server(s) for a domain, with preference values. NS names the authoritative name servers and PTR is used for reverse lookups.

  4. What are the four DHCP messages, in order, when a client first gets an address?

    1. Request, Offer, Discover, Acknowledge
    2. Discover, Request, Offer, Acknowledge
    3. Offer, Discover, Acknowledge, Request
    4. Discover, Offer, Request, Acknowledge
    Show answer

    Answer: D. Discover, Offer, Request, Acknowledge

    DHCP is often remembered as DORA: the client broadcasts Discover, servers reply with an Offer, the client broadcasts a Request for one offer and the chosen server confirms with an ACK.

  5. Which transport protocol and ports does DHCP use?

    1. TCP, server 67 and client 68
    2. UDP, port 53 for both
    3. UDP, server 67 and client 68
    4. TCP, port 80 for both
    Show answer

    Answer: C. UDP, server 67 and client 68

    DHCP runs over UDP because the client has no IP address yet and must broadcast. Servers listen on port 67 and clients on port 68. Port 53 is DNS.

  6. Which protocol does a mail server use to push an email to the recipient's mail server?

    1. IMAP
    2. POP3
    3. SMTP
    4. HTTP
    Show answer

    Answer: C. SMTP

    SMTP is a push protocol used from the sender's client to its server and between mail servers. IMAP and POP3 are pull protocols that a recipient uses to read mail from their own server.

  7. Why is FTP said to send its control information 'out of band'?

    1. It sends commands over UDP and data over TCP
    2. It encrypts commands but not data
    3. It uses a separate TCP connection for commands (port 21) from the one carrying file data
    4. It sends commands inside the HTTP header
    Show answer

    Answer: C. It uses a separate TCP connection for commands (port 21) from the one carrying file data

    FTP keeps a persistent control connection on port 21 for commands such as USER, RETR and STOR, and opens a separate data connection for each file transfer. HTTP, by contrast, sends its headers in band on the same connection as the data.

  8. In active-mode FTP, who opens the data connection?

    1. The server, from its port 20 to a port the client announced
    2. The client, to the server's port 21
    3. The client, to a port the server announced with PASV
    4. The server, using UDP
    Show answer

    Answer: A. The server, from its port 20 to a port the client announced

    In active mode the client sends a PORT command and the server connects back from port 20. In passive mode (PASV) the server announces a port and the client opens the data connection, which works better through client-side firewalls and NAT.

  9. HTTP is described as stateless. What does that mean?

    1. The connection closes after every byte
    2. HTTP cannot carry cookies
    3. The server keeps no memory of earlier requests from the same client
    4. The server never stores files
    Show answer

    Answer: C. The server keeps no memory of earlier requests from the same client

    Each HTTP request is handled on its own, without the server remembering previous ones. Applications add state on top, for example with cookies that the browser sends back on later requests.

  10. Which HTTP status code means the cached copy is still valid after a conditional GET?

    1. 200 OK
    2. 301 Moved Permanently
    3. 412 Precondition Failed
    4. 304 Not Modified
    Show answer

    Answer: D. 304 Not Modified

    A cache sends a conditional GET with If-Modified-Since or If-None-Match. If the resource has not changed, the server replies 304 Not Modified with no body, and the cache serves its copy.

FAQs

Which application-layer protocols use UDP?

DNS (for normal queries), DHCP, TFTP, SNMP and many real-time media protocols use UDP. HTTP/3 also uses UDP, through QUIC. HTTP/1.1, HTTP/2, SMTP, POP3, IMAP, FTP, SSH and Telnet use TCP because they need reliable, ordered delivery.

What is the difference between a recursive and an iterative DNS query?

In a recursive query, the server must return the final answer or an error, doing any further lookups itself. In an iterative query, the server replies with the best it knows, often a referral to another server, and the asker continues. Hosts usually query their resolver recursively; resolvers query the hierarchy iteratively.

Is HTTPS a separate protocol from HTTP?

HTTPS is HTTP sent over TLS (Transport Layer Security), normally on port 443. The HTTP messages are the same; TLS encrypts them and authenticates the server with a certificate. Security details are covered in the network security topic.

How is this different from the Web Development area?

Here the focus is on how protocols work: ports, transport choices, message flow and timing. The Web Development MCQs focus on building web applications, such as HTML, CSS, JavaScript, REST APIs and server-side frameworks. HTTP status codes and methods appear in both.

Next step

Continue with Wireless Networks MCQs, go back to the Networks & Cloud hub, or test every area in an NSCT mock test.