Chapter 1 · Networking
Interview drill
8 questions from this chapter. Answer each one out loud first, then open it to compare.
-
1.1"Walk me through how you'd approach a system you've never seen."
- Structure beats recall — you're graded on the frame, not on trivia.
- Every chapter here gives you one frame; memorise the frames, derive the details.
- If you can draw it, you can defend it under follow-up questions.
-
1.2"The page is slow. Where do you look first?"
- Open the waterfall, not the profiler — confirm it's network-bound before touching code.
- Count round trips and identify the longest dependency chain, not the biggest file.
- Report at p75 on real devices; averages hide the users who churn.
-
1.3"What happens when you type a URL and press Enter?"
- Name the six stages in order and say which are cacheable — that alone passes.
- Call out that the HTML streams: parsing overlaps with download.
- Land on the frontend lever: the critical path is HTML → CSS → render-blocking JS.
-
1.4"You migrated to HTTP/2 and nothing got faster. Why?"
- Check the bundling strategy: 1.1-era concatenation cancels multiplexing's benefit.
- Check the network: on lossy mobile links, TCP head-of-line blocking eats the gain.
- Check the origin: if TTFB is server-bound, the protocol was never the bottleneck.
-
1.5"PUT or PATCH — and why does it matter for retries?"
PUTreplaces the whole resource and is idempotent, so a timeout can be retried safely.PATCHapplies a delta and generally isn't, so retries need an idempotency key.- On flaky mobile networks, retry safety is a design decision, not a detail.
-
1.6"GraphQL removed over-fetching. What did it cost you?"
- HTTP caching:
POST /graphqlis opaque to CDNs, so caching moves into the client (normalized store) or needs persisted queries +GET. - Server performance becomes the client's problem — one careless nested query can hammer the database.
- You now own schema versioning, deprecation, and query governance.
- HTTP caching:
-
1.7"Why don't we just use gRPC from the browser?"
- The Fetch API gives no control over HTTP/2 framing, so raw gRPC is impossible.
- gRPC-Web works but needs a translating proxy and drops client-side streaming.
- The usual shape: browser → BFF (REST/GraphQL) → services (gRPC).
-
1.8"Design the API layer for a mobile-heavy social app."
- Mobile bandwidth + per-screen nesting → GraphQL at the edge, one query per screen.
- Keep images and static content on plain REST/CDN URLs so they stay cacheable.
- Internal fan-out (feed, ranking, notifications) over gRPC behind a BFF.