Interview Quiz
Questions: 16 · 10 minutes
1. A replicated store has N=3 copies, a successful write requires W=2 acknowledgments, and a read consults R=2 copies. Why can this configuration help a read encounter the latest acknowledged write, assuming completed quorum operations and proper version handling?
Because the read and write quorums must overlap when R + W is greater than N
Because every write is sent to exactly the same single replica
Because asynchronous networks always deliver writes in timestamp order
Because three replicas eliminate the possibility of node failure
2. A payment client retries a request after timing out, even though the first request may have succeeded. Which design most directly prevents a duplicate charge?
Increase the client timeout for every payment request
Place payment requests on a higher-priority network connection
Associate the operation with an idempotency key and reuse its recorded result
Create a new transaction identifier for every retry attempt
3. One database server can no longer hold a growing customer dataset or sustain its write volume. Which technique distributes different subsets of the data across multiple servers?
Replicating the complete dataset to read-only followers
Sharding the data by a suitable partition key
Adding a local in-memory cache to the existing server
Archiving the database transaction log more frequently
4. Users report occasional very slow requests, but average latency still looks healthy. Which metric would most directly expose the affected tail of the latency distribution?
The total number of database tables
The average response payload size
The number of application deployments
A high percentile such as p95 or p99 request latency
5. At the start of a system design interview, which action usually provides the best foundation for the architecture?
Draw the complete service diagram before discussing traffic
Select a database based on the technologies used by the interviewer
Clarify core use cases, expected scale, and important quality requirements
Begin by optimizing the component most likely to consume CPU
6. An online store's recommendation service becomes unavailable, but product details and checkout still work. Which response best demonstrates graceful degradation?
Reject every site request until recommendations recover
Delete recommendation data so the service restarts empty
Route checkout requests through the failed recommendation service
Show the core page without personalized recommendations or with a simple fallback
7. A highly popular cache entry expires, causing thousands of requests to recompute the same value simultaneously. Which technique most directly limits this cache stampede?
Give every request a different cache key
Disable caching whenever request volume rises
Move the cache and database onto the same machine
Coalesce concurrent misses so one request refreshes the value while others wait
8. An order service must update its database and publish an OrderCreated event. A crash between those actions could leave them inconsistent. Which pattern addresses this without requiring one distributed transaction across the database and broker?
Publish the event first and assume the later database write cannot fail
Write the order and an outbox record in one local transaction, then publish from the outbox
Run a periodic full-table export instead of recording events
Let each consumer create the original order record independently
9. A database frequently runs this query: WHERE tenant_id = ? AND created_at > ? ORDER BY created_at. Which composite index is generally the most suitable starting point?
An index on (tenant_id, created_at)
Separate indexes only on the primary key and display name
An index on an unrelated low-cardinality status column
An index on created_at followed by an unrelated display column
10. A request must pass through two independent components in sequence, and each has 99.9% availability. Approximately what is the combined availability, assuming both must work?
99.99%
99.9%
99.8001%
99.9999%
11. When cache nodes are added or removed, which property makes consistent hashing useful compared with a simple modulo assignment?
It ensures every node stores a complete copy of every value
It limits the proportion of keys that must be remapped
It sorts all cached values by their creation time
It guarantees identical load even when a few keys are extremely popular
12. A user updates a profile and immediately reads it back, but the read replica sometimes returns the old value because replication is asynchronous. Which response best provides read-your-writes behavior?
Temporarily route that user's post-update reads to the primary or a replica known to be current
Randomly choose a different replica for each immediate read
Cache the old profile for a longer period
Remove the version information from profile records
13. A product price is cached, but users must see a new price immediately after an administrator successfully updates it. Which approach most directly supports that requirement?
Increase the cache capacity so fewer products are evicted
Add more read replicas for the product database
Compress cached product records before storing them
Invalidate or update the cached product entry as part of the successful write flow
14. An image-processing service receives brief upload spikes that exceed the number of images its workers can process immediately. What is the main benefit of placing a durable queue between uploads and workers?
It guarantees that every image finishes processing at the same time
It buffers bursts and lets workers consume jobs at a sustainable rate
It removes the need to make processing operations retry-safe
It makes permanent storage of the uploaded images unnecessary
15. An API should allow occasional short bursts while enforcing an average request rate over time. Which rate-limiting algorithm naturally supports this behavior?
A token bucket with a defined refill rate and bucket capacity
A strict fixed delay before every accepted request
A permanent block after the first limit violation
A round-robin load balancer without request counters
16. A news site serves the same images and videos to users around the world. Which change most directly reduces delivery latency and origin traffic?
Store all media in the primary relational database
Send media requests through a single regional application server
Serve cacheable media through a geographically distributed CDN
Replace asynchronous replication with synchronous replication