Networks Middle cheat sheet: interview answers

Every question of this level with its correct answer and explanation, on one page for a quick review before the interview.

  1. 1. What's the difference between a recursive resolver and an authoritative DNS server?

    Correct answer: The resolver finds answers for clients; the authoritative server owns the zone

    Your ISP or 8.8.8.8 is a recursive resolver: it walks root, TLD and authoritative servers and caches the result. The authoritative server holds the real records.

  2. 2. You plan to move a site to a new IP tomorrow. What should you do with the A record's TTL today?

    Correct answer: Lower it in advance so caches expire quickly after the switch

    Resolvers keep the old answer until its TTL ends. Lowering the TTL a day ahead makes the switch take minutes, not hours.

  3. 3. Why can't a bare domain like example.com usually be a CNAME?

    Correct answer: The zone apex must hold SOA and NS records, which can't sit beside a CNAME

    A CNAME can't coexist with other records at the same name. DNS providers offer ALIAS or ANAME (CNAME flattening) for the apex.

  4. 4. After a DNS change, some testers see the new site and others the old one. Why?

    Correct answer: Resolvers and devices still have the old answer cached

    Each resolver caches independently until the TTL runs out. Check with dig @8.8.8.8 and flush the local DNS cache.

  5. 5. How can you send a request to a specific server IP while keeping the real host name, without touching DNS?

    Correct answer: curl --resolve example.com:443:203.0.113.10 https://example.com

    --resolve pins a name to an IP for that call, so SNI, the Host header and the certificate check still use the real name. Handy to test a new server before switching DNS.

  6. 6. What is SNI in TLS?

    Correct answer: The client sends the host name in the handshake, so one IP can serve many certificates

    Without SNI a server on one IP can't know which site's certificate to show. Old clients without SNI get the default certificate.

  7. 7. Chrome on desktop opens the site fine, but an Android app fails with a certificate error. What is a common cause?

    Correct answer: The server doesn't send the intermediate certificate

    Desktop browsers can fetch missing intermediates or have them cached; many apps and libraries can't. The server must send the full chain.

  8. 8. What does the Subject Alternative Name (SAN) of a certificate list?

    Correct answer: The host names the certificate is valid for

    A certificate for example.com and www.example.com must list both. A wildcard like *.example.com covers one level of subdomains only.

  9. 9. Does a wildcard certificate for *.example.com cover api.v2.example.com?

    Correct answer: No: it covers one label, like api.example.com

    The wildcard matches exactly one label. Deeper names need their own SAN entry or another wildcard.

  10. 10. What does the Strict-Transport-Security (HSTS) header do?

    Correct answer: Tells the browser to use only HTTPS for the site

    After the first HTTPS visit the browser upgrades http:// itself, which stops downgrade attacks. A wrong HSTS on staging can lock testers out of http.

  11. 11. How many round trips does a fresh TLS 1.3 handshake need before app data?

    Correct answer: One

    TLS 1.2 needed two. TLS 1.3 also supports 0-RTT resumption, with a replay risk for non-idempotent requests.

  12. 12. Why is 0-RTT early data in TLS 1.3 risky for a POST that places an order?

    Correct answer: Early data can be replayed by an attacker

    Servers should accept 0-RTT only for safe, idempotent requests, or protect against replays.

  13. 13. What is certificate pinning in a mobile app?

    Correct answer: The app trusts only a specific certificate or key

    Pinning blocks MITM proxies too. Test builds usually turn it off or trust the proxy's CA so testers can inspect traffic.

  14. 14. What is mutual TLS (mTLS)?

    Correct answer: Both client and server present certificates

    mTLS is common between services and for B2B APIs. Tests need the client certificate and key configured.

  15. 15. What's the difference between 302 and 307 redirects?

    Correct answer: 307 keeps the method; 302 may turn POST into GET

    Browsers historically changed POST to GET on 302. 307 (temporary) and 308 (permanent) forbid that.

  16. 16. A login form POSTs to an http:// URL that redirects with 301 to https://. What can go wrong?

    Correct answer: The browser may follow it as a GET and lose the form data

    Use 308 to keep the method, and better post to https:// directly so credentials never travel over HTTP.

  17. 17. What does an ETag response header enable?

    Correct answer: Conditional requests: has the resource changed?

    The browser sends If-None-Match with the ETag; the server answers 304 if nothing changed, saving the download.

  18. 18. What does Vary: Accept-Language tell caches?

    Correct answer: Store separate copies per Accept-Language value

    Without Vary, a CDN could serve the German page to an English user. Vary on high-cardinality headers hurts the hit rate.

  19. 19. After a deploy, users still get the old JavaScript file. What is the usual fix?

    Correct answer: Hashed file names, so a new build gets new URLs

    Content hashes like app.3f2a.js can be cached forever; a new version is a new URL. HTML stays short-cached or revalidated.

  20. 20. What does 206 Partial Content mean?

    Correct answer: The server returned only the requested byte range

    Range requests let video players seek and downloads resume. The client asks with a Range header.

  21. 21. What should a client do with a 429 response that has Retry-After: 30?

    Correct answer: Wait at least 30 seconds before retrying

    429 is rate limiting. Ignoring Retry-After makes the client hammer the server and stay blocked longer.

  22. 22. Why can HTTP/2 still suffer from head-of-line blocking?

    Correct answer: One lost TCP packet stalls all streams

    HTTP/2 fixes HOL at the HTTP layer, but TCP delivers bytes in order. QUIC in HTTP/3 fixes it per stream.

  23. 23. What is a benefit of QUIC on mobile networks?

    Correct answer: Connections can survive an IP change, e.g. Wi-Fi to 4G

    QUIC uses connection IDs instead of the IP and port tuple, so a network switch doesn't break the connection.

  24. 24. How does a browser find out that a server supports HTTP/3?

    Correct answer: From the Alt-Svc header or the HTTPS DNS record

    The first visit often uses HTTP/2 over TCP; later requests switch to QUIC. That's why the Protocol column can change between reloads.

  25. 25. What does the X-Forwarded-For header contain?

    Correct answer: The client IP as seen by the proxies in front of the app

    Behind a load balancer the app sees the proxy's IP. The header can be spoofed, so only trust values your own proxies add.

  26. 26. What's the difference between L4 and L7 load balancers?

    Correct answer: L4 routes by IP and port; L7 can route by HTTP path, host or headers

    An L7 balancer reads HTTP, so it can send /api to one service and terminate TLS. L4 just forwards connections.

  27. 27. A report export takes 90 s and users get 504 at exactly 60 s. What is the likely cause?

    Correct answer: An idle or request timeout on the proxy or load balancer

    Each hop has its own timeout. A fixed cut-off time points at a proxy setting; long jobs are better as async tasks.

  28. 28. WebSockets work locally but fail behind the company's nginx. What is often missing?

    Correct answer: Forwarding of the Upgrade and Connection headers

    The proxy must pass the upgrade handshake and keep the connection open longer than its normal read timeout.

  29. 29. What's the difference between WebSockets and Server-Sent Events?

    Correct answer: SSE is one-way server-to-client over HTTP; WebSockets are two-way

    SSE fits notifications and live feeds, reconnects on its own and passes most proxies. WebSockets fit chats and games.

  30. 30. A CORS response has Access-Control-Allow-Origin: * and the request sends cookies. What happens?

    Correct answer: The browser rejects it: credentials need an explicit origin

    With credentials the server must echo the exact origin and send Access-Control-Allow-Credentials: true.

  31. 31. What does SameSite=Lax on a session cookie do?

    Correct answer: Sends it only on top-level navigations, not on cross-site subrequests

    Lax is the browser default. It blocks most CSRF, but embedded cross-site flows like iframes may break without SameSite=None; Secure.

  32. 32. Why should HAR files from DevTools be handled carefully in bug reports?

    Correct answer: They contain cookies, tokens and request bodies

    A HAR has all headers and payloads. Remove sensitive data before sharing, or share only the relevant requests.

  33. 33. How can you check how a page behaves when one API call fails, using only DevTools?

    Correct answer: Block that request URL in the Network panel

    Request blocking makes the call fail at once. Local overrides can also return a custom response.

  34. 34. Which Linux tool can add delay, loss and jitter to a network interface?

    Correct answer: tc with netem

    For example tc qdisc add dev eth0 root netem delay 200ms loss 2%. It tests timeouts and retries under bad networks.

  35. 35. What is Toxiproxy used for in tests?

    Correct answer: Injecting latency, drops and timeouts between services

    Tests can make the database or an API slow or cut on purpose and check the app's timeouts, retries and errors.

  36. 36. A mobile app hangs for 60 s when the network drops mid-request. What should testers report?

    Correct answer: Missing or too long timeouts and no feedback to the user

    Clients need connect and read timeouts, a visible error and a retry option. Network loss is normal on mobile.

  37. 37. What is MTU, and what can a too-small path MTU cause?

    Correct answer: Max packet size on a link; big packets may vanish and hang

    If ICMP 'fragmentation needed' is blocked, big packets vanish: small requests work, large uploads hang. Classic VPN issue.

  38. 38. What is the TCP TIME_WAIT state?

    Correct answer: A closed connection's port waits so late packets can't mix in

    Many short outgoing connections can pile up TIME_WAIT and exhaust ports. Keep-alive and connection pools help.

  39. 39. What does a TCP RST (reset) mean for the client?

    Correct answer: The other side abruptly closed or refused the connection

    It shows as 'connection reset by peer'. Causes: a crashed process, a firewall, or a proxy closing an idle connection.

  40. 40. What does TCP slow start do?

    Correct answer: Starts with a small window and grows it as data is acked

    A new connection can't use full bandwidth at once. That's one more reason to reuse connections.

  41. 41. Why does a large file download faster on a nearby server than on a far one, even with the same bandwidth?

    Correct answer: Throughput is limited by window size divided by RTT

    The bandwidth-delay product means more RTT needs a bigger window to keep the pipe full; loss hurts long paths more.

  42. 42. What's the risk of testing an app only on IPv4?

    Correct answer: IPv6-only networks may break code that assumes IPv4

    Apps that parse IPs, use IPv4 literals or allowlist by IPv4 can fail. Apple requires apps to work on IPv6-only networks.

  43. 43. What is split-horizon DNS?

    Correct answer: One name gives different answers inside and outside

    Inside the office api.company.com may point to an internal IP. A bug may only reproduce outside the VPN.

  44. 44. What does DNS over HTTPS (DoH) change for testing?

    Correct answer: The browser may skip the OS resolver and the hosts file

    With DoH on, a hosts entry may be ignored by that browser. Turn off DoH or use --resolve to test against a specific IP.

  45. 45. What is a negative DNS cache?

    Correct answer: Caching of 'name doesn't exist' answers

    If a record was looked up before it existed, NXDOMAIN may stay cached for the zone's negative TTL.

  46. 46. How can Wireshark help when DevTools shows nothing useful?

    Correct answer: It captures packets below HTTP: DNS, TCP, resets

    Low-level issues like missing SYN-ACKs, RSTs or TLS alerts are visible only on the packet level.

  47. 47. Why do some proxy-based tests break with HTTP/3?

    Correct answer: QUIC runs over UDP, many proxies handle only TCP

    Browsers may skip the proxy for QUIC or fall back. Disable QUIC in the browser to force traffic through the proxy.

  48. 48. What does Certificate Transparency give site owners and testers?

    Correct answer: Public logs of every certificate issued for a domain

    Searching CT logs (e.g. crt.sh) reveals forgotten subdomains and certificates issued by mistake.

  49. 49. What does a 'self-signed certificate' warning on staging teach about production?

    Correct answer: Prod must use a trusted CA, or real users get the same warning

    Teams may trust a private CA on test devices. Never tell users to click through warnings.

  50. 50. What does Cache-Control: s-maxage=600 affect?

    Correct answer: Only shared caches like CDNs, for 600 seconds

    s-maxage overrides max-age for shared caches. The CDN can hold a page longer than browsers do.

  51. 51. After an article is updated, the CDN still serves the old version. What are the usual options?

    Correct answer: Purge that URL in the CDN or wait for its TTL

    CDNs serve cached copies until expiry. Use short TTLs with revalidation for pages that change, or purge on publish.

  52. 52. Why may a request work with curl but fail from the app with a TLS error?

    Correct answer: The app uses another trust store or TLS version

    Different runtimes (Java, Node, Android) have their own CA lists and TLS settings. Old runtimes may lack modern ciphers.

  53. 53. What does curl -k (--insecure) do, and why is it a red flag in production code?

    Correct answer: It skips certificate checks, so MITM goes unnoticed

    It's fine for a quick check on staging. In app code the same setting means anyone on the path can read traffic.

  54. 54. How does chunked transfer encoding work?

    Correct answer: The body is sent in pieces without knowing the total length up front

    Used for streaming in HTTP/1.1. HTTP/2 and 3 have their own framing and don't use it.

  55. 55. Why can an app under load see 'too many open files' or port exhaustion errors?

    Correct answer: It opens a new connection per request, no reuse

    Each socket is a file descriptor and an ephemeral port. Connection pools and keep-alive keep the count stable.

  56. 56. What does the 'Protocol' column in DevTools Network help you check?

    Correct answer: Whether requests use HTTP/1.1, h2 or h3

    Enable it via the column menu. A site expected to use HTTP/2 but showing http/1.1 points to a proxy or config problem.

  57. 57. Why is a request stuck in 'Stalled' or 'Queueing' in DevTools on HTTP/1.1?

    Correct answer: The browser allows about six connections per host, and they're busy

    HTTP/1.1 limits parallel connections. HTTP/2 multiplexing or fewer requests fixes it.

  58. 58. How do you see WebSocket messages in Chrome DevTools?

    Correct answer: Select the WS request in Network, then Messages

    Filter by WS and open the connection to see sent and received frames with timings.

  59. 59. Why may a site behave differently for testers on the office network than for users at home?

    Correct answer: Corporate proxies, DNS and firewalls change traffic

    Proxies can cache, strip headers, inject certificates or block ports. Reproduce on a clean network or mobile data.

  60. 60. What is a sticky session on a load balancer?

    Correct answer: Requests from one client go to the same backend server

    Needed when sessions live in server memory. It hides bugs that appear when a request lands on another node.

  61. 61. What do load balancer health checks do?

    Correct answer: Probe backends and skip the unhealthy ones

    A health endpoint that checks too much (e.g. a slow DB) can mark every node down at once.

  62. 62. Why can ping fail while the website works fine?

    Correct answer: ICMP can be blocked while TCP 443 is open

    Test the real service with curl or a TCP check. ping only shows ICMP reachability.

  63. 63. What does anycast mean for DNS and CDNs?

    Correct answer: Many servers share one IP, routing picks the nearest

    Users in different regions reach different machines on the same IP, which is why bugs can be regional.

  64. 64. Why should a hard-coded IP address in an app config worry testers?

    Correct answer: IPs change with failover or cloud moves and break it

    Names allow DNS-based failover. An IP also fails the certificate check unless the certificate lists that IP.

  65. 65. What does Connection: close in a response mean?

    Correct answer: The server will close the connection after this response

    The next request needs a new connection, with a new TCP and TLS handshake.

  66. 66. Why is it useful to test an app behind a captive portal (hotel or airport Wi-Fi)?

    Correct answer: Requests are redirected or intercepted until login

    Until the user logs in, HTTP may return a login page and HTTPS fails. Apps should detect it and tell the user.

  67. 67. How can you test a site from another region without a VPN?

    Correct answer: Use a cloud machine or test service in that region

    Geo depends on the IP. Time zone and language only change what the app shows locally.

  68. 68. Why may DevTools show a request as 'canceled'?

    Correct answer: The page navigated away or code aborted it

    Common with double clicks, fast navigation or AbortController. Check whether the cancel is intended.

  69. 69. What does Accept-Encoding: gzip, br in a request mean?

    Correct answer: The client can decompress gzip and Brotli bodies

    The server picks one and says so in Content-Encoding. Missing compression on big text files is a common performance bug.

  70. 70. Why should testers check both www and non-www versions of a site?

    Correct answer: They may have different DNS, certificates and redirects

    One may lack a certificate, redirect in a loop or set cookies the other can't read.

  71. 71. What does a client's retry loop need besides a retry count, to be safe for the server?

    Correct answer: Backoff with jitter between attempts

    Retrying at once and in sync from many clients turns a short outage into overload. Exponential backoff with random jitter spreads the load.

  72. 72. Why should a QA engineer check the response to a request with a very long URL?

    Correct answer: Proxies and servers have URL limits and may return 414

    Filters with many parameters can hit limits in nginx, CDNs or the app. The app should switch to POST or handle 414 clearly.

  73. 73. What happens when a proxy buffers the whole response before passing it on?

    Correct answer: Streaming responses like SSE arrive all at once

    Buffering breaks live updates. Proxies need buffering off for event streams, e.g. X-Accel-Buffering: no in nginx.

  74. 74. A user's session drops every time they switch from Wi-Fi to mobile data. What may the backend be doing?

    Correct answer: Binding the session to the client's IP address

    The IP changes on a network switch and behind carrier-grade NAT. Binding sessions to the IP breaks real users.

  75. 75. What can a QA engineer learn from the Server-Timing header in DevTools?

    Correct answer: How long the backend spent on parts of the request

    Backends can report e.g. db;dur=53 and cache;dur=2. DevTools shows them in the request's Timing tab.