Interview Q&A / Computer Networks

INTERVIEW Q&A · 55 QUESTIONS

Computer Networks interview questions

What happens when you open a website, TCP vs UDP, DNS and HTTP.

  1. What is the difference between cookies, sessions and tokens like JWT?

    A cookie is just a small piece of data the browser stores and sends back automatically. A session keeps login state on the server and puts only a random session ID in a cookie. A JWT is a signed token that carries the user's data itself, so the server can verify it without a lookup, but it is harder to revoke before it expires.

    AdvancedIn-depth5 min read
  2. UDP is unreliable. How can an application still get reliable delivery over it?

    The application adds what it needs on top: sequence numbers to order and detect gaps, acknowledgements and retransmission for missing data, and timers. QUIC, used by HTTP/3, does exactly this over UDP, along with congestion control and encryption.

    AdvancedQuick answer1 min read
  3. What is BGP, and why is it called the routing protocol of the internet?

    BGP (Border Gateway Protocol) exchanges routes between autonomous systems, the independently run networks that make up the internet, such as ISPs and large companies. It chooses paths by policy and AS path length, not simply the shortest link.

    AdvancedQuick answer1 min read
  4. What is DNS cache poisoning, and how is it prevented?

    An attacker tricks a resolver into caching a forged answer, such as a bank's name mapped to the attacker's IP. Later users of that resolver are sent to the fake site. Defences include random source ports and query IDs, and DNSSEC, which signs records.

    AdvancedQuick answer1 min read
  5. What is head-of-line blocking, and how do HTTP/2 and HTTP/3 deal with it?

    Head-of-line blocking is when one slow or lost item holds up everything queued behind it. HTTP/1.1 blocks at the request level, HTTP/2 fixes that with multiplexing but still blocks at the TCP level on packet loss, and HTTP/3 over QUIC removes even that.

    AdvancedQuick answer1 min read
  6. What is HTTP/3, and why does it run over QUIC instead of TCP?

    HTTP/3 is HTTP carried over QUIC, a protocol built on UDP that has its own reliable streams, congestion control and built-in TLS 1.3. It avoids TCP head-of-line blocking, connects faster, and survives network changes such as moving from Wi-Fi to mobile data.

    AdvancedQuick answer1 min read
  7. Why can you not put a CNAME record on the root domain, such as example.com?

    A CNAME means this name is an alias for another name, so no other record may exist at it. The root of a zone must also hold NS and SOA records, so a CNAME there would conflict. Providers offer ALIAS, ANAME or CNAME flattening as a workaround.

    AdvancedQuick answer1 min read