OSI & TCP/IP • TCP & UDP • IP & Subnetting • DNS & HTTPS • Load Balancers & CDNs • 2026

Computer Networks Interview Questions

30 questions What each one tests, an answer frame, a spoken answer 35 min read

This page is for anyone facing a networking round as part of a software, cloud or support interview, from campus placements to senior backend roles. Most rounds start with the OSI and TCP/IP models, move to TCP versus UDP, the handshake and congestion control, then test IP addressing, subnetting, DNS and what happens when you type a URL. Stronger rounds add TLS, NAT, routing, load balancers, CDNs and a live troubleshooting scenario. Each question shows what the interviewer is really checking, the shape of a strong answer and a short answer you can say out loud. Practise saying them, then swap in your own stories.

Search all questions by round, difficulty and level, or save the ones you want to practise.

Network Models 2 questions

Easy Technical round Fresher, Mid-level Practice question

1. Name the seven OSI layers and tell me how they map onto the TCP/IP model that the internet actually uses.

What the interviewer is really testing:
Whether you can use the layers as a tool for placing protocols and problems, not just recite a list you memorised.
Answer frame:

OSI: physical, data link, network, transport, session, presentation, application, with one example protocol each.

TCP/IP: four layers: link, internet, transport, application; session and presentation fold into application.

Why it matters: the layers tell you where to look when something breaks.

Sample spoken answer:

"From the bottom, OSI has physical, which is the signal on the wire or radio, then data link, which moves frames between machines on the same network using MAC addresses, like Ethernet or Wi-Fi. Network is IP and routing between networks. Transport is TCP and UDP, which give you ports and, for TCP, reliability. Then session, presentation and application on top. The TCP/IP model is simpler: link, internet, transport and application. It folds session and presentation into the application layer, because in practice things like encryption and session handling live inside the application or a library like TLS. I mostly use the layers when debugging. If I can ping a server but the web page fails, layers one to three are fine and I look at transport or application instead."

Red flag to avoid:

Reciting the seven names with no idea which real protocol sits at which layer, or putting HTTP at the transport layer.

They may ask next:
  • Where would you put TLS, and why do people argue about it?
  • At which layer does a MAC address matter, and at which does an IP address matter?
Say it in 60 seconds
Easy Technical round Fresher Practice question

2. A hub, a switch and a router all connect machines together. At which layer does each work, and how does each decide where traffic goes?

What the interviewer is really testing:
Whether you understand the difference between repeating bits, forwarding frames by MAC address and routing packets by IP address.
Answer frame:

Hub: layer 1; repeats every bit out of every port, so all devices share one collision domain.

Switch: layer 2; learns which MAC address sits on which port and forwards frames only there.

Router: layer 3; joins different networks and forwards packets using the destination IP and a routing table.

Sample spoken answer:

"A hub is the simplest. It works at layer one and just repeats whatever comes in on one port out of every other port, so everyone sees everything and collisions are common. A switch works at layer two. It watches the source MAC address of each frame and builds a table of which address is on which port, so it can send a frame only to the right port. If it doesn't know the destination yet, it floods the frame, and broadcasts still go everywhere. A router works at layer three. It connects separate networks, looks at the destination IP address, checks its routing table and sends the packet towards the next hop. That's also where broadcasts stop, so a router splits a network into separate broadcast domains."

Red flag to avoid:

Saying a switch uses IP addresses to forward, or that a hub and a switch are the same thing with different names.

They may ask next:
  • What does a switch do with a frame for a MAC address it hasn't learned yet?
  • What is a layer three switch, and how is it different from a router?
Say it in 60 seconds

Transport Layer 8 questions

Easy Technical round Fresher, Mid-level Practice question

3. What's the difference between TCP and UDP, and how do you decide which one an application should use?

What the interviewer is really testing:
Whether you can connect protocol features to real application needs instead of repeating 'TCP is reliable, UDP is fast'.
Answer frame:

TCP: connection-based, ordered, reliable byte stream with flow and congestion control.

UDP: connectionless datagrams, no delivery or order guarantee, very little overhead.

Choosing: does late data still have value? If a retransmitted packet arrives too late to use, UDP fits.

Sample spoken answer:

"TCP sets up a connection first, numbers every byte, acknowledges what arrives and resends what's lost, so the application gets a reliable, in-order stream. It also slows down when the receiver or the network is overloaded. UDP just sends independent datagrams. There's no handshake, no retransmission and no ordering, so it's lighter, but the application has to cope with loss itself. The way I decide is to ask whether late data is still useful. For a file download, a web page or a database query, every byte matters, so TCP. For a voice or video call, or a multiplayer game, a packet that arrives half a second late is useless, so UDP is better and the app just carries on. DNS lookups use UDP too, because a tiny question and answer doesn't need a connection."

Red flag to avoid:

Saying UDP is always faster so it's always better for performance, without mentioning what the app loses.

They may ask next:
  • If UDP has no reliability, how does a video call cope with lost packets?
  • Why does DNS switch to TCP for some queries?
Say it in 60 seconds
Medium Technical round Fresher, Mid-level Practice question

4. Walk me through the TCP three-way handshake. Why does it need three steps and not two?

What the interviewer is really testing:
Whether you know what the handshake actually agrees on, sequence numbers in both directions, rather than just the names SYN and ACK.
Answer frame:

SYN: client sends its initial sequence number.

SYN-ACK: server acknowledges it (client number plus one) and sends its own initial number.

ACK: client acknowledges the server's number; both directions are now confirmed.

Why three: each side must pick a sequence number and hear it confirmed; two steps leave the server's unconfirmed.

Sample spoken answer:

"The client sends a SYN carrying a starting sequence number, say X. The server replies with a SYN-ACK: it acknowledges X plus one, and it sends its own starting number, Y. Then the client sends an ACK for Y plus one, and the connection is open in both directions. The reason it's three and not two is that TCP is two independent byte streams, one each way, and each side needs to choose a sequence number and know the other side got it. With only two messages, the server would never learn whether the client received its number. The third step also protects against an old, delayed SYN from a previous connection turning up and making the server open a connection nobody wants, because the client doesn't recognise it and answers with a reset instead of a confirmation."

Red flag to avoid:

Describing SYN, SYN-ACK, ACK correctly but having no answer for why a third message is needed.

They may ask next:
  • What is a SYN flood, and how do SYN cookies help?
  • Why aren't initial sequence numbers just zero?
Say it in 60 seconds
Hard Technical round Mid-level, Senior Practice question

5. How is a TCP connection closed, and why does a busy server or client sometimes show thousands of sockets in TIME_WAIT?

What the interviewer is really testing:
Whether you understand connection teardown well enough to diagnose socket states you'll actually see in production.
Answer frame:

Teardown: each side sends a FIN and gets an ACK, because each direction closes on its own.

TIME_WAIT: the side that closes first waits about twice the maximum segment lifetime before freeing the socket.

Why: late packets from the old connection die out, and the last ACK can be resent if it was lost.

In practice: reuse connections; lots of CLOSE_WAIT instead points to an app not closing sockets.

Sample spoken answer:

"Closing is usually four segments, because each direction shuts separately. One side sends a FIN, the other acknowledges it, and when that side is also done it sends its own FIN, which gets acknowledged too. The side that sent the first FIN then sits in TIME_WAIT for twice the maximum segment lifetime. That wait is on purpose: if the final ACK got lost, the other side will resend its FIN and we can answer, and any stray packets from the old connection expire before the same address and port pair gets reused. You see thousands of them when something opens a new connection per request and closes it straight away, which can use up ephemeral ports on a client. The fix is usually connection reuse through keep-alive or a pool. If I see lots of CLOSE_WAIT instead, that's different: it means our application got the FIN but never closed its socket, which is a bug in our code."

Red flag to avoid:

Treating TIME_WAIT as a bug to be disabled, or mixing it up with CLOSE_WAIT, which really is an application bug.

They may ask next:
  • Which side ends up in TIME_WAIT, and can you choose which side that is?
  • Why is turning TIME_WAIT off completely a bad idea?
Say it in 60 seconds
Medium Technical round Fresher, Mid-level, Senior Practice question

6. TCP has both flow control and congestion control. What problem does each one solve, and how does the sender decide how much to send?

What the interviewer is really testing:
Whether you can separate protecting the receiver from protecting the network, which candidates often blur together.
Answer frame:

Flow control: protects the receiver; it advertises a receive window of how much buffer it has left.

Congestion control: protects the network; the sender keeps its own congestion window, grown and shrunk based on loss or delay.

The rule: the sender may have in flight no more than the smaller of the two windows.

Phases: slow start grows fast, then congestion avoidance grows slowly, and loss cuts the window.

Sample spoken answer:

"Flow control is about the receiver. Every ACK carries a receive window, which says how much more data the receiver can buffer right now. If the application on the other end is slow to read, that window shrinks, even to zero, and the sender has to wait. Congestion control is about the network in between. The receiver might have plenty of room, but a router along the path might be overloaded. So the sender keeps its own congestion window. It starts small and roughly doubles each round trip in slow start, then after a threshold grows slowly, and when it sees loss it cuts the window back. The amount in flight at any moment is the smaller of the two windows. So one guards the other machine, the other guards everyone sharing the path."

Red flag to avoid:

Using flow control and congestion control as two names for the same thing.

They may ask next:
  • What happens when the receive window drops to zero, and how does the sender find out it has opened again?
  • Why can loss-based congestion control struggle on a wireless link?
Say it in 60 seconds
Medium Technical round Fresher, Mid-level Practice question

7. IP can drop, duplicate or reorder packets. How does TCP still hand the application a complete, in-order stream?

What the interviewer is really testing:
Whether you know the actual mechanisms behind 'TCP is reliable': sequence numbers, acknowledgements, timers and reordering.
Answer frame:

Sequence numbers: every byte is numbered, so the receiver can put data back in order and drop duplicates.

Acknowledgements: the receiver acknowledges the next byte it expects.

Retransmission: a timeout, or three duplicate ACKs for fast retransmit, makes the sender resend.

Checksum: corrupted segments are discarded and treated as lost.

Sample spoken answer:

"It starts with sequence numbers. TCP numbers every byte it sends, so the receiver always knows where a segment belongs. If segments arrive out of order, it holds them in a buffer and only hands data to the application once the gap is filled. Duplicates are easy to spot and throw away. The receiver sends acknowledgements saying the next byte it's expecting, and those are cumulative. On the sender side, anything not acknowledged within a timeout gets sent again. There's also a faster path: if the sender gets three duplicate ACKs for the same number, it assumes that one segment was lost and resends it without waiting for the timer. And every segment carries a checksum, so a corrupted one is just dropped and handled like any other loss."

Red flag to avoid:

Saying TCP guarantees delivery no matter what, instead of guaranteeing that the app is told when the connection fails.

They may ask next:
  • What does selective acknowledgement add on top of cumulative ACKs?
  • How does TCP decide how long to wait before a retransmission?
Say it in 60 seconds
Medium Technical round Fresher, Mid-level Practice question

8. A web server listens on port 443, yet thousands of clients are connected to it at once. How does the operating system tell those connections apart?

What the interviewer is really testing:
Whether you understand what a port and a socket really are and that a connection is identified by more than one port number.
Answer frame:

Port: a 16-bit number that picks which process on a host gets the data.

Socket: one endpoint the program holds; the listening socket accepts, and each accept gives a new connected socket.

Identity: a TCP connection is the tuple of protocol, source IP, source port, destination IP and destination port.

Sample spoken answer:

"The port only says which service on the machine should get the traffic. The server has one listening socket bound to port 443. Each time a client connects, accept hands back a brand new socket just for that connection, and they all share local port 443. What makes each one unique is the full tuple: the protocol, the client's IP and port, and the server's IP and port. The client's side uses an ephemeral port that its operating system picks, so even two browser tabs on the same laptop come in on different source ports and look like different connections. That's why the limit on connections to a server is really memory and file descriptors, not the number of ports."

Red flag to avoid:

Saying the server opens a new port for every client or that it can only handle about 65 thousand clients because of port numbers.

They may ask next:
  • Where does a client run out of ports first: talking to many servers or to one server?
  • Can two processes on the same machine listen on the same port?
Say it in 60 seconds
Easy Behavioral round Fresher Practice question

9. Tell me about a project where you worked directly with sockets or a network protocol. What surprised you?

What the interviewer is really testing:
Whether your networking knowledge comes from building something, and whether you learned a real lesson such as message framing.
Answer frame:

Project: what you built and why sockets were involved.

Surprise: a real behaviour you didn't expect.

Fix: how you solved it and what it taught you about the protocol.

Sample spoken answer:

"In my final-year project I built a small chat app with a Python server and several clients talking over raw TCP sockets. It worked perfectly on my laptop, but when we tested across the college network, messages sometimes arrived glued together, or one message came in two pieces. That surprised me, because I thought each send would arrive as one receive. That's when I really understood that TCP is a byte stream, not a message stream. It guarantees the bytes arrive in order, but not where one message ends. I fixed it by adding framing: every message started with a four-byte length, and the receiver read exactly that many bytes before handling it. After that it was solid. It also made me appreciate why protocols like HTTP spend so much effort defining where a message starts and stops."

Red flag to avoid:

Describing a project only by the libraries used, with nothing learned about how the network actually behaved.

They may ask next:
  • Besides a length prefix, what other ways are there to frame messages on a stream?
  • How did your server handle many clients at once?
Say it in 60 seconds
Hard Situational round Mid-level, Senior Practice question

10. A teammate proposes switching your internal service calls from TCP to UDP to cut latency. How do you respond?

What the interviewer is really testing:
Whether you can weigh a protocol change against what the application would have to rebuild, and push back with evidence rather than opinion.
Answer frame:

Ask: what latency did we measure, and where is it actually spent?

Cost: UDP drops ordering, retransmission and congestion control, which the app would have to rebuild.

Cheaper fixes: reuse connections, pool them, and cut round trips first.

When yes: loss-tolerant data, or an existing protocol like QUIC rather than a home-made one.

Sample spoken answer:

"I'd start by asking what latency we measured and where it goes, because the answer usually isn't TCP itself. Inside a data centre, a round trip is tiny, and if we reuse connections through keep-alive or a pool, the handshake cost mostly disappears. The time normally goes to serialisation, queueing or the database. Then I'd lay out the cost. Our calls need every byte, in order, so with UDP we'd have to rebuild acknowledgements, retransmission, ordering and congestion control ourselves, and a home-made version is usually slower and buggier than TCP under load. I'd suggest we first measure, then try connection reuse and fewer round trips. If there's a real case, like streaming metrics where losing a sample is fine, UDP makes sense for that path. And if head-of-line blocking is the actual problem, a protocol like QUIC gives most of the benefit without inventing our own."

Red flag to avoid:

Agreeing because UDP is faster, or dismissing the idea without asking what problem the teammate is trying to solve.

They may ask next:
  • Which of your services would you actually be comfortable moving to UDP, and why?
  • How would you design an experiment to settle the argument?
Say it in 60 seconds

IP Addressing 4 questions

Easy Technical round Fresher Practice question

11. What does an address like 10.20.0.0/16 mean? And which IPv4 ranges are private, and why do they exist?

What the interviewer is really testing:
Whether you can read CIDR notation and know why private addressing and NAT exist.
Answer frame:

Address: 32 bits written as four octets.

Prefix: /16 means the first 16 bits are the network, the rest are hosts.

Private ranges: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16; not routed on the public internet.

Sample spoken answer:

"An IPv4 address is 32 bits, written as four numbers from zero to 255. The slash number says how many of those bits belong to the network. So 10.20.0.0/16 means the first 16 bits, 10.20, are fixed and the last 16 bits are for hosts, which gives 65,536 addresses, from 10.20.0.0 to 10.20.255.255. The private ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Anyone can use them inside their own network and they aren't routed on the public internet. They exist because there were never enough public IPv4 addresses for every device, so homes and companies use private addresses inside and share a few public ones through NAT at the edge."

Red flag to avoid:

Saying 172.16.0.0 to 172.31.255.255 is a /16, or thinking private addresses can be reached directly from the internet.

They may ask next:
  • What are 127.0.0.1 and 169.254.x.x addresses used for?
  • How many usable host addresses does a /24 give you, and why not 256?
Say it in 60 seconds
Medium Technical round Fresher, Mid-level Practice question

12. A host has the address 192.168.10.77/26. Work out its network address, broadcast address, usable host range and subnet mask.

What the interviewer is really testing:
Whether you can do subnet maths quickly and correctly in your head, which comes up in cloud and on-call work.
Answer frame:

Mask: /26 leaves 6 host bits, so the last octet is 192 and the mask is 255.255.255.192.

Block size: 256 minus 192 is 64, so subnets start at 0, 64, 128 and 192.

Place the host: 77 falls in the 64 block, so network .64, broadcast .127, hosts .65 to .126.

Sample spoken answer:

"A /26 means 26 network bits, so 24 of them fill the first three octets and two more bits go into the last octet. Two bits in the last octet is 128 plus 64, so the mask is 255.255.255.192. The quickest trick is block size: 256 minus 192 is 64, so this network is split into blocks starting at 0, 64, 128 and 192. The host's last octet is 77, which sits in the block from 64 to 127. So the network address is 192.168.10.64, the broadcast is 192.168.10.127, and the usable hosts run from .65 to .126. That's 64 addresses in the block minus the network and broadcast, so 62 usable hosts."

Code:
/26 -> mask 255.255.255.192, block size 64
0-63 | 64-127 | 128-191 | 192-255
77 is in 64-127
network   192.168.10.64
broadcast 192.168.10.127
hosts     192.168.10.65 - 192.168.10.126 (62 usable)
Red flag to avoid:

Getting a different network address each time you recalculate, or forgetting to subtract the network and broadcast addresses.

They may ask next:
  • You need at least 500 hosts in one subnet. What is the smallest prefix that works?
  • Could 192.168.10.64 and 192.168.10.130 talk directly without a router if both use /26?
Say it in 60 seconds
Medium Coding round Fresher, Mid-level Practice question

13. Write a function that checks whether an IPv4 address falls inside a CIDR block, such as 10.1.0.0/16, without using a networking library.

What the interviewer is really testing:
Whether you understand that addresses are just 32-bit numbers and a prefix check is a bit mask, and can code it cleanly.
Answer frame:

Convert: turn each dotted address into one 32-bit integer.

Mask: build a mask with the top prefix bits set to one.

Compare: the address and the network match if they are equal after masking.

Edges: handle /0 and /32 and mention input validation.

Sample spoken answer:

"I'd treat an IPv4 address as a single 32-bit number. First I split the dotted string into four parts and shift them into one integer, so the first octet sits in the top eight bits. For the CIDR block I split off the prefix length and build a mask with that many ones at the top, which is all ones shifted left by 32 minus the prefix, cut back to 32 bits. Then the check is one line: the address ANDed with the mask must equal the network ANDed with the mask. I'd test the edges. A /32 must only match the exact address, and a /0 must match everything, which works here because shifting by 32 and masking gives zero. In real code I'd validate each octet is between zero and 255, or just use the standard ipaddress module."

Code:
def ip_to_int(ip):
    a, b, c, d = (int(x) for x in ip.split("."))
    return (a << 24) | (b << 16) | (c << 8) | d

def in_cidr(ip, cidr):
    net, bits = cidr.split("/")
    bits = int(bits)
    mask = (0xFFFFFFFF << (32 - bits)) & 0xFFFFFFFF
    return (ip_to_int(ip) & mask) == (ip_to_int(net) & mask)

print(in_cidr("10.1.5.20", "10.1.0.0/16"))  # True
print(in_cidr("10.2.0.1", "10.1.0.0/16"))   # False
print(in_cidr("8.8.8.8", "0.0.0.0/0"))      # True
Red flag to avoid:

Comparing the addresses as strings, for example checking whether the IP starts with '10.1', which breaks for most prefix lengths.

They may ask next:
  • How would you check an address against thousands of CIDR blocks quickly?
  • What changes if you have to support IPv6 as well?
Say it in 60 seconds
Medium Technical round Mid-level, Senior Practice question

14. Beyond the longer address, what actually changes when you move from IPv4 to IPv6?

What the interviewer is really testing:
Whether you know IPv6 as a working protocol with different mechanisms, not just 'more addresses'.
Answer frame:

Addresses: 128 bits in hex groups; enough that NAT is no longer needed to save space.

Neighbours: no broadcast; Neighbor Discovery over multicast replaces ARP.

Setup: hosts can configure their own address from the router's prefix, as well as use DHCPv6.

Header: a simpler fixed header; routers don't fragment, only the sender does.

Sample spoken answer:

"The address is 128 bits written in hex groups, and the space is so big that every device can have a globally unique address, so NAT isn't needed to save addresses. That changes security thinking, because the firewall has to do the job NAT was doing by accident. There's no broadcast in IPv6. Finding a neighbour's MAC address uses Neighbor Discovery over multicast instead of ARP. Hosts can build their own address from the prefix the router advertises, which is called stateless autoconfiguration, or use DHCPv6. The header is a simpler fixed size with optional extension headers, it drops the header checksum, and routers no longer fragment packets; the sender has to discover the path MTU and size packets itself. In practice most networks run both stacks side by side for a long time."

Red flag to avoid:

Saying the only difference is address length, or claiming IPv6 is automatically more secure.

They may ask next:
  • Why does blocking all ICMP hurt an IPv6 network more than an IPv4 one?
  • How does a client choose between an IPv4 and an IPv6 address for the same hostname?
Say it in 60 seconds

Application Layer 4 questions

Medium Technical round Fresher, Mid-level Practice question

15. Walk me through how a name like shop.example.com is turned into an IP address, starting from the moment my laptop needs it.

What the interviewer is really testing:
Whether you know the roles of the stub resolver, recursive resolver, root, TLD and authoritative servers, and where caching happens.
Answer frame:

Local: browser cache, then the operating system cache and hosts file.

Recursive resolver: the laptop asks one resolver to do the full lookup for it.

Walk the tree: root points to the .com servers, which point to example.com's authoritative servers, which answer.

Caching: every answer is cached for its TTL, so most lookups never go all the way.

Sample spoken answer:

"First the browser checks its own cache, then the operating system checks its cache and the hosts file. If there's nothing, the laptop sends one query to its configured recursive resolver, usually run by the network or a public DNS provider, and says, please give me the final answer. If that resolver doesn't have it cached, it does the walking. It asks a root server, which doesn't know the address but says, here are the servers for .com. It asks a .com server, which says, here are the authoritative name servers for example.com. Then it asks one of those, which returns the A record for shop.example.com, or AAAA for IPv6. The resolver sends that back to my laptop and caches it for the record's TTL, so the next person asking gets it straight away."

Red flag to avoid:

Saying the root server holds the IP address for every website, or leaving caching out of the story completely.

They may ask next:
  • What's the difference between an A record, a CNAME and an MX record?
  • What's the difference between a recursive and an iterative query?
Say it in 60 seconds
Hard Technical round Fresher, Mid-level, Senior Practice question

16. I type https://example.com into a browser and press Enter. Take me through everything that happens on the network until the page shows up.

What the interviewer is really testing:
Whether you can connect every layer into one story in the right order, and go deep wherever the interviewer pushes.
Answer frame:

Name: parse the URL, then resolve example.com through caches and DNS; ARP finds the gateway's MAC for anything leaving the local network.

Connect: TCP handshake to port 443 (or QUIC over UDP), then the TLS handshake.

Request: HTTP GET with the Host header, possibly through a CDN or load balancer to an app server.

Render: parse HTML, fetch CSS, scripts and images, often over the same connection, then paint.

Sample spoken answer:

"The browser parses the URL: scheme https, host example.com, default port 443, path slash. It needs an IP, so it checks its caches and then asks DNS. To send anything off my network, my laptop needs the router's MAC address, which it gets through ARP if it isn't cached. Then it opens a TCP connection to port 443 with the three-way handshake, and on top of that runs a TLS handshake to agree keys and check the server's certificate. Now it sends an encrypted HTTP GET with a Host header. That request might hit a CDN edge or a load balancer first, which passes it to an application server, and the response comes back as HTML. The browser parses it, finds CSS, scripts and images, fetches those, usually reusing the same connection, then builds the page and paints it. If the site supports HTTP/3, the connection runs over QUIC on UDP instead."

Red flag to avoid:

Skipping DNS or TLS entirely, or putting the TLS handshake before the TCP connection exists.

They may ask next:
  • Where does NAT on my home router come into this story?
  • Which of these steps would you look at first if the page takes five seconds to load?
Say it in 60 seconds
Hard Technical round Mid-level, Senior Practice question

17. What problems did HTTP/2 fix in HTTP/1.1, and why did HTTP/3 move off TCP entirely?

What the interviewer is really testing:
Whether you understand head-of-line blocking at both the HTTP and the TCP level, which explains the whole evolution.
Answer frame:

HTTP/1.1: text protocol, one request at a time per connection, so browsers open several connections.

HTTP/2: binary frames, many streams multiplexed on one TCP connection, compressed headers.

The catch: one lost TCP packet stalls every stream, because TCP delivers bytes strictly in order.

HTTP/3: runs over QUIC on UDP; streams recover from loss independently and TLS 1.3 is built in.

Sample spoken answer:

"HTTP/1.1 keeps connections alive, but on one connection you effectively send one request and wait for its response before the next, so a slow response blocks everything behind it. Browsers work around that by opening several connections per host. HTTP/2 made the protocol binary and split it into streams, so many requests and responses can be interleaved on a single TCP connection, and it compresses headers, which repeat a lot. The problem it couldn't fix is at the TCP layer. TCP delivers bytes strictly in order, so if one packet is lost, every stream on that connection waits for the retransmission, even streams whose data already arrived. HTTP/3 solves that by running over QUIC, which sits on UDP and does its own reliability per stream, so a loss only stalls the stream it belongs to. QUIC also builds TLS 1.3 into its handshake, so setup is faster."

Red flag to avoid:

Saying HTTP/3 uses UDP so it's unreliable, or that HTTP/2 removed head-of-line blocking completely.

They may ask next:
  • Why might HTTP/2 perform worse than HTTP/1.1 on a very lossy network?
  • Why was QUIC built on UDP rather than as a brand new transport protocol?
Say it in 60 seconds
Hard Situational round Mid-level, Senior Practice question

18. You moved a site to a new server by changing its DNS record. An hour later, some users are still hitting the old server. What's going on and what do you do?

What the interviewer is really testing:
Whether you understand DNS caching and TTLs well enough to plan a migration and handle the messy middle period calmly.
Answer frame:

Explain: resolvers and clients cache the old answer until its TTL expires, and some hold it longer.

Verify: query the authoritative servers directly to confirm the change is right.

Contain: keep the old server working, ideally forwarding to the new one, until traffic dies off.

Next time: lower the TTL well before the move.

Sample spoken answer:

"That's DNS caching doing exactly what it's designed to do. Every resolver that looked up the old record keeps it until its TTL runs out, and if the TTL was a day, some users will see the old server for a day. Some applications and devices also cache lookups on their own and hold them longer. First I'd check the change itself is right by querying our authoritative name servers directly with dig, so I know it isn't a mistake on our side. Then I'd make sure nobody is harmed during the overlap. I'd keep the old server running and have it forward or proxy requests to the new one, especially anything that writes data, so users on the old address still get the right result. I'd watch the old server's traffic and switch it off only when it has dropped to nothing. For next time, I'd lower the TTL a day or two before the move, then raise it again afterwards."

Red flag to avoid:

Telling users to clear their cache, or shutting down the old server straight away.

They may ask next:
  • Why doesn't lowering the TTL at the moment of the change help much?
  • How would you move a database-backed app so writes don't land on both servers?
Say it in 60 seconds

Security & TLS 2 questions

Easy Technical round Fresher, Mid-level Practice question

19. What does HTTPS give you that plain HTTP doesn't? Be specific about what TLS protects and what it doesn't.

What the interviewer is really testing:
Whether you know the three guarantees of TLS and its limits, instead of just saying 'HTTPS is secure'.
Answer frame:

Confidentiality: data is encrypted, so people on the path can't read it.

Integrity: tampering in transit is detected.

Authentication: the certificate proves you're talking to the real owner of the domain.

Limits: it doesn't hide which IP you talk to, and doesn't make the site itself safe.

Sample spoken answer:

"HTTPS is just HTTP running inside a TLS connection, normally on port 443. TLS gives three things. Confidentiality: everything, including the path, headers, cookies and body, is encrypted, so someone on the same Wi-Fi or an ISP in the middle can't read it. Integrity: every record is protected so any change in transit is detected and the connection fails. And authentication: the server shows a certificate for the domain signed by a trusted authority, so I know I'm talking to the real site and not an attacker in the middle. What it doesn't protect is also worth saying. An observer still sees which IP address I'm talking to and roughly how much data moves, and HTTPS says nothing about whether the site itself is honest or has bugs. A phishing site can have a perfectly valid certificate."

Red flag to avoid:

Saying the padlock means a site is safe or trustworthy, or that HTTPS only encrypts form data like passwords.

They may ask next:
  • Can someone watching the network see which website I'm visiting over HTTPS?
  • What does HSTS add on top of HTTPS?
Say it in 60 seconds
Hard Technical round Mid-level, Senior Practice question

20. Explain the TLS handshake. How do a browser and a server it has never met agree on a secret key, and how does the browser know the server is genuine?

What the interviewer is really testing:
Whether you understand key exchange, certificate checks and why symmetric encryption is used for the data, not just the message names.
Answer frame:

Hello: the client sends supported versions, cipher suites and a key share; the server picks and replies with its own key share.

Key agreement: both sides combine key shares with Diffie-Hellman to derive the same session keys.

Proof: the server sends its certificate and signs the handshake with its private key; the client checks the chain and the signature.

Data: bulk data then uses fast symmetric encryption; TLS 1.3 does this in one round trip.

Sample spoken answer:

"In TLS 1.3, the client sends a ClientHello with the versions and cipher suites it supports and a Diffie-Hellman key share. The server picks the settings and replies with its own key share. From those two shares, both sides compute the same secret without ever sending it, and derive session keys. Because those key shares are fresh for every connection, stealing the server's private key later doesn't unlock old traffic, which is forward secrecy. Then the server sends its certificate and a signature over the handshake made with its private key. The browser checks that the certificate chains up to a trusted root, matches the domain and hasn't expired, and verifies the signature, which proves the server holds the private key. Both send Finished messages, and from then on data uses symmetric encryption like AES-GCM, because it's far faster than public-key crypto. TLS 1.2 took two round trips for this; 1.3 takes one."

Red flag to avoid:

Saying the browser encrypts all the page data with the server's public key, or that the certificate itself contains the session key.

They may ask next:
  • What is 0-RTT resumption, and what risk does it bring?
  • What exactly does the browser check when it validates a certificate chain?
Say it in 60 seconds

Local Network 2 questions

Medium Technical round Fresher, Mid-level Practice question

21. My laptop wants to send a packet to 192.168.1.20 on the same subnet, and another to 8.8.8.8. How does ARP work in each case?

What the interviewer is really testing:
Whether you know that IP picks the destination but frames need a MAC address, and that off-subnet traffic goes to the gateway's MAC.
Answer frame:

Decide: use the subnet mask to check whether the destination is local.

Local: broadcast 'who has 192.168.1.20?'; the owner replies with its MAC; cache it.

Remote: ARP for the default gateway instead; the frame goes to the gateway's MAC while the IP header still says 8.8.8.8.

Sample spoken answer:

"The laptop first compares the destination with its own address and subnet mask. For 192.168.1.20, it's on my subnet, so I can deliver directly, but Ethernet and Wi-Fi need a MAC address. So the laptop checks its ARP cache, and if it's empty it broadcasts an ARP request: who has 192.168.1.20, tell me. The machine with that IP replies directly with its MAC, the laptop caches it for a while, and sends the frame. For 8.8.8.8, the mask says it's not local, so I don't ARP for 8.8.8.8 at all. I ARP for my default gateway's IP instead, and send the frame to the router's MAC. The IP header still says 8.8.8.8 as the destination. At each hop, the MAC addresses change but the IP addresses stay the same, apart from NAT."

Red flag to avoid:

Saying the laptop ARPs for 8.8.8.8 across the internet, or that the destination IP gets rewritten to the router's address.

They may ask next:
  • What is ARP spoofing and what can an attacker do with it?
  • What is a gratuitous ARP and when would a machine send one?
Say it in 60 seconds
Easy Technical round Fresher Practice question

22. A new phone joins the office Wi-Fi and gets an IP address a second later. What happened in between?

What the interviewer is really testing:
Whether you know the DHCP exchange and what settings it hands out besides the address.
Answer frame:

Discover: the device broadcasts, since it has no address yet.

Offer: a DHCP server offers an address and settings.

Request: the device asks for that offer, again by broadcast so other servers know.

Acknowledge: the server confirms; the device gets an address, mask, gateway, DNS servers and a lease time.

Sample spoken answer:

"That's DHCP, and the four steps are usually remembered as DORA. The phone has no IP yet, so it broadcasts a Discover message asking for any DHCP server. A server, often the router or a central server, replies with an Offer: an address it's willing to lend, plus settings. The phone then broadcasts a Request for that specific offer. It's a broadcast so that any other server that made an offer knows it wasn't picked. Finally the server sends an Acknowledge, and the phone configures itself. Besides the IP address, it gets the subnet mask, the default gateway, the DNS servers and a lease time. The address is only lent, so the phone renews the lease before it runs out, and if it leaves, the address goes back into the pool."

Red flag to avoid:

Saying the router just picks a random free address, or not knowing that DHCP also hands out the gateway and DNS settings.

They may ask next:
  • How can one DHCP server hand out addresses to clients on several different subnets?
  • What does a device end up with if no DHCP server answers?
Say it in 60 seconds

Routing & NAT 2 questions

Medium Technical round Fresher, Mid-level Practice question

23. Twenty devices at home share one public IP address. How does NAT make that work, and why can't someone on the internet start a connection to my laptop?

What the interviewer is really testing:
Whether you understand port address translation and its side effects on inbound traffic, peer-to-peer apps and long idle connections.
Answer frame:

Outbound: the router swaps the private source IP and port for its public IP and a free port, and records the mapping.

Return: replies to that public port are translated back using the table.

Inbound: a new connection from outside matches no mapping, so it's dropped unless you set up port forwarding.

Side effects: mappings expire when idle, and peer-to-peer apps need traversal tricks.

Sample spoken answer:

"When my laptop at 192.168.1.10 opens a connection from port 50000, the home router rewrites the source to its public IP and picks a free public port, say 61000. It writes that mapping into a table. When the reply comes back to the public IP on port 61000, the router looks it up, rewrites the destination back to 192.168.1.10 port 50000, and forwards it. Using ports like this is what lets many devices share one address; strictly it's called PAT or NAPT. Now if someone on the internet sends a new connection to my public IP, there's no mapping for it, so the router has nowhere to send it and drops it. That's why you need port forwarding to host a server at home. Mappings also expire when a connection sits idle, which is why long-lived connections often send keepalives."

Red flag to avoid:

Thinking NAT gives each home device its own public address, or not knowing why unsolicited inbound traffic fails.

They may ask next:
  • How do two people behind different NATs manage a direct video call?
  • Is NAT a security feature? What would you say to someone who relies on it as a firewall?
Say it in 60 seconds
Medium Technical round Fresher, Mid-level Practice question

24. A router has routes for 10.0.0.0/8, 10.1.0.0/16 and a default route. A packet arrives for 10.1.4.9. Which route wins, and how does a router forward packets in general?

What the interviewer is really testing:
Whether you know longest prefix match, what a default route is, and how routes get into the table in the first place.
Answer frame:

Lookup: match the destination against the routing table; the most specific match, the longest prefix, wins.

Default: 0.0.0.0/0 catches everything with no better match.

Forward: decrement TTL, pick the next hop and interface, rebuild the layer 2 frame.

Sources: routes are directly connected, static, or learned from protocols like OSPF inside a network and BGP between networks.

Sample spoken answer:

"The 10.1.0.0/16 route wins. The address matches all three, but a router always picks the longest matching prefix, because it's the most specific. The /8 would be used for something like 10.2.0.1, and the default route, 0.0.0.0/0, only catches what nothing else matches, usually meaning send it towards the internet. In general, when a packet arrives, the router reads the destination IP, does that lookup, and gets a next hop and an outgoing interface. It decrements the TTL, and if that hits zero it drops the packet and sends back an ICMP time exceeded message, which is exactly what traceroute relies on. Then it wraps the packet in a new frame for the next link. Routes get into the table by being directly connected, by someone adding them statically, or by a routing protocol like OSPF inside an organisation or BGP between networks on the internet."

Red flag to avoid:

Picking the first route in the list or the /8 because it's 'bigger', or not knowing what a default route is for.

They may ask next:
  • What's the difference between a distance-vector and a link-state routing protocol?
  • What stops a packet from looping forever if two routers point at each other?
Say it in 60 seconds

Scaling Traffic 4 questions

Medium Technical round Mid-level, Senior Practice question

25. What's the difference between a layer 4 and a layer 7 load balancer, and how does a load balancer know a backend is unhealthy?

What the interviewer is really testing:
Whether you can choose between connection-level and request-level balancing and understand health checks and stickiness.
Answer frame:

Layer 4: balances TCP or UDP connections by IP and port; fast, protocol-agnostic, can't see URLs.

Layer 7: understands HTTP; can route by host, path or header, terminate TLS and retry requests.

Algorithms: round robin, least connections, or hashing for stickiness.

Health checks: regular probes; a failing backend is taken out of rotation.

Sample spoken answer:

"A layer 4 load balancer works on connections. It sees IPs and ports, picks a backend for each new TCP connection and passes the bytes through without understanding them. It's very fast and works for any protocol, but it can't route by URL, and every request on a long connection goes to the same backend. A layer 7 load balancer understands the application protocol, usually HTTP. It terminates the connection, often including TLS, reads each request, and can send slash api to one pool and slash images to another, add headers or retry a failed request elsewhere. It costs more CPU but gives far more control. For picking a backend, round robin and least connections are common, and hashing the client IP or a cookie gives stickiness. For health, it probes each backend on a schedule, like hitting a health endpoint, and after a few failures stops sending it traffic until it passes again."

Red flag to avoid:

Saying a layer 4 balancer can route based on URL path, or describing health checks as 'the load balancer just knows'.

They may ask next:
  • What problems do sticky sessions cause when you scale down or deploy?
  • What makes a good health check endpoint, and what makes a dangerous one?
Say it in 60 seconds
Medium Technical round Fresher, Mid-level, Senior Practice question

26. How does a CDN make a site faster for users far from the origin server, and how does a user's request end up at a nearby edge server?

What the interviewer is really testing:
Whether you understand caching at the edge, how traffic is steered to the edge, and the trade-off around stale content.
Answer frame:

Edges: servers in many locations keep copies of content close to users.

Steering: DNS answers with a nearby edge, or anycast lets many locations share one IP and routing picks the closest.

Hit or miss: a hit is served locally; a miss is fetched from the origin and cached per its cache headers.

Freshness: purge, short lifetimes, or versioned file names to change content safely.

Sample spoken answer:

"A CDN runs servers in many locations around the world. When a user asks for a file, the request goes to an edge near them instead of the origin. There are two common ways to get them there. With DNS steering, the site's hostname points to the CDN, and the CDN's DNS answers with an edge close to the user's resolver. With anycast, many locations announce the same IP address and internet routing naturally delivers the user to a nearby one. At the edge, if the file is cached, it's served straight away with a short round trip. If not, the edge fetches it from the origin once, then caches it for as long as the cache headers allow. The speed-up comes from shorter distance, reused warm connections back to the origin, and TLS finishing close to the user. The trade-off is freshness, so I prefer versioned file names for static assets over relying on purges."

Red flag to avoid:

Describing a CDN as just a faster server, or having no idea how users get routed to the nearest edge.

They may ask next:
  • Should an API response ever be cached at a CDN? When?
  • What happens to the origin when a popular item's cache entry expires everywhere at once?
Say it in 60 seconds
Medium Behavioral round Mid-level, Senior Practice question

27. Tell me about a time you made something faster by changing how it used the network rather than by changing its code.

What the interviewer is really testing:
Whether you measure where network time actually goes and choose fixes like connection reuse, caching or a CDN with evidence.
Answer frame:

Baseline: what was slow and how you measured it.

Diagnosis: where the time went: DNS, connection setup, TLS, waiting or download.

Change: the network-level fix and why it matched the diagnosis.

Result: the before and after, in plain terms.

Sample spoken answer:

"On a previous project our dashboard felt slow for users in other regions, even though the server logs said responses took a few milliseconds. I opened the browser's network waterfall from a test machine in one of those regions and saw that most of the time was connection setup, not the server: DNS, the TCP handshake and TLS, repeated for several different hostnames, each paying a long round trip to our only region. So I made two changes. We moved the static files behind a CDN, so they came from an edge close to the user, and we put the API behind the same hostname with keep-alive, so the browser reused one connection instead of opening new ones. Page load for those users dropped to roughly half, and we added the waterfall check to our release checklist so new third-party hosts didn't creep back in."

Red flag to avoid:

Claiming a big speed-up with no measurement before or after, or crediting a change that didn't match what was slow.

They may ask next:
  • How would you know whether the CDN was actually serving from cache?
  • What would you do for API calls that can't be cached at the edge?
Say it in 60 seconds
Medium Situational round Mid-level, Senior Practice question

28. Users in one country say your site has become slow, while everyone else is fine and the servers look healthy. How do you approach it?

What the interviewer is really testing:
Whether you can reason about the path between users and servers, not just the servers, and narrow things down with data.
Answer frame:

Scope: which users, which networks, since when, and which part of the page is slow.

Measure from there: test from that region to see DNS, connect, TLS and first byte times.

Suspects: DNS or CDN sending them to a far edge, a routing or peering change, packet loss on the path.

Act: reroute or change CDN settings, and talk to the provider with evidence.

Sample spoken answer:

"Healthy servers plus one slow region tells me the problem is probably on the path, so I'd start by narrowing it. Is it every user there or only one internet provider? When did it start? Is it the whole page or only certain requests? Then I'd measure from that region, with real-user timing data if we have it, or a test machine or monitoring probe there, and break the time into DNS, connect, TLS and first byte. If DNS or the CDN is sending them to an edge on another continent, connect times will be high, and that's a configuration fix. If connect is fine but there's packet loss, a traceroute or mtr from there shows where on the path it starts, which often means a routing or peering change at a provider. While that's being fixed, I'd consider steering those users to a different edge or region, and I'd raise it with the CDN or network provider with the measurements attached."

Red flag to avoid:

Scaling up the servers or restarting them when every server metric says they're fine.

They may ask next:
  • What would it tell you if only one mobile provider in that country was affected?
  • How would you set up monitoring so you hear about this before users complain?
Say it in 60 seconds

Troubleshooting 2 questions

Medium Technical round Fresher, Mid-level, Senior Practice question

29. A service works for everyone else, but from your machine the API just times out. Which commands would you run, in what order, and what does each one tell you?

What the interviewer is really testing:
Whether you debug bottom-up with the right tools and can read what each result rules in or out.
Answer frame:

Local: do I have an address, a gateway and working DNS settings?

Name: does the hostname resolve, and to the same address others get?

Path and port: can I reach the host, where does the path stop, and is the port open?

Application: a verbose request shows the TLS and HTTP details.

Sample spoken answer:

"I work up the layers. First, ip addr, or ipconfig on Windows, to check I have a sensible address and gateway, then ping the gateway to confirm my local network works. Next, dig or nslookup on the hostname. If my answer differs from what colleagues get, it could be a stale cache, a hosts file entry or a different resolver, and that alone explains a lot. Then I test the path. Ping might be blocked by a firewall, so a failed ping isn't proof of anything, but traceroute shows where packets stop. To check the port itself, nc or telnet to port 443 tells me if a TCP connection opens. Finally curl with verbose output shows the TLS handshake, the certificate and the HTTP status. Whichever step first fails tells me which layer and who to talk to, whether that's my VPN, the DNS team or the service owners."

Code:
ip addr                                  # my address and interface
ping -c 3 192.168.1.1                    # can I reach my gateway?
dig api.example.com                      # what does the name resolve to?
traceroute api.example.com               # where does the path stop?
nc -vz api.example.com 443               # does a TCP connection open?
curl -v https://api.example.com/health   # TLS and HTTP details
Red flag to avoid:

Concluding the server is down because ping fails, or jumping straight to restarting things without narrowing down the layer.

They may ask next:
  • On the server side, how would you confirm the service is actually listening on the port?
  • The connection opens but the request hangs only for large responses. What would you suspect?
Say it in 60 seconds
Hard Behavioral round Mid-level, Senior Practice question

30. Tell me about a network problem you tracked down that first looked like a bug in the application code.

What the interviewer is really testing:
Whether you can show a real investigation, with evidence at the network level, and a fix that addressed the actual cause.
Answer frame:

Symptom: what users or monitoring saw, and why it looked like an app bug.

Evidence: the pattern and the network-level data that pointed elsewhere.

Cause and fix: the real mechanism and the change you made.

Lesson: what you changed so the team catches it faster next time.

Sample spoken answer:

"At my last company, one service calling another would hang for about thirty seconds a few times a day, then fail with a timeout. It looked like the downstream service was freezing, but its logs showed the requests never arrived. I noticed the failures clustered on the first request after a quiet period. That pointed to idle connections. Our HTTP client kept pooled connections open indefinitely, but there was a firewall between the two networks that silently dropped idle connections after a set time. Our side still thought the connection was open, so the next request went into a dead connection and waited for the full timeout. I confirmed it with a packet capture showing retransmissions with no reply. The fix was to evict pooled connections before the firewall's idle limit and turn on TCP keepalive with an interval shorter than that limit. The hangs stopped completely, and I added the firewall's timeout to our service docs so the next team wouldn't rediscover it."

Red flag to avoid:

A story where the fix was adding retries or a longer timeout without ever finding out why connections were dying.

They may ask next:
  • How did you prove the request never reached the other service?
  • Why did it wait thirty seconds rather than failing straight away?
Say it in 60 seconds
Were you asked something else? Share it A person checks every question before it goes on the site. No name is shown.
For the call itself

The questions above are the prep. The call has ten more.

ClapAssist is an AI interview assistant for Mac and Windows. It listens to the interview on your computer and shows you what to say, in short lines you can read while you talk. Your resume and notes are never stored on our servers. It stays out of screen share on every plan; only you can see it.

Download ClapAssist with 10 free minutes
Mac and Windows · Stays out of screen share · No card