QA Interview Hub · Knowledge base · Quizzes · Українська
10 Networking questions that come up in QA interviews, with short answers. Open the topic in the knowledge base for a deeper explanation.
An IP address identifies a device on a network (IPv4 like 192.168.1.10 or IPv6), and a port identifies a specific application on it: from 0 to 65535. Together they say where the connection goes: 203.0.113.5:443. HTTP uses port 80 by default, HTTPS uses 443. HTTPS is the same HTTP over TLS: the traffic is encrypted, it cannot be changed in transit unnoticed, and the certificate proves that the client is talking to the right server. For QA this means that in tests and on staging environments the certificate validity should be checked and sensitive data must not go over HTTP.
I go from the name to the application: DNS (the name did not resolve), IP/route (host unreachable), TCP (refused: the port is closed, timeout: packets are dropped, reset: the connection was aborted), TLS (certificate, version), HTTP (codes, headers), application (5xx from the backend). ECONNREFUSED is transport, not a "bug in HTTP"; 502/504 are issued by a gateway, so I look for the cause behind it.
TCP: a connection, guaranteed delivery, ordering, congestion control; HTTP/1.1, HTTP/2, WebSocket, databases. UDP: no connection or guarantees, minimal overhead; DNS, voice/video, games and QUIC, which HTTP/3 runs on and which implements reliability itself. The price of TCP is the handshake and stalling the whole stream on a lost packet.
Browser → OS cache → recursive resolver → root → TLD → authoritative server; each level caches. Records: A/AAAA (IP), CNAME (an alias, not at the apex), MX, TXT, NS. TTL is how many seconds an answer may be cached: a long one reduces load but slows changes, so the TTL is lowered before a migration. Diagnostics: dig, dig @1.1.1.1, nslookup.
URL parsing and HSTS → caches (HTTP cache, Service Worker) → DNS → TCP handshake → TLS handshake (ALPN: h2 or http/1.1; the browser learns about h3 from Alt-Svc or the HTTPS DNS record) → an HTTP request through a CDN/balancer/proxy → the response (TTFB, body) → rendering and subresources (each domain needs its own DNS/TCP/TLS). For every step I can name the cost and a typical error; the Network tab shows it in Timing.
HTTP/1.1: text, keep-alive, requests one after another on a connection (HOL), a browser opens ~6 connections per host. HTTP/2: binary frames, multiplexing in one TCP connection, HPACK, but a lost packet stalls all streams. HTTP/3: QUIC over UDP, independent streams, TLS 1.3 inside the protocol, faster start, migration between networks, QPACK. The semantics (methods, codes) are the same; the client learns about h3 from Alt-Svc or DNS HTTPS, and falls back to h2 when UDP is blocked.
A reverse proxy (nginx, Envoy) sits in front of services: terminates TLS, routes, compresses, caches. A balancer distributes load: L4 works with TCP and does not see HTTP, L7 routes by host, path, headers; a health check removes unhealthy instances. A CDN caches responses at the edge closer to the user. The real client IP is in X-Forwarded-For (a client can forge it); timeouts (idle, read) exist on every hop.
All three are usually issued by a gateway (proxy/balancer/CDN); a 503 can also come from the application itself (maintenance, overload). 502: an invalid upstream response or failure to connect (the service is down, restarting). 503: unavailable or overloaded (no healthy backends, often with Retry-After). 504: the upstream did not answer within the proxy timeout (a round number of seconds points to a configured limit). Diagnostics: proxy and upstream logs, Server/Via headers, x-request-id.
SSE: a one-way stream from the server over plain HTTP, text, built-in reconnect and Last-Event-ID (notifications, progress, LLM streaming). WebSocket: two-way, text and binary data, low latency (chat, collaborative editing, games), but reconnect, authorization and sticky connections are on you. Long/short polling: the simplest and most compatible but the most expensive in requests and latency. I pick the simplest option that covers the direction of data.
DevTools Network: Timing (DNS, Initial connection, SSL, Waiting/TTFB, Download), Protocol, HAR (sanitize tokens). Playwright: page.route (fulfill/continue/abort), recordHar and routeFromHAR, context.setOffline, CDP Network.emulateNetworkConditions (marked deprecated in CDP but still available) for throttling in Chromium. Proxies: Charles/Fiddler/mitmproxy (a trusted root is needed, pinning blocks it). CLI: curl -v and -w with timings, dig/nslookup, ping, traceroute, nc.