Rapid-Fire Question Bank
Every calibrated question from the 21 topic chapters, for recall, interviewer-led drills, or random practice. Give yourself 90 seconds for foundation questions, 3 minutes for intermediate questions, 6–10 minutes for senior questions, and 10–15 minutes for staff/stretch prompts. A strong response should usually include a precise definition or invariant, the normal path, one trade-off, one failure behavior, one operational signal, and, for senior questions, an evolution or migration concern.
1. Computer Architecture for System Designers
Why is memory access often more important than arithmetic complexity in backend performance?
Show strong-answer signals
Mention the memory hierarchy, cache lines, locality, random access, stalls, and why two O(n) algorithms can differ greatly in wall-clock time.
What is the difference between concurrency and parallelism?
Show strong-answer signals
Concurrency is multiple in-flight tasks; parallelism is simultaneous execution. Explain I/O waiting, core count, event loops, and why excessive concurrency creates queueing and context switches.
What does it mean for a server to be CPU-bound, memory-bound, IOPS-bound, or bandwidth-bound?
Show strong-answer signals
Define the saturated resource and show that mitigation differs: optimize compute, locality/capacity, operation pattern, or bytes transferred.
A service has low average CPU but high p99 latency. What would you investigate?
Show strong-answer signals
Look for hot cores/shards, lock waits, run queues, GC, I/O queues, downstream waits, burstiness, throttling, and retries. Avoid equating node-average CPU with spare capacity.
When would an event-driven server be worse than a thread-per-request model?
Show strong-answer signals
Blocking code on the event loop, CPU-heavy handlers, difficult library integration, fairness problems, and operational complexity. Propose bounded worker pools or multiple loops.
How can batching improve and hurt a system?
Show strong-answer signals
Amortizes syscalls, network headers, compression, and storage operations; adds wait time, memory, head-of-line blocking, and fairness issues. Bound by size and time.
Estimate the compute fleet for 100k RPS when each request uses 0.8 ms CPU, with 60% target utilization and tolerance for losing one of four equal zones.
Show strong-answer signals
Compute 80 core-s/s; 134 cores at 60%; divide by 0.75 for zone loss ≈ 178 cores, then discuss imbalance, background work, burst/growth margin, and benchmark validity.
Your database becomes slower after moving to a machine with more sockets and memory. Explain plausible causes and a diagnostic plan.
Show strong-answer signals
NUMA remote memory, thread migration, cross-socket locks, cache-coherence traffic, IRQ placement, different power settings, and larger working set. Compare per-node counters and pin an experiment.
Design overload protection for a CPU-heavy API.
Show strong-answer signals
Use deadlines, bounded concurrency, cost-aware admission, per-tenant quotas, queue limits, load shedding, retry budgets, autoscaling, and degraded responses. Explain where rejection occurs and how clients back off.
How would you prove that zero-copy networking is worth adopting?
Show strong-answer signals
Baseline profiles; quantify copy CPU and memory bandwidth; prototype under realistic payload/concurrency; include tail latency, pinned memory, buffer ownership, safety, portability, and operational complexity.
A multi-tenant service has excellent average efficiency but one tenant can double everyone’s p99. Propose resource isolation across the stack.
Show strong-answer signals
Tenant-aware admission and queues, CPU/memory/network quotas, shard isolation, workload classes, fair scheduling, cache partitioning, per-tenant observability, and a policy for unused capacity borrowing.
Explain how recovery traffic can turn a single-node failure into a cascading fleet incident.
Show strong-answer signals
Failover raises foreground load; cold caches and replica rebuild add disk/network/CPU; latency triggers retries; queues grow. Use repair throttles, spare capacity, retry budgets, gradual warmup, priority separation, and chaos tests.
2. Application Architecture
What is the difference between a monolith and a modular monolith?
Show strong-answer signals
A monolith is one deployable unit; a modular monolith additionally enforces internal boundaries, ownership, and dependency direction. It can still scale horizontally.
Why are stateless application servers easier to scale?
Show strong-answer signals
Any instance can handle a request; replacement and load balancing are simple. Clarify that durable/session state must live in a replicated store or recoverable layer.
When is asynchronous communication useful?
Show strong-answer signals
Burst absorption, decoupled timing, fan-out, retry isolation, and long work. Also mention duplicates, lag, ordering, and user-visible status.
What makes a microservice boundary good or bad?
Show strong-answer signals
Good boundaries align capability, data ownership, invariants, team ownership, scaling, and failure isolation. Bad boundaries are entity CRUD services, shared tables, chatty calls, and coordinated releases.
How do you prevent retries from causing a cascade?
Show strong-answer signals
End-to-end deadlines, retry only transient/idempotent operations, exponential backoff with jitter, retry budgets, circuit breakers, and load shedding.
Explain saga orchestration versus choreography.
Show strong-answer signals
Orchestrator stores workflow state and commands steps; choreography reacts to events. Compare auditability, coupling, discoverability, centralization, and compensation.
A company wants to split a checkout monolith into services. How would you choose the first extraction?
Show strong-answer signals
Map domain/invariants and change pain; choose a capability with clear ownership, low cross-transaction coupling, and measurable scaling or release benefit. Describe strangler routing, data ownership, compatibility, observability, and rollback.
Design a request path that depends on inventory, pricing, recommendations, and fraud. Which calls are synchronous?
Show strong-answer signals
Classify correctness-critical versus optional, define latency budget/deadlines, cache or precompute where possible, queue noncritical work, and give coherent degraded behavior.
How would you design a control plane so serving continues during its outage?
Show strong-answer signals
Versioned desired state, local cache/last-known-good, reconciliation, leases/expiry, idempotent rollout, scoped blast radius, emergency controls, and audit.
A queue-backed workflow occasionally executes a side effect twice. What architecture changes do you make?
Show strong-answer signals
Idempotency key and dedupe store, transactional outbox/inbox, atomic state transition with acknowledgment, effect-specific reconciliation, and clear exactly-once scope.
Propose a multi-tenant architecture that supports shared, isolated, and dedicated tiers.
Show strong-answer signals
Common identity/control plane; placement metadata; tenant-aware routing; shared shards with quotas; isolated clusters for higher tiers; encryption and observability; online migration and billing.
How do you decide whether to merge two services rather than further decouple them?
Show strong-answer signals
Use change/deploy coupling, cross-service invariants, synchronous chatter, incident ownership, scaling profiles, and team structure. Explain migration and contract simplification, not only organization preference.
3. Design Requirements
What is the difference between a functional and a non-functional requirement?
Show strong-answer signals
Functional describes behavior/capabilities; non-functional or quality attributes describe latency, availability, security, scale, and operational constraints. Give operation-specific examples.
Define SLI, SLO, and SLA.
Show strong-answer signals
Measured indicator, internal target, and contractual commitment. Include population, window, and measurement point.
What are RPO and RTO?
Show strong-answer signals
Acceptable data-loss window and restoration time after a defined disaster. Explain that replication, backups, and failover address different failures.
How do you estimate traffic from daily active users?
Show strong-answer signals
Operations/user/day divided by seconds/day, then apply peak factor and account for skew, retries, background work, and growth.
Why is p99 latency more useful than average latency?
Show strong-answer signals
It represents tail experience and exposes queueing/stragglers; name the request population and avoid treating one percentile as the entire distribution.
What consistency questions would you ask for a social feed?
Show strong-answer signals
Read-your-writes for posts, ordering per author/conversation, deletion propagation, counter accuracy, stale ranking tolerance, and whether duplicates are acceptable.
The prompt says ‘design a highly available file service.’ What are your first five clarifications?
Show strong-answer signals
Critical operations and success boundary; object size/workload; durability/RPO; availability/RTO and regional scope; consistency/overwrite semantics; then security/retention and scale.
How would requirements differ between a payment ledger and a view counter?
Show strong-answer signals
Ledger needs strong invariants, audit, idempotency, durable ordered writes, precise recovery; counter may accept approximation, batching, sharding, and eventual convergence. Still define abuse and reset semantics.
A PM asks for 99.999% availability and zero data loss. How do you respond?
Show strong-answer signals
Clarify operation/failure/window, quantify cost/downtime, identify correlated and regional failures, distinguish durability from availability, propose tiers, and require tested recovery plus business justification.
How do you turn a vague ‘real-time analytics’ request into design inputs?
Show strong-answer signals
Freshness target, query latency, dimensions/cardinality, ingest rate/size, exactness, retention, late events, replay, audience concurrency, and failure/degradation behavior.
Create a requirement strategy for migrating a regulated product from one region to active-active.
Show strong-answer signals
Data residency, conflict/invariant analysis, per-operation consistency, RPO/RTO, audit, key management, dependency mapping, staged traffic, reconciliation, rollback, and evidence for regulators.
Your launch forecast could be wrong by 100×. How do you design requirements and rollout?
Show strong-answer signals
Range scenarios, hard quotas and admission, queueable/degradable features, load tests, regional/tenant rollout, autoscaling limits, cost guardrails, kill switches, and live assumption validation.
4. Networking Basics
What happens when a host sends an IP packet to a different subnet?
Show strong-answer signals
It uses the route table/default gateway, resolves the next-hop link address with ARP/NDP, encapsulates the IP packet in a local frame, and routers forward by prefix.
What is the difference between bandwidth and latency?
Show strong-answer signals
Bandwidth is transfer rate; latency is delay. Explain propagation, serialization, processing, queueing, and why high bandwidth does not imply low RTT.
What is NAT and why can it be a bottleneck?
Show strong-answer signals
It rewrites addresses/ports and tracks flows; limits include port mappings, state table, throughput, and a centralized failure domain.
Why might small HTTP requests work while large ones time out?
Show strong-answer signals
MTU/path-MTU blackhole, fragmentation/tunnel overhead, proxy body limit, buffering, or bandwidth timeout. Propose payload-size tests and packet/ICMP inspection.
What is the bandwidth-delay product used for?
Show strong-answer signals
Amount of data in flight needed to fill the path; relates to windows, parallel streams, bulk transfer, and high-RTT links.
Where can TLS terminate in a web architecture?
Show strong-answer signals
CDN, edge LB/reverse proxy, sidecar, or app. Discuss re-encryption, identity, header trust, cert rotation, and observability.
Only clients from one mobile carrier experience 20% timeouts. How do you investigate?
Show strong-answer signals
Segment by IPv4/IPv6, DNS answer, edge PoP, path, MTU, TLS, payload, and time. Use diverse probes, carrier path data, CDN logs, packet captures, and controlled routing changes.
A service making short HTTPS calls through one NAT gateway intermittently cannot connect. Explain and fix it.
Show strong-answer signals
Ephemeral port/NAT state exhaustion, TIME_WAIT, poor pooling, destination concentration. Measure mappings, reuse connections, spread egress IPs/gateways, tune pools and timeouts safely.
Design network paths for a three-region API with private databases and public clients.
Show strong-answer signals
Global DNS/anycast/edge, DDoS/WAF, regional L7 LB, private app subnets, controlled egress, database routes, TLS boundaries, health/failover, and asymmetric/partition behavior.
How do you allocate a 500 ms end-to-end deadline across five hops?
Show strong-answer signals
Reserve client/network variance, assign per-hop budgets based on service objectives, propagate deadline, fail fast on insufficient remaining time, bound retries, and collect remaining-budget traces.
Design a migration from overlapping RFC1918 networks after an acquisition without a flag day.
Show strong-answer signals
Inventory flows, introduce proxies/NAT or translation zones, new non-overlapping ranges, DNS/service discovery indirection, dual connectivity, observability, staged workload moves, and eventual removal.
A global incident affects only long-lived connections after a load-balancer configuration change. Explain mechanisms and rollout safeguards.
Show strong-answer signals
Existing flow pinning, stateful NAT/LB tables, idle/drain timeouts, backend membership, proxy protocol changes, reconnect storm. Canary by connections, connection-age metrics, graceful drain, rollback.
5. TCP and UDP
What guarantees does TCP provide?
Show strong-answer signals
Reliable, ordered byte stream with duplicate suppression, flow and congestion control between endpoints; no message boundaries or application commit/exactly-once guarantee.
What guarantees does UDP provide?
Show strong-answer signals
Best-effort datagrams with ports and checksum; messages may be lost, duplicated, reordered, or fragmented, and no built-in congestion control/handshake.
What is the difference between flow control and congestion control?
Show strong-answer signals
Flow control protects the receiver’s buffers; congestion control adapts to path/network capacity.
Why must a TCP application implement framing?
Show strong-answer signals
TCP is a stream; sends can be split/coalesced. Use length prefix, delimiter with escaping, fixed frames, or self-describing encoding and handle partial I/O.
Why can packet loss hurt TCP throughput more on a high-RTT path?
Show strong-answer signals
Recovery feedback/timers take longer and congestion window reduction limits in-flight data; relate to BDP and retransmission.
When would you choose UDP for an application protocol?
Show strong-answer signals
Freshness over completeness, low-latency media/game state, discovery, or as substrate for QUIC/custom reliability—while adding congestion, security, sequencing as required.
A chat gateway’s memory grows when some mobile clients have poor connectivity. What is happening?
Show strong-answer signals
Slow receivers cause send queues; TCP backpressure may not reach app because buffers are unbounded. Bound per-connection queues, coalesce presence/typing, persist messages elsewhere, and disconnect/replay.
How would you design connection pooling for a service calling a database proxy?
Show strong-answer signals
Account for max server connections, per-connection multiplexing, query concurrency/service time, queue bound, timeouts, lifetime, health validation, failover, and tenant fairness.
Compare HTTP/2 over TCP and HTTP/3 over QUIC during packet loss.
Show strong-answer signals
HTTP/2 streams multiplex but TCP loss can block delivery across streams; QUIC has stream-level reliability so one stream’s loss need not block others. Include handshake, CPU, fallback, and application/server bottlenecks.
Design reconnect behavior for ten million clients after a regional outage.
Show strong-answer signals
Exponential backoff with full jitter, server retry hints, admission tokens, regional routing, session resumption, progressive capacity restoration, per-client caps, and observability of attempt cohorts.
Design a low-latency market-data transport where newer updates supersede older ones.
Show strong-answer signals
UDP/multicast or QUIC datagrams where supported, sequence numbers, snapshots plus deltas, gap detection/recovery channel, congestion/rate policy, authentication, clocks, and regional loss behavior.
A global service sees rare duplicate payments despite TCP. Explain all duplicate paths and defenses.
Show strong-answer signals
Client timeout before response, proxy retry, server crash after commit, connection reset, consumer redelivery. Use idempotency key, atomic dedupe/commit, durable response lookup, retry policy, and reconciliation.
6. DNS
What is the difference between a recursive resolver and an authoritative server?
Show strong-answer signals
Recursive resolver obtains/caches answers for clients; authoritative server serves data for zones it controls.
What does a DNS TTL mean?
Show strong-answer signals
How long a resolver may cache the record, not a guaranteed propagation time or lease on existing connections.
What is a CNAME?
Show strong-answer signals
An alias from one domain name to another; discuss extra lookup, no other data at same owner, and apex/provider-alias caveat.
Why can DNS changes take longer than the new TTL?
Show strong-answer signals
Old answers were cached with the previous TTL; clients/runtimes may cache; negative caching and existing connections persist.
How does DNS-based load balancing differ from an L7 load balancer?
Show strong-answer signals
DNS gives cached endpoint choices before connection and has limited health/control; L7 sees requests, active health, headers, retries, and can balance per request/connection.
What problem does DNSSEC solve, and what does it not solve?
Show strong-answer signals
Authenticity/integrity of DNS data and authenticated denial; not confidentiality, endpoint availability, or correctness of signed configuration.
Plan a zero-downtime migration from one CDN to another.
Show strong-answer signals
Inventory records/certificates, lower TTL early, dual-serve and validate content/cache behavior, weighted traffic, monitor by resolver/ASN, keep old CDN during TTL/connection drain, rollback, then raise TTL.
A hostname returns SERVFAIL only from some public resolvers after a DNSSEC key rotation. Diagnose.
Show strong-answer signals
Check DS at parent vs DNSKEY, signatures/expiry/clock, algorithm support, propagation to all authoritative servers/providers, delegation, and validation traces.
Design DNS for a global API with regional data residency.
Show strong-answer signals
Use tenant/user placement metadata and region-scoped endpoints; avoid routing writes purely by resolver geography; authenticate tenant, enforce residency at app/data layer, health/capacity-aware DNS, and failover policy that preserves compliance.
How do you prevent DNS failover from overloading the surviving region?
Show strong-answer signals
Reserve degraded capacity, weighted gradual shift, capacity-aware health, admission control, shed noncritical work, warm caches, retry budgets, and hold-down/manual guardrails.
Design authoritative DNS across two providers without configuration drift.
Show strong-answer signals
Declarative source of truth, portable record model, CI validation/lint, signed change pipeline, compare AXFR/API/queries, canary records, independent monitoring, DNSSEC key/DS strategy, break-glass.
A mobile app pins DNS results for hours to save battery. Design an emergency endpoint migration.
Show strong-answer signals
Multiple bootstrap endpoints, application-level redirect/config with signatures, connection failure triggers refresh, bounded cache max age, staggered rollout, backward-compatible certificates/protocol, and app-version realities.
7. HTTP
What is the difference between safe and idempotent HTTP methods?
Show strong-answer signals
Safe means intended not to change resource state; idempotent means repeated identical requests have the same intended effect. Give GET/PUT/DELETE/POST examples.
What do 304 and 412 mean in conditional requests?
Show strong-answer signals
304 Not Modified satisfies a cache validator without body; 412 Precondition Failed means an update/read precondition such as If-Match was false.
What is the difference between 401 and 403?
Show strong-answer signals
401 indicates missing/invalid authentication challenge context; 403 means request understood but not authorized, subject to information-disclosure policy.
How would you make a POST payment request safely retryable?
Show strong-answer signals
Client-generated idempotency key scoped to operation/account, atomic dedupe plus payment state, persisted original response, request fingerprint, expiry, and conflict behavior.
Explain HTTP cache validation with ETag.
Show strong-answer signals
Cache stores response+ETag, sends If-None-Match when stale, origin returns 304 or new representation. Mention strong/weak validators and Vary.
Compare HTTP/1.1 and HTTP/2 for many small concurrent requests.
Show strong-answer signals
HTTP/2 multiplexing and header compression reduce connection count/HTTP-level blocking, but shares TCP loss/flow control and has stream/concurrency limits.
Design deadlines and retries for an API gateway calling three services.
Show strong-answer signals
End-to-end deadline propagation, per-hop budgets, only transient/idempotent retries, jitter and budget, no nested amplification, cancellation, 429/503 guidance, and tracing of attempts.
A CDN cached authenticated JSON and leaked it. What controls and tests prevent recurrence?
Show strong-answer signals
Explicit private/no-store or correct shared cache key; strip untrusted headers; Vary carefully; token/cookie behavior; cache-status; synthetic users; config review; purge incident plan.
How do you upload a 50 GiB file over HTTP reliably?
Show strong-answer signals
Create upload session, chunk/range or multipart parts, checksums, parallel bounded uploads, idempotent part IDs, resume/list parts, final atomic commit/version, expiry, auth, and size quotas.
When would a 202 response be preferable to holding the connection open?
Show strong-answer signals
Long/variable work, external dependencies, burst buffering. Need durable acceptance, status resource/webhook, idempotency, cancellation, retry/expiry, and user SLO.
Design a multi-hop HTTP retry policy that remains safe under partial regional failure.
Show strong-answer signals
Single retry owner or coordinated attempt metadata, end-to-end deadline, idempotency, per-region failover, retry budgets, circuit/outlier signals, overload-aware no-retry, and accounting for late commits.
Migrate a public API from HTTP/1.1 to HTTP/3 without harming long-tail clients.
Show strong-answer signals
Alt-Svc/negotiation, telemetry by network/device, UDP reachability, fallback, canary cohorts, CPU capacity, connection migration, security/proxy compatibility, and rollback.
8. WebSockets
What does WebSocket add compared with ordinary HTTP request/response?
Show strong-answer signals
A long-lived full-duplex framed channel after handshake. It does not add durable delivery, replay, authorization model, or scalable fan-out automatically.
What are ping and pong frames used for?
Show strong-answer signals
Protocol-level liveness/keepalive and latency measurement; distinguish from application semantic heartbeats and intermediary idle timeouts.
How is message ordering handled on one WebSocket connection?
Show strong-answer signals
Frames/messages are delivered in TCP order, but fragmentation, reconnect, multiple producers/connections, and regions require application sequence semantics.
How do you authenticate a browser WebSocket safely?
Show strong-answer signals
Cookie with CSRF/origin controls or short-lived one-time ticket; TLS; validate Origin; avoid long-lived query tokens/log leakage; authorize subscriptions/messages.
What do you do with a slow WebSocket client?
Show strong-answer signals
Bound queue; coalesce/drop ephemeral data; persist durable messages separately; pause subscription if possible; disconnect with resume cursor; metrics and quotas.
WebSocket or SSE for stock-price updates?
Show strong-answer signals
If one-way updates and browser simplicity dominate, SSE; if bidirectional commands/binary/very low overhead needed, WebSocket. Discuss auth, reconnect, proxy, event IDs, and scale.
Design chat delivery across 100 gateway nodes.
Show strong-answer signals
Any gateway accepts connection, presence lease maps users to gateways, durable message log/store with conversation sequence, pub/sub to interested gateways, ack/read receipts, dedupe, replay, slow-consumer policy.
How do you deploy a new gateway version without a reconnect storm?
Show strong-answer signals
Mark drain, stop new connections, bounded natural drain, server reconnect hint with jitter, canary percentage by connections, session/token compatibility, capacity headroom, rollback.
A large room causes broker and gateway overload. Redesign fan-out.
Show strong-answer signals
Aggregate per gateway, partition/hierarchical fan-out, cap/segment rooms, snapshot+delta, edge distribution, coalesce, priority, and measure deliveries rather than messages.
How does a reconnecting client know whether a sent command succeeded?
Show strong-answer signals
Client operation ID/idempotency, server durable status, ack only after defined commit, query/replay by ID, distinguish transport ack from business result.
Design multi-region collaborative editing over long-lived connections.
Show strong-answer signals
Nearest gateways, document ownership/replicated operation log, sequence/version or CRDT/OT semantics, reconnect cursor/snapshot, auth changes, regional partition behavior, and gateway-independent durable state.
Create a capacity and isolation model for 20M connections across free and enterprise tenants.
Show strong-answer signals
Per-connection memory/heartbeat, per-tenant connection and fan-out quotas, dedicated pools/regions for enterprise, fair queues, cost attribution, admission under failover, and migration between tiers.
9. API Paradigms
REST versus RPC: what is the conceptual difference?
Show strong-answer signals
REST exposes resources through a uniform interface; RPC exposes operations/method calls. Avoid claiming one uses HTTP and the other does not.
What problem does GraphQL solve?
Show strong-answer signals
Client-selected typed response shapes and graph traversal for diverse clients; also mention resolver cost, caching, and governance.
What delivery semantics should a webhook consumer assume?
Show strong-answer signals
At least once in practice: duplicates, delays, reordering, expiry. Verify signature and make processing idempotent.
When is gRPC a good choice?
Show strong-answer signals
Internal typed polyglot services, code generation, low overhead, streaming, deadline/cancellation support; discuss browser/proxy/public ecosystem constraints.
How do you evolve an event schema safely?
Show strong-answer signals
Add optional fields/defaults, preserve meaning, tolerate unknowns, schema checks, version where incompatible, replay old history, usage/deprecation telemetry.
What is the GraphQL N+1 problem?
Show strong-answer signals
Nested resolvers issue per-item backend calls. Use batching/data loaders, joins/read models, caching, and cost metrics.
Choose API paradigms for a ride-sharing platform.
Show strong-answer signals
Public mobile BFF/GraphQL or HTTP; internal gRPC for low-latency services; events for trip state/analytics/notifications; WebSocket/SSE for live location. Justify boundaries and consistency.
Design a reliable webhook product.
Show strong-answer signals
Subscription verification, signed events, stable IDs, ordering scope, at-least-once retries with jitter, endpoint caps, logs, replay/list API, secret rotation, SSRF defense, disable/reactivate policy.
How would you protect a GraphQL gateway from an expensive query?
Show strong-answer signals
Authentication/tenant quotas, depth/breadth and weighted cost, persisted/allowlisted queries for high scale, resolver timeouts, batching, response byte cap, concurrency, observability.
When should an event carry full state rather than only an ID?
Show strong-answer signals
Autonomous consumer/local view and reduced callback pressure versus payload/privacy/schema duplication. Consider snapshot/version, authority, deletion, and reconciliation.
Define an API governance model for REST, gRPC, GraphQL, and events across 200 teams.
Show strong-answer signals
Catalog/ownership, standard identity/errors/deadlines/telemetry, schema review/compatibility CI, lifecycle/deprecation, client generation, cost quotas, exception process, production scorecards.
Migrate a synchronous dependency graph to event-driven integration without losing correctness.
Show strong-answer signals
Identify facts/invariants, outbox, consumer idempotency, local read models, dual-run/shadow, lag/freshness SLOs, reconciliation, cutover per use case, and keep commands synchronous where immediate answer is required.
10. API Design
What makes an API idempotent?
Show strong-answer signals
Repeating the same logical operation has the same intended effect. Explain operation identity, storage of result, and difference from merely using PUT.
Why use cursor pagination?
Show strong-answer signals
Stable/efficient continuation on large mutable datasets; opaque cursor from sort key+tiebreaker. Mention limits and consistency semantics.
How should an API represent validation errors?
Show strong-answer signals
Appropriate 4xx status, stable machine code, per-field issues/path, human message, correlation, no sensitive internals.
How do ETags prevent lost updates?
Show strong-answer signals
Client reads version/ETag, sends If-Match, server atomically applies only if current version matches, otherwise 412/conflict and client refreshes/merges.
How would you design a long-running export API?
Show strong-answer signals
Create operation, 202, durable state/progress, polling with backoff and optional webhook, idempotency, cancellation, expiry, signed result URL, authorization.
What should a bulk API return on partial failure?
Show strong-answer signals
Per-item stable ID/index and status/error, overall status semantics, retry only failed items with idempotency, limits and ordering.
Design an API to transfer money between accounts.
Show strong-answer signals
Authenticated principal, idempotency key, source/destination/amount/currency, ledger transaction/invariants, operation state/receipt, concurrency, limits, timeout recovery, audit, no delete/update of ledger facts.
How do you paginate a feed while new items arrive?
Show strong-answer signals
Choose snapshot token or live keyset; stable (rank/time,id) cursor; duplicates/misses policy; client dedupe; cursor expiry; ranking changes and cache implications.
An API supports user-provided webhook URLs. What security controls are required?
Show strong-answer signals
SSRF defenses, URL scheme/port allow rules, DNS rebinding-aware resolution, block private/link-local, redirect policy, endpoint verification, signed deliveries, secret rotation, egress isolation.
How do you introduce a required field without breaking clients?
Show strong-answer signals
Server default/inference first, add optional, update SDK/docs, measure adoption, warn/deprecate old behavior, only enforce in new operation/version when safe. Consider old stored resources and retries.
Design an enterprise API platform with per-tenant custom quotas and regional residency.
Show strong-answer signals
Identity/org hierarchy, tenant-scoped routing and data plane, cost-based quotas/concurrency, residency enforcement, dedicated tiers, audit, SDK/gateway policy, online tenant migration, support tooling.
Create a compatibility policy for an API used by devices that remain offline for a year.
Show strong-answer signals
Long support horizon, additive tolerant schema, capability negotiation, min/max versions, server-side defaults, signed config, staged kill switches, replay/idempotency retention, security update path.
11. Caching
What is cache-aside?
Show strong-answer signals
Application reads cache, loads source on miss, writes cache; on writes it updates/invalidate separately. Mention stale windows and stampede.
What is the difference between expiration and eviction?
Show strong-answer signals
Expiration is freshness policy/TTL; eviction removes entries for capacity/policy even if not expired.
Why can a 99% hit ratio still be dangerous?
Show strong-answer signals
At huge traffic 1% is large, expensive misses may dominate, distribution/hot shards matter, and a drop to 95% multiplies source load.
How do you prevent a cache stampede?
Show strong-answer signals
Single-flight/leases, TTL jitter, early refresh, stale-while-revalidate, negative caching, source concurrency limit, and bounded failure behavior.
How do you invalidate a cache after a database write?
Show strong-answer signals
Delete/update plus outbox/CDC event, version/generation, TTL fallback; discuss crash between DB commit and invalidation and race with fills.
When is negative caching useful?
Show strong-answer signals
Repeated absent/invalid lookups; short TTL, distinguish authoritative not-found from transient error, avoid hiding newly created data too long.
Design caching for a product catalog with price updates and viral products.
Show strong-answer signals
CDN/app/distributed layers, keys by locale/price context, version/TTL, invalidation via CDC, hot-key replication, stale policy, source protection, price correctness boundary.
A cache cluster is lost. How do you avoid taking down the database?
Show strong-answer signals
Failover/stale snapshots, admission and miss budget, prioritize requests, rate-limited single-flight fills, prewarm top keys, autoscale source, degraded responses, monitor warm curve.
Explain and fix a race where an old cache fill overwrites a newer value.
Show strong-answer signals
Timeline: miss reads old replica, write commits/invalidate, slow fill sets old. Include version in source/value and compare/CAS; route authoritative read or generation key.
How do you cache authorization decisions?
Show strong-answer signals
Key principal/resource/action/policy epoch, short TTL or event invalidation, revocation SLO, deny/allow fail policy, audit, avoid cross-tenant leakage, bypass for high-risk actions.
Design a multi-region cache hierarchy for a global API with regional writes.
Show strong-answer signals
Client/edge, regional L1/L2, source ownership, versioned data/invalidation, local stale reads, read-your-write routing, failover, cold-start protection, and cost/egress.
Create a fairness policy for a shared cache where one tenant runs scans and another has latency-critical hot keys.
Show strong-answer signals
Per-tenant quotas/admission, workload classes, protected pools or frequency policy, max item size, cost-weighted eviction, borrowing rules, telemetry and billing.
12. Content Delivery Networks (CDNs)
What does a CDN do on a cache miss?
Show strong-answer signals
Routes to upper tier/origin, fetches according to policy, may collapse concurrent requests, stores response if cacheable, and returns it.
Why are versioned asset URLs useful?
Show strong-answer signals
Immutable long caching without purge; deploy new content at a new URL, old references remain correct, lifecycle later removes it.
What is byte hit ratio?
Show strong-answer signals
Fraction of delivered bytes served from cache, often more relevant to origin bandwidth than request-count hit ratio.
What is an origin shield?
Show strong-answer signals
Upper-tier cache between edge PoPs and origin, reducing duplicate fills/connections; adds concentration and miss-hop trade-off.
How do signed URLs work with caching?
Show strong-answer signals
Edge validates time-limited signature/claims, then maps authorized request to content cache key; define token sharing, expiry, revocation, and whether token is excluded from key.
How would you purge a hot object safely?
Show strong-answer signals
Prefer versioning; otherwise soft purge/stale revalidation, request collapse, shield, origin capacity/admission, staged rollout, and monitor fill.
Design CDN delivery for a subscription video service.
Show strong-answer signals
Segmented/range media, object storage origin, immutable renditions, signed cookies/URLs, DRM/license separate, multi-tier cache, origin auth, regional rights, logs/egress, purge for takedown.
A CDN returns another user’s API response. Walk through incident response and prevention.
Show strong-answer signals
Bypass/purge, identify key/rule and affected scope, preserve evidence/notify, rotate sensitive tokens if needed, fix private/cache-control/Vary, synthetic multi-user tests, staged config.
How would you implement multi-CDN failover?
Show strong-answer signals
Portable content/origin auth, traffic manager, consistent cert/DNS/cache keys, dual logging/purge, warm baseline, origin capacity for cold failover, health thresholds/hold-down, regular game days.
When should logic run at the edge?
Show strong-answer signals
Auth/routing/redirect/A-B/light transform where latency/offload matters; avoid strong transactional invariants and heavy dependencies. Discuss limits, versioning, security, observability, fallback.
Design global cache invalidation for legal takedowns with a 60-second objective.
Show strong-answer signals
Content ID→all URL/variant tags, authenticated purge to all CDNs/tiers, denylist checked at edge, origin block, verification probes, audit, retries/escalation, offline clients and backup policy.
Reduce origin egress cost by 50% without materially increasing staleness.
Show strong-answer signals
Measure byte misses by object/path/PoP, increase immutable versioning, normalize keys, tiered cache/shield, range optimization, preposition hot content, revalidation, compression, multi-CDN economics; validate freshness SLO.
13. Proxies and Load Balancing
What is the difference between a forward and reverse proxy?
Show strong-answer signals
Forward proxy represents clients toward servers; reverse proxy represents servers toward clients. Discuss egress vs ingress use cases.
L4 versus L7 load balancing?
Show strong-answer signals
L4 balances flows using transport metadata; L7 parses application protocol and can route/retry/auth/cache per request.
Why can round robin be poor even with equal servers?
Show strong-answer signals
Requests differ in cost/duration, long connections pin, slow endpoints retain work, and weights/health may differ.
What is connection draining?
Show strong-answer signals
Remove endpoint from new work, allow in-flight/long-lived sessions to finish or receive close signal, enforce max drain, then terminate.
How does least-connections differ from least-request?
Show strong-answer signals
Connections may be idle or multiplex many requests; active request/work is often a better load signal, though distributed state can be stale.
When is session affinity appropriate?
Show strong-answer signals
Cache/local session optimization or protocol state; make soft, externalize durable state, handle hot clients and failover.
Design load balancing for gRPC services with long streams and unary calls.
Show strong-answer signals
L7 termination/client-side policy, separate pools/classes, multiple HTTP/2 conns, active-stream/cost metrics, max connection age/drain, health, retries only unary/idempotent, slow-stream isolation.
How do you avoid a health-check-induced outage?
Show strong-answer signals
Shallow representative check, dependency classification, thresholds, multi-vantage, max ejection/panic, stagger/jitter, capacity-aware failover, last-known-good.
A zone fails. How should traffic shift?
Show strong-answer signals
Reserve N+1 capacity, local-first with weighted cross-zone, gradual capacity-aware shift, warm caches, protect databases, retry budget, load shed/degrade, monitor per-zone saturation.
Where should TLS terminate in a zero-trust service architecture?
Show strong-answer signals
External edge plus authenticated encrypted hop to workload; mTLS via proxy/app, identity/authorization, cert rotation, SNI, observability, and avoiding trust solely from network location.
Design a global traffic-management system for hundreds of services and regions.
Show strong-answer signals
Hierarchical global/regional/client balancing, capacity and health signals, data-residency constraints, control/data-plane separation, last-known-good, gradual shifts, overload, simulation/game days, audit.
A proxy retry policy reduced errors but doubled cost and worsened p99. Redesign governance.
Show strong-answer signals
Attempt telemetry, single owner, idempotency registry, per-route retry classes, deadline/budget, overload signals, max amplification SLO, canary and lint, charge attempts to tenant/service.
14. Consistent Hashing
Why is modulo hashing bad when node count changes?
Show strong-answer signals
Changing N changes most hash mod N results, causing broad remap; consistent hashing limits movement to neighboring ranges/top scores.
What is a virtual node?
Show strong-answer signals
Multiple logical token positions owned by one physical node, improving balance, weights, and movement granularity.
Does consistent hashing solve hot keys?
Show strong-answer signals
No; it balances many keys probabilistically. One hot key needs replication, caching, splitting, or special handling.
How do you place three replicas on a ring?
Show strong-answer signals
Primary owner plus additional distinct nodes/tokens, but enforce rack/zone diversity and avoid duplicate physical nodes due to vnodes.
What happens when a node joins?
Show strong-answer signals
Assign token ranges, stream snapshot from current replicas, catch up deltas, verify, mark ready/activate, then retire old ownership; throttle and version membership.
Compare ring and rendezvous hashing.
Show strong-answer signals
Both minimize movement; ring maps ranges/tokens, rendezvous scores nodes per key and naturally selects top-K. Compare lookup, metadata, weights, and streaming.
Design partition placement for a distributed cache with heterogeneous nodes.
Show strong-answer signals
Weighted vnodes/rendezvous, replication, bounded load, health/membership, client/proxy routing, hot-key L1, gradual rebalance, simulation and metrics.
How do you prevent stale clients from writing to a removed owner?
Show strong-answer signals
Membership epochs, server-side validation/redirect, fencing tokens/leases, idempotent retry, coordinator or consensus-backed ownership, cap redirect loops.
A zone loss leaves replicas available but repair overloads the cluster. What changes?
Show strong-answer signals
Topology-aware capacity, repair throttle/priorities, staged concurrency, spare disk/network, temporary replicas, foreground admission, restore zone before full rebalance when appropriate.
Choose a shard key for a multi-tenant time-series system.
Show strong-answer signals
Tenant+time bucket+hash suffix trade-offs, large tenants, range queries, retention, write hotspots, scan fan-out, rebalancing, and directory for tenant placement.
Design a placement service that supports online node weights and zone evacuations.
Show strong-answer signals
Consensus/versioned membership, simulation/planner, constrained optimization for weights/domains/movement, staged plans, data readiness, fencing, throttles, pause/rollback, audit.
When would you reject consistent hashing entirely?
Show strong-answer signals
Small/static clusters; range queries needing ordered partitioning; directory-based placement for tenant isolation/moves; consensus leader groups; workloads where explicit mapping and operational control outweigh hash simplicity.
15. SQL and Relational Databases
What does a transaction provide?
Show strong-answer signals
Atomic commit/abort, consistency through declared invariants, isolation of concurrent work according to a level, and durability according to the engine/configuration; distinguish ACID from business exactly-once.
Why does an index speed reads but slow writes?
Show strong-answer signals
It provides a searchable ordered/hashed structure, but every insert/update/delete may maintain pages, logs, cache, and constraints.
What is normalization?
Show strong-answer signals
Structuring relations to reduce duplication and update anomalies; denormalize only with explicit ownership and synchronization semantics.
Design indexes for tenant_id, status, created-time feed queries.
Show strong-answer signals
Start from exact filters/order, likely composite (tenant_id, status, created_at, id) or partial active index, cursor pagination, selectivity, coverage, and write cost; verify plan.
How do you prevent overselling the last item?
Show strong-answer signals
Atomic conditional decrement or locked inventory row, reservation expiry, unique operation ID, transaction boundaries, contention and sharding plan.
Explain read-after-write failure with a read replica.
Show strong-answer signals
Async lag means a subsequent read can hit an older log position; use primary/session stickiness, commit-position wait, or expose eventual freshness.
Design a payment ledger schema and posting transaction.
Show strong-answer signals
Immutable entries, transaction/account IDs, balanced postings, unique idempotency key, currency/precision, states, constraints, reconciliation, read model, audit and reversal rather than deletion.
A table reaches five billion rows. What do you do?
Show strong-answer signals
First inspect access/retention/indexes; then partition/archive, keyset scans, replicas, derived stores, maintenance and backup; shard only when measured single-node limits or isolation demand it.
Plan a zero-downtime primary-key migration.
Show strong-answer signals
Expand schema, stable mapping, dual-compatible code, transactional/CDC backfill, verification, foreign-key/index migration, switch reads/writes, rollback checkpoints, cleanup.
Serializable transactions show rising aborts. Diagnose and redesign.
Show strong-answer signals
Find conflicting predicates/rows, verify retry correctness, shorten transactions, partition hot invariants, use commutative updates/reservations, bound admission, and preserve semantics.
Create a relational data platform for hundreds of teams.
Show strong-answer signals
Golden schemas/ownership, tenancy and isolation tiers, migration tooling, connection budgets, query governance, backups/restore tests, CDC contracts, SLOs, cost allocation, and escape hatches.
When should a service not own its own database?
Show strong-answer signals
Balance autonomy against cross-domain invariants, operational maturity, shared reporting, coupling, compliance, and migration cost; reject both a universal shared schema and dogmatic database-per-service.
16. NoSQL Data Stores
What is NoSQL?
Show strong-answer signals
A family of non-relational or specialized models—not one guarantee—including key-value, document, wide-column, graph, search, and time-series systems.
What makes a good partition key?
Show strong-answer signals
Even heat and bounded size while colocating critical reads/atomic updates; test real skew and growth.
Why denormalize?
Show strong-answer signals
To serve known access patterns without joins/fan-out, accepting write amplification and synchronization/rebuild responsibility.
Embed orders in a customer document or reference them?
Show strong-answer signals
Orders are unbounded and independently queried/updated, so reference or bucket; embed bounded snapshots/profile children that share lifecycle.
Design a device-events key.
Show strong-answer signals
Device/tenant plus time bucket and ordered timestamp, optional hash suffix for hot devices; retention, range fan-out, late data, and partition limits.
How do you implement idempotent updates in a key-value store?
Show strong-answer signals
Operation key/unique token, conditional put/version, stored result/status, TTL based on replay window, and atomic relation to mutation.
Design a globally available shopping cart.
Show strong-answer signals
Per-user placement, local writes, item operation model/merge, conflict semantics, session guarantees, replication/repair, TTL, inventory distinction, observability.
A document-store workload has unpredictable p99 after growth. Diagnose.
Show strong-answer signals
Per-shard skew, document/array size, index selectivity, scatter queries, cache, lock/update contention, replication/compaction, plans and top tenants.
Choose a store for a social graph.
Show strong-answer signals
Enumerate traversals and depth, update rate, supernodes, consistency, partitioning, precomputed recommendations, source of truth, and whether adjacency lists in KV/SQL outperform a graph engine.
Move a query from fan-out to a materialized view.
Show strong-answer signals
Event/CDC source, idempotent consumer, ordering/version checks, backfill cut, dual-read comparison, lag SLO, repair/rebuild, deletion propagation.
Define a company-wide polyglot persistence policy.
Show strong-answer signals
Approved capabilities, workload decision records, ownership, schema/event standards, backup/RTO, data classification, cost, observability, lifecycle, and exception review.
Design automatic hot-tenant isolation.
Show strong-answer signals
Per-tenant telemetry, thresholds/hysteresis, directory placement, online copy+delta, fencing, routing epochs, capacity pool, rollback, billing and noisy-neighbor policy.
17. Replication and Sharding
What is the difference between replication and sharding?
Show strong-answer signals
Replication copies data for availability/durability/read locality; sharding partitions data for capacity/throughput. Real systems combine both.
Why can a read replica return stale data?
Show strong-answer signals
The write log is shipped/applied asynchronously or the read snapshot trails the leader.
What is split brain?
Show strong-answer signals
Multiple nodes believe they are authoritative and accept conflicting work; prevent with quorum/terms/leases and fencing.
How do you provide read-your-writes from replicas?
Show strong-answer signals
Carry commit/log position or session token; route/wait until a replica has applied it, otherwise use leader.
Choose a shard key for orders.
Show strong-answer signals
Tenant/customer/order locality, write distribution, time queries, largest tenant, cross-tenant admin analytics, retention, and online tenant moves.
Describe a safe shard split.
Show strong-answer signals
Snapshot, change capture, catch-up, verify, epoch cutover, fallback/drain, delayed delete, throttling and idempotency.
Design failover for a primary database across zones.
Show strong-answer signals
Replication acknowledgment, failure detection, election/eligibility, fencing, promotion, routing/pool refresh, ambiguous retries, validation, failback, RPO/RTO metrics.
Design a multi-region account service.
Show strong-answer signals
Identify global invariants, choose home-region/global consensus/escrow, read routing/session guarantees, partition behavior, residency, region loss and reconciliation.
Your shard count doubled and p99 worsened. Why?
Show strong-answer signals
More fan-out, smaller cache locality, connection overhead, metadata, background movement, skew, cross-shard coordination; inspect per-query partitions and slowest shard.
How do you move a large tenant with continuous writes?
Show strong-answer signals
Directory epoch, snapshot and ordered delta, dual-read/fallback, target readiness, fenced cutover, reconciliation, throttles, rollback, tenant communication.
Design a fleet-wide resharding control plane.
Show strong-answer signals
Inventory/telemetry, planner with constraints, versioned plans, admission budgets, data movers, checksums, fencing, pause/rollback, audit, SLO guardrails and human controls.
Set replication tiers for a multi-product company.
Show strong-answer signals
Classify RPO/RTO/latency/residency, standard topologies, cost, backup/restore, chaos tests, client contracts, observability and exception governance.
18. CAP Theorem and Distributed Consistency
State CAP without ‘pick two.’
Show strong-answer signals
During a network partition, a distributed system cannot guarantee both linearizable consistency and a non-error response from every non-failing node for every operation.
Is partition tolerance optional?
Show strong-answer signals
A single-node system can avoid distributed partitions, but once correctness depends on communicating nodes, message loss/delay must be handled; the choice is behavior during it.
Is ACID consistency the same as CAP consistency?
Show strong-answer signals
No. ACID C means transactions preserve application/database invariants; CAP C refers to atomic/linearizable visibility.
Why does a majority leader reject writes in the minority?
Show strong-answer signals
It cannot prove it remains the sole ordered authority; accepting could fork history. Rejection sacrifices formal availability to preserve consistency.
Can R + W > N guarantee strong consistency?
Show strong-answer signals
Not alone; discuss replica membership, versioning, concurrent writes, failed/sloppy quorums, read algorithm, and repair.
Give an AP-friendly operation.
Show strong-answer signals
Shopping-cart item additions or telemetry with unique event IDs can accept both sides and union/deduplicate, provided domain merge and later repair are defined.
Design behavior for a global username service during region partition.
Show strong-answer signals
Uniqueness needs authoritative quorum/home ownership or tentative reservation with possible rejection; describe API state, timeout, fencing, and reconciliation.
Should authorization cache serve stale data during control-plane failure?
Show strong-answer signals
Classify grants vs revocations, max staleness, fail-open/closed by action risk, signed expirations/version, emergency kill path, audit.
Design a globally distributed rate limiter.
Show strong-answer signals
Strong global counter versus regional token leases/escrow, bounded overshoot, allocation, expiry, partition behavior, hot keys, observability and abuse.
A multi-leader store healed but values differ. What now?
Show strong-answer signals
Identify concurrent versions, apply domain merge/operation replay, preserve audit, repair replicas/indexes, notify for irreconcilable conflict, throttle recovery.
Define consistency classes for a platform.
Show strong-answer signals
Named operation-level guarantees, permitted staleness/errors, client tokens, topology, SLOs, test harnesses, metrics, and examples for money/auth/content/analytics.
Review a proposal that labels every service CP or AP.
Show strong-answer signals
Replace labels with objects/operations, partition scope, responses, invariants, normal latency trade, recovery, dependencies, and migration assumptions.
19. Object Storage
How is object storage different from a filesystem?
Show strong-answer signals
API-addressed whole objects and metadata, typically flat key namespace and no general in-place random writes/rename semantics; built for massive scale/durability.
Why use multipart upload?
Show strong-answer signals
Parallelism, resumability, and retrying only failed parts; completion atomically publishes the assembled object.
What is a presigned URL?
Show strong-answer signals
A time-limited bearer authorization for a scoped object operation; it must be narrow, protected, and verified by application workflow.
Design direct image upload.
Show strong-answer signals
Pending metadata, scoped URL, size/type policy, direct transfer, checksum/head verify, scan/transform, ready state, orphan cleanup and idempotency.
How do you update an object safely?
Show strong-answer signals
Prefer new immutable version/key plus conditional pointer update; use ETag/version precondition if mutating at key; handle retries and cache invalidation.
How do object notifications affect correctness?
Show strong-answer signals
Treat as at-least-once/out-of-order trigger; dedupe on key+version, persist progress, and reconcile with inventory.
Design a Dropbox-like object layer.
Show strong-answer signals
Chunk/multipart upload, content IDs, metadata tree, versions, dedupe scope/security, sync cursors, range/download CDN, sharing auth, conflicts, lifecycle and recovery.
Design privacy deletion across object derivatives.
Show strong-answer signals
Authoritative deletion request/state, immediate access denial, enumerate versions/replicas/derivatives/caches/indexes, idempotent workers, legal holds, evidence and backup policy.
A viral object melts origin despite a CDN. Diagnose.
Show strong-answer signals
Cache key/headers/auth, range behavior, invalidation, origin shield, signed URL variance, cold miss stampede, egress/connection limits, attack patterns.
Build a data-lake ingestion commit protocol.
Show strong-answer signals
Immutable files, partitioning and file size, staging, checksums, manifest/table metadata atomic commit, idempotent job/event, schema evolution, compaction and vacuum.
Define a company object-storage platform.
Show strong-answer signals
Tenancy, namespaces, direct-transfer API, policy guardrails, malware pipeline, encryption/KMS, lifecycle classes, cost/quotas, events/inventory, deletion, DR and SLOs.
Migrate exabytes between providers/regions.
Show strong-answer signals
Inventory and checksums, dual-read/write or log, parallel copy, bandwidth/cost, immutable versions, validation, routing cutover, delta catch-up, rollback, deletion and compliance.
20. Message Queues, Logs, and Event-Driven Systems
Why use a message queue?
Show strong-answer signals
Decouple timing/rate, buffer bursts, retry work, and isolate producers from consumer availability—while accepting asynchronous state and operational backlog.
What is at-least-once delivery?
Show strong-answer signals
A message may be redelivered until acknowledged, so consumers must tolerate duplicates.
What is a dead-letter queue?
Show strong-answer signals
A quarantine for messages that exceed retry/permanent-failure policy; it requires alerts, diagnostics, ownership, and safe redrive.
How do you publish an event atomically with a database update?
Show strong-answer signals
Transactional outbox/CDC; relay can duplicate; consumer uses stable event ID/version.
How do you preserve order?
Show strong-answer signals
Choose an entity ordering key mapped to one partition, one active partition owner, safe offset commit, and version guards; avoid unnecessary global order.
How do you choose a visibility timeout?
Show strong-answer signals
Above expected high-percentile work or extend by heartbeat; finite for crash retry; account for duplicates and split long jobs.
Design an email notification pipeline.
Show strong-answer signals
Preference/consent snapshot, outbox event, template/version, idempotent send key, priority, rate/provider limits, retries/DLQ, expiry, delivery callbacks, audit/privacy.
Design a payment-event consumer.
Show strong-answer signals
Immutable ledger authority, unique operation ID, ordered account/payment state, atomic inbox+posting, ambiguous processor response, reconciliation and alerting.
A consumer is six hours behind after an outage. Recover safely.
Show strong-answer signals
Calculate net drain, protect dependencies, add bounded parallelism/partitions, prioritize/expire, pause retries, monitor age, rebuild projection if faster, communicate SLO.
Migrate an event schema with hundreds of consumers.
Show strong-answer signals
Compatibility policy/registry, additive rollout, consumer inventory, dual/new type for semantic break, mixed-version tests, backfill IDs, deprecation telemetry.
Design an internal event platform.
Show strong-answer signals
Tenancy, schemas/catalog, auth/privacy, topic/partition quotas, SLOs, lineage, outbox/CDC, replay, DR, cost, self-service, guardrails and incident ownership.
Define exactly-once for a cross-system workflow.
Show strong-answer signals
Scope each boundary, unique operation IDs, atomic local state/inbox/outbox, idempotent external API or reconciliation, state machine, audit and proofs/limits.
21. MapReduce and Large-Scale Batch Processing
What are map and reduce?
Show strong-answer signals
Map transforms input records into keyed intermediates; shuffle groups same keys; reduce combines each key’s values into output.
What is the shuffle?
Show strong-answer signals
Partitioning, transfer, sorting/merging, and grouping of mapper output to reducers; often the dominant network/disk cost.
When is a combiner safe?
Show strong-answer signals
When its partial output can be merged with the same algebra under arbitrary zero/multiple invocations—typically associative and commutative state.
How do you compute average with a combiner?
Show strong-answer signals
Emit/merge (sum, count), then divide after final reduction; do not average partial averages without weights.
How do you join a huge table to a small table?
Show strong-answer signals
Broadcast/map-side join if the small side fits each worker; otherwise reduce-side or co-partitioned join, with skew/multiplicity analysis.
Why does one reducer take much longer?
Show strong-answer signals
Heavy key/range, larger records, bad host, spill/fetch, malformed input; compare bytes/records/progress and handle deterministic skew separately.
Design daily unique-user counts over trillions of events.
Show strong-answer signals
Partition pruning, dedupe identity/window, exact sort/set versus mergeable HLL with error, combiner, skew, late data, output version, validation/backfill.
Build an inverted index with MapReduce.
Show strong-answer signals
Tokenize map term→doc/positions, local combine, partition by term, sort/compress postings, handle stop/heavy terms, immutable segments/manifest, incremental merge.
A 6-hour job must finish in 90 minutes. Approach?
Show strong-answer signals
Profile stage/bytes/skew, prune/project, combine, broadcast/partition joins, file sizing, parallelism, resource bottleneck, incremental computation, and validate cost/SLO.
Design a safe backfill for a derived table.
Show strong-answer signals
Snapshot inputs/code/schema, run-isolated output, idempotent partitions, data-quality comparison, catch-up delta, manifest cutover, rollback, lineage and cleanup.
Design a batch platform on object storage.
Show strong-answer signals
Split/file formats, scheduler, shuffle service, retries/speculation, quotas/fairness, catalog/lineage, schemas, secrets, observability, publication, cost and multi-tenancy.
Choose batch, stream, or incremental view for company metrics.
Show strong-answer signals
Freshness/correction/replay, event time, cost, state size, joins, ownership, one logic path, SLOs, backfills and auditability.
Random practice methods
There are 252 questions. Use a random number from 1–252; answer without opening the signal. For a 30-minute session, draw one foundation, one intermediate, and two senior/staff questions from different topics.
Contrast drill
Pick two adjacent topics—TCP/HTTP, DNS/CDN, SQL/NoSQL, replication/CAP, queue/MapReduce—and answer: what guarantee belongs to each layer, where can the higher layer compensate, and which failure cannot be hidden?
Failure drill
After any answer, add: the primary times out after commit; one zone is isolated; the largest tenant is 100× average; a migration is half complete; or a privacy deletion arrives. Continue without restarting the design.