Networks Senior 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. A Node.js API behind a cloud load balancer returns rare 502s under steady load. What timeout mismatch is a classic cause?

    Correct answer: The app closes idle keep-alive sockets before the balancer does

    If the backend's keep-alive timeout is shorter than the LB idle timeout, the LB may reuse a socket the app just closed. Keep the app timeout longer than the LB's.

  2. 2. Services in a private subnet get random connection timeouts to one external API at peak. What should you suspect first?

    Correct answer: Port exhaustion on the NAT gateway for that destination

    A NAT has a limited number of source ports per destination IP. Many short connections exhaust them; pooling and keep-alive help.

  3. 3. What is HTTP request smuggling?

    Correct answer: Proxy and backend parse message boundaries differently, so one request hides another

    Conflicting Content-Length and Transfer-Encoding can make the backend see a second request the proxy never checked. Test proxy and server pairs, not each alone.

  4. 4. What is web cache poisoning?

    Correct answer: An unkeyed input changes a response that the cache then serves to everyone

    If a header like X-Forwarded-Host affects the page but isn't in the cache key, one crafted request can poison the cached copy for all users.

  5. 5. What do stale-while-revalidate and stale-if-error add to caching?

    Correct answer: Serve a stale copy while refreshing, or when the origin fails

    They hide origin latency and outages from users. Testers should check how stale data may get and how it's marked.

  6. 6. Why can HTTP/2 connection coalescing lead to a 421 Misdirected Request?

    Correct answer: The browser reuses a connection for another host the server doesn't serve

    If two hosts share an IP and the certificate covers both, the browser may send requests for host B over A's connection. A server that can't route it answers 421.

  7. 7. A product moves to HTTP/3. What must the test plan cover besides performance?

    Correct answer: Fallback to HTTP/2 when UDP is blocked by firewalls or networks

    Many corporate and public networks block or throttle UDP. Clients must fall back cleanly, and monitoring should tell the protocols apart.

  8. 8. Why may a JVM service keep calling an old IP after a DNS failover?

    Correct answer: The runtime caches DNS answers longer than the record's TTL

    Some runtimes and HTTP clients cache lookups or pin a connection pool to one IP. Failover tests must check the client side, not just DNS.

  9. 9. How do you test that an app survives a DNS outage of its resolver?

    Correct answer: Block or delay DNS in a test environment and watch timeouts and caching

    Real outages make lookups slow, not just failed. Check resolver timeouts, retries, cached answers and error messages.

  10. 10. What is a PMTUD black hole?

    Correct answer: ICMP is filtered, so the sender never learns big packets are dropped

    TCP handshakes and small requests work, large responses hang. Fixes: allow ICMP 'fragmentation needed' or clamp the TCP MSS.

  11. 11. Retries are set at the client, gateway and service layers, three attempts each. What is the risk?

    Correct answer: One failing call can turn into 27 requests and amplify an outage

    Retries multiply across layers. Retry in one layer, add backoff and budgets, and make writes idempotent.

  12. 12. Why must deadlines or timeouts shrink at each layer of a call chain?

    Correct answer: An inner call outliving its caller does useless work

    If the gateway gives up at 10 s but the service waits 30 s on the DB, the work is wasted. Pass a deadline down the chain.

  13. 13. What is the main risk of an endpoint that fetches a user-supplied URL?

    Correct answer: SSRF: requests to internal hosts or cloud metadata at 169.254.169.254

    The server can reach places the user can't. Allowlist destinations, resolve and check IPs, and block private and link-local ranges.

  14. 14. How does DNS rebinding bypass an SSRF check that validates the host name first?

    Correct answer: The name resolves to a public IP at check time and an internal one at fetch

    Two lookups can return different IPs. Resolve once, check that IP, and connect to the same IP.

  15. 15. Why is Host header injection dangerous for password reset emails?

    Correct answer: The app may build the reset link from the attacker's Host value

    If the link domain comes from the request, the victim gets a link to the attacker's site with a valid token. Use a configured base URL.

  16. 16. A deploy restarts all WebSocket servers at once. What should the test catch?

    Correct answer: A reconnect storm: clients must back off with jitter

    Thousands of clients reconnecting in the same second can overload auth and the new servers. Drain connections and stagger reconnects.

  17. 17. How do you avoid dropping requests when a load balancer removes a node during deploy?

    Correct answer: Connection draining: stop new requests but let in-flight ones finish

    Draining with a timeout longer than typical requests avoids 502s. Long-lived connections need a graceful close.

  18. 18. What does OCSP stapling improve?

    Correct answer: The server sends a fresh revocation proof, so clients needn't ask the CA

    Without stapling, clients may query the CA's OCSP server, adding latency and leaking browsing data.

  19. 19. What should certificate monitoring for a production site include?

    Correct answer: Expiry alerts well ahead, chain checks and CT log watching

    Expired certificates still cause big outages. Alert weeks ahead, check the full chain from outside, and watch CT logs for unexpected issuance.

  20. 20. TLS ends at the load balancer and traffic to backends is plain HTTP. What should security testing check?

    Correct answer: That the internal network is trusted, or re-encrypt to the backends

    Plain HTTP inside is fine only if nothing untrusted can see it. Zero-trust setups re-encrypt or use mTLS between services.

  21. 21. In Kubernetes, a service can't reach the database after a new NetworkPolicy. What's the likely fix?

    Correct answer: Allow egress from the app's pods to the DB's pods

    Default-deny policies block everything not allowed. Test both the allowed paths and that forbidden paths really fail.

  22. 22. A service mesh sidecar adds its own retries and timeouts. Why does that matter to testers?

    Correct answer: App behavior depends on mesh config, which tests must match

    A bug may come from the mesh's 15 s timeout, not the code. Test environments need the same mesh settings as prod.

  23. 23. What does carrier-grade NAT mean for rate limiting by IP?

    Correct answer: Many unrelated users share one public IP and hit one limit

    Per-IP limits can block a whole city's mobile users. Prefer limits per account, token or device.

  24. 24. Why should an app avoid IPv4 literals in its code and config?

    Correct answer: On IPv6-only networks with NAT64 they fail, names work

    DNS64 synthesizes IPv6 addresses for names, not for literals. App stores test IPv6-only networks for this reason.

  25. 25. Why does Resource Timing show zeros for DNS and connect of a cross-origin request?

    Correct answer: The third party didn't send Timing-Allow-Origin

    Detailed timings of other origins are hidden unless they opt in. RUM for third-party APIs needs that header.

  26. 26. How should a team test behavior under a network partition between two regions?

    Correct answer: Cut the link in a test env and check data, failover and recovery

    Partitions cause split brain, stale reads and stuck queues. Check the system's chosen trade-off and how it heals.

  27. 27. A BGP route leak sends some traffic to a site through a far-away network. How would users notice?

    Correct answer: Sudden high latency or outages, often only in some regions

    Routing problems are regional and outside your servers. Multi-region checks and RUM by ASN help spot them.

  28. 28. What does a good network test matrix for a mobile app include?

    Correct answer: Wi-Fi, 4G, 3G, high latency, loss, offline and switches between them

    Bugs show up at transitions: timeouts, duplicate submits, lost data. Use emulation for repeatability and real devices for coverage.

  29. 29. A user taps 'Pay', the network drops, and the app retries. What must the backend have?

    Correct answer: An idempotency key, so the retry doesn't charge twice

    The first request may have succeeded before the drop. With a key the server returns the stored result.

  30. 30. Database connections through a firewall drop after an hour of idling, and the next query hangs. What helps?

    Correct answer: TCP keepalive or pool checks shorter than the idle timeout

    Stateful middleboxes forget idle connections silently. Keepalives or validating connections before use avoid hanging queries.

  31. 31. Why can a wrong system clock on a test machine break HTTPS and auth?

    Correct answer: Certificates and tokens are checked against current time

    A clock ahead or behind makes certificates look invalid and JWTs expired or not yet valid. Use NTP on all test hosts.

  32. 32. How does a team catch a CDN misconfiguration that caches personal pages?

    Correct answer: Check cache headers and Age/X-Cache for logged-in responses

    Any response with private data must be private or no-store. A test logs in as two users and checks they never see each other's data.

  33. 33. What is origin shielding in a CDN?

    Correct answer: Edge nodes fetch through one shield node, cutting origin load

    Without it, every edge location may fetch the same object on a purge. The shield collapses those misses.

  34. 34. Why is it risky that the origin server's IP is publicly known behind a CDN with a WAF?

    Correct answer: Attackers can bypass the CDN and WAF by hitting the origin directly

    Restrict the origin to the CDN's IP ranges or authenticated pulls. Test it by calling the origin IP directly.

  35. 35. What did the HTTP/2 'Rapid Reset' attack (2023) exploit?

    Correct answer: Opening and cancelling streams so fast the server kept doing work

    Stream resets cost the client almost nothing but the server allocated work for each. Fixed by limiting resets and stream churn.

  36. 36. How do you reproduce a bug seen only on a high-latency network in an automated test?

    Correct answer: Inject fixed latency and loss with netem or Toxiproxy

    Emulation makes the condition repeatable in CI. Bigger timeouts hide the bug instead of testing it.

  37. 37. What is Happy Eyeballs (RFC 8305) and why does it matter for testers?

    Correct answer: Clients race IPv6 and IPv4 so a broken IPv6 path doesn't stall them

    Without it, a broken IPv6 route causes long hangs before IPv4 is tried. Test with IPv6 deliberately broken.

  38. 38. Why may long-polling requests be cut at exactly 30 s in one data center but not another?

    Correct answer: A proxy or firewall idle timeout differs between them

    Middleboxes enforce their own idle limits. Long-lived HTTP needs heartbeats or a protocol meant for it.

  39. 39. What does the Alt-Svc header open as a test risk?

    Correct answer: A client may move to another endpoint and skip the proxy

    Traffic can move to QUIC on another endpoint. Tests through an intercepting proxy may stop seeing requests.

  40. 40. How should a team handle certificate rotation for mTLS between services?

    Correct answer: Overlap old and new certificates and trust both during the switch

    An overlap window avoids outages. Short-lived certificates with automatic rotation make expiry a non-event.

  41. 41. Why can open redirects matter even without direct damage?

    Correct answer: They make phishing links look trusted and can leak OAuth tokens

    A link to your domain that redirects anywhere is ideal for phishing. Allowlist redirect targets.

  42. 42. A client reports 'it's slow'. What network data helps most to triage?

    Correct answer: A HAR or RUM timings split into DNS, TLS, TTFB, download

    Phase timings point to the layer: slow DNS, distance, TLS issues, backend time or a large payload.

  43. 43. What is the risk of very low DNS TTLs on critical records?

    Correct answer: More lookups and a hard dependence on DNS uptime

    Short TTLs help failover but make every resolver depend on fresh answers. Balance, e.g. 60-300 s on records you may switch.

  44. 44. Why should load tests set the Host header and SNI to the real domain, not hit IPs?

    Correct answer: Routing, certificates and CDN behavior depend on the host name

    An IP-based test may hit a default vhost or skip the CDN, testing the wrong path.

  45. 45. What does Connection: Upgrade stripping by an HTTP/2 hop cause for WebSockets?

    Correct answer: Upgrade can't happen; it needs RFC 8441 or HTTP/1.1

    HTTP/2 has no Upgrade mechanism; WebSockets over h2 use extended CONNECT. Proxies often keep HTTP/1.1 to backends for that.

  46. 46. What is the danger of trusting the client IP from X-Forwarded-For everywhere?

    Correct answer: Clients can spoof it to bypass IP allowlists and rate limits

    Take the address added by your own outermost proxy and ignore values the client sent.

  47. 47. What should a test for 'the API is unreachable' check in a single-page app?

    Correct answer: Clear error state, no lost input, retry, and no infinite spinner

    Users need to know what failed and keep their data. Silent failures and endless loaders are typical bugs.

  48. 48. Why may a CDN return a different TLS certificate than expected for a custom domain?

    Correct answer: SNI didn't match a configured host, so a default cert was used

    Misconfigured or missing host mapping on the edge gives the default certificate and a name mismatch.

  49. 49. How do you check that a service handles slow clients (slowloris-style) safely?

    Correct answer: Send headers or body very slowly and watch the limits

    Slow clients hold connections open. Servers need header and body timeouts and per-IP connection limits.

  50. 50. What is the risk of enabling TLS session tickets without rotating their keys?

    Correct answer: A stolen ticket key can decrypt past recorded sessions

    Rotate ticket keys often and keep them out of long-term storage.

  51. 51. Why can geo-routing tests pass from the office and fail for real users?

    Correct answer: The office IP's location differs from users' ISP routes

    GeoIP databases and anycast routes vary by ISP. Test from probes in target regions and ISPs.

  52. 52. A gRPC service works locally but fails through the company proxy. What's a common reason?

    Correct answer: The proxy doesn't support HTTP/2 end to end or strips trailers

    gRPC needs HTTP/2 with trailers. Many proxies downgrade to HTTP/1.1 or drop trailers, breaking calls.

  53. 53. What does it mean to 'test the network as a dependency'?

    Correct answer: Treat latency, loss and failures as test inputs

    The network is unreliable by nature. Fault injection belongs in the test strategy like any other dependency.

  54. 54. Why should HAR files from production be stored and shared carefully?

    Correct answer: They hold tokens and personal data that can hijack sessions

    Redact cookies, Authorization headers and payloads. Many incidents started with a shared HAR.

  55. 55. How do you test that cookies don't leak to subdomains you don't control?

    Correct answer: Check the Domain attribute and use host-only cookies

    A cookie with Domain=.example.com goes to every subdomain, including risky ones. The __Host- prefix forces host-only, Secure, Path=/.

  56. 56. What is the effect of a TCP proxy that hides the client's IP from the backend?

    Correct answer: IP-based logic sees the proxy, unless PROXY protocol is used

    L4 proxies can't add headers. PROXY protocol sends the original address; both sides must support it.

  57. 57. Why must clients handle DNS answers with several A records?

    Correct answer: If one IP is down, the client should try another

    Round-robin DNS gives several IPs. A client that tries only the first one inherits every single-node outage.

  58. 58. What is the point of synthetic monitoring of an endpoint from several regions?

    Correct answer: Catch regional DNS, routing, TLS and CDN issues early

    One probe in one region misses regional failures. Synthetic checks give a baseline to compare with RUM.

  59. 59. How should a team decide timeouts for a call to a third-party API?

    Correct answer: From measured latency percentiles plus a margin

    Defaults are often infinite or 60 s+. A timeout near p99.9 with a fallback keeps a slow partner from blocking you.

  60. 60. Why is it useful to break DNS for a single dependency in staging?

    Correct answer: It shows if one missing service breaks other features

    Startup checks or shared clients can make one failed lookup block everything. Good systems degrade only the affected feature.

  61. 61. What is the risk of Access-Control-Allow-Origin reflecting any Origin with credentials allowed?

    Correct answer: Any site can read authenticated responses of logged-in users

    Reflecting the origin with credentials is like no same-origin policy. Allowlist exact origins.

  62. 62. Why may HTTP/2 make a single slow backend hurt other requests on the same page?

    Correct answer: A proxy may multiplex many streams onto few backend links

    Pooling and flow-control settings decide whether one slow stream blocks others. Test with one deliberately slow endpoint.

  63. 63. What does chaos testing of the network show that load tests don't?

    Correct answer: How the system behaves when links fail or slow mid-traffic

    Load tests assume a healthy network. Chaos tests check failover, timeouts and recovery under faults.

  64. 64. Why should the app's API host and its CDN assets host have separate monitoring?

    Correct answer: They fail in different ways, through other providers

    A CDN outage breaks the UI while the API is fine, and vice versa. Users see 'the site is down' either way.

  65. 65. A partner API allows calls only from a fixed IP list. What does it mean for your cloud setup?

    Correct answer: Outbound traffic must leave through static IPs

    Cloud instances get changing IPs. Egress through a NAT with reserved IPs, and test that every path uses it.

  66. 66. What's the value of a tool like mitmproxy in automated tests?

    Correct answer: Scripted interception to fake, delay or change traffic

    Scripts can inject errors on specific calls in end-to-end tests of mobile or desktop apps.

  67. 67. Why does a VPN sometimes break only large uploads?

    Correct answer: Its overhead lowers MTU, and big packets vanish

    Encapsulation adds headers. Without working PMTUD, full-size packets vanish and transfers stall.

  68. 68. What should testers look for in Server and X-Powered-By headers?

    Correct answer: Leaked software versions that help target known bugs

    Version banners aren't a hole by themselves, but they make reconnaissance easy. Remove or reduce them.

  69. 69. Why is it hard to reproduce network bugs reported by users on public Wi-Fi?

    Correct answer: Portals, filters, DNS hijacking and NAT vary by network

    Collect HAR and network type from the client, and test on emulated hostile networks.

  70. 70. When is it reasonable to accept 'works on my machine' for a network issue?

    Correct answer: Never: reproduce with the client's recorded conditions

    Capture DNS, route, protocol and timings from the failing client. They usually explain the difference.

  71. 71. What is the trade-off of terminating TLS at the edge for performance?

    Correct answer: Faster handshakes near users, but the CDN sees decrypted traffic

    Edge TLS cuts latency but makes the CDN a party that can read data. Contracts and re-encryption to origin matter.

  72. 72. Why do mobile apps need a timeout on the TLS handshake, not just on the response?

    Correct answer: A stalled handshake can hang if only reads are timed

    Connect, TLS and read timeouts are separate. Lossy mobile networks often stall in the handshake.

  73. 73. How do you verify that HTTP downgrade attacks are blocked for a new subdomain?

    Correct answer: Check HSTS with includeSubDomains and http-to-https redirects

    Without HSTS a first http:// visit can be intercepted. Preload lists remove even that first window.

  74. 74. Why can an API work for all users except those on one ISP?

    Correct answer: That ISP's DNS, routing or filtering differs from others

    Resolvers, transparent proxies and peering differ by provider. RUM split by ASN or ISP points to it quickly.

  75. 75. What's the point of testing an app with a proxy that adds 2 s to only one dependency?

    Correct answer: To see if a slow dependency blocks the whole page or just its part

    Slow is worse than down: it holds threads and connections. Good apps time out, show partial content and recover.