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 are the common HTTP methods and status codes, and what does idempotent mean?

    GET reads, POST creates or triggers an action, PUT replaces, PATCH partly updates and DELETE removes. A method is idempotent if repeating the same request leaves the server in the same state as doing it once - GET, PUT and DELETE are, POST is not. Status codes are grouped as 2xx success, 3xx redirect, 4xx client error and 5xx server error.

    BeginnerIn-depth5 min read
  2. What happens when you type a URL in the browser and press Enter?

    The browser finds the server's IP address with DNS, opens a TCP connection, sets up TLS for HTTPS, sends an HTTP request, gets a response and then parses and renders the HTML, CSS and JavaScript into the page you see.

    BeginnerIn-depth3 min read
  3. What is the difference between HTTP and HTTPS, and what does TLS actually do?

    HTTPS is HTTP sent inside a TLS connection. TLS gives three things plain HTTP lacks - encryption so others on the network cannot read the data, integrity so it cannot be changed in transit, and authentication through a certificate so you know you are talking to the real site.

    BeginnerIn-depth4 min read
  4. What is the difference between TCP and UDP?

    TCP is connection-based and reliable, with ordering, retransmission and flow control, so it suits web pages, email and file transfer. UDP just sends datagrams with no guarantees, so it is faster and lighter and suits video calls, games, DNS and live streaming.

    BeginnerIn-depth3 min read
  5. What is the OSI model, and how is it different from the TCP/IP model?

    The OSI model is a 7-layer reference model (Physical, Data Link, Network, Transport, Session, Presentation, Application) used to explain and troubleshoot networks. The TCP/IP model is the 4-layer model the internet actually runs on (Link, Internet, Transport, Application), which folds OSI's top three layers into one.

    BeginnerIn-depth4 min read
  6. How does DNS resolution work, step by step?

    Your device asks a recursive resolver, which checks its cache and, if needed, asks a root server, then the TLD server (like .com), then the domain's authoritative server, which returns the IP address. Every answer carries a TTL, so resolvers and devices cache it and skip most of these steps next time.

    IntermediateIn-depth4 min read
  7. What is an IP address, a subnet and CIDR notation like /24?

    An IPv4 address is a 32-bit number that identifies a device on a network. CIDR notation such as 192.168.1.0/24 says how many leading bits are the network part; the rest identify hosts. A /24 has 256 addresses (254 usable), a /16 has 65,536, and each extra bit halves the size of the subnet.

    IntermediateIn-depth4 min read
  8. 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
  9. What does each of the seven OSI layers do, in one line each?

    Physical sends bits, Data Link moves frames between neighbours, Network routes packets across networks, Transport delivers data between processes, Session manages dialogues, Presentation handles format and encryption, Application is what the user's software talks to.

    BeginnerQuick answer1 min read