System Design and Architecture Flashcards
7 cards from real CodeSignal Technical Assessment practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 System Design and Architecture flashcards as text
You are designing a ride-sharing app location service. Drivers update GPS coordinates every 5 seconds. Which data store best supports querying nearby drivers within 2km?
Answer: Redis with geospatial index (GEOSEARCH)
Redis GEOSEARCH uses geohashing to efficiently find members within a radius, handling millions of points with sub-millisecond latency.
Service A calls Service B synchronously. Service B's P99 latency is 800ms. What is the minimum expected P99 for Service A's end-to-end response time?
Answer: Greater than 800ms (A's own processing adds to B's latency)
Synchronous calls are serial — Service A's total latency equals its own processing time plus Service B's full latency, always exceeding 800ms.
Which approach allows independent microservices to maintain data consistency without distributed transactions?
Answer: Saga pattern with compensating transactions
The saga pattern breaks a transaction into local steps, each publishing an event; compensating transactions roll back prior steps if a step fails.
A video platform needs to transcode uploaded videos into 5 quality levels. Which architecture component handles this best?
Answer: Asynchronous message queue feeding a worker pool
An async queue decouples upload from transcoding, allows horizontal scaling of workers, and prevents upload timeouts on long-running jobs.
What happens when a CDN edge cache misses on a user request?
Answer: The CDN fetches the asset from the origin server, adding a full round-trip latency
A CDN edge miss forces the CDN to fetch from origin, adding full round-trip latency from the edge to origin — exactly what the CDN was placed to avoid.
Which consistency pattern does a social media likes counter typically use to handle extreme write volume?
Answer: Eventual consistency with batched aggregation
Likes counters use eventual consistency — increments are buffered and periodically aggregated, accepting slight inaccuracy in exchange for massive write throughput.
In a consistent hashing ring, when a new cache node is added, approximately what fraction of keys must be remapped?
Answer: 1/n of keys (where n = new total node count)
Consistent hashing redistributes approximately 1/n of keys when adding the nth node, minimizing cache invalidation compared to modulo-based sharding.