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
A payment service must guarantee that a transaction is processed exactly once even if retries occur. Which pattern best addresses this?
Answer: Idempotency keys stored server-side
Idempotency keys allow clients to retry safely because the server deduplicates requests by key and returns the original result.
You need to fan out a single event to 10,000 subscribers with low latency. Which messaging topology is most appropriate?
Answer: Pub/sub topic with push delivery
Pub/sub topics push messages to all subscribers simultaneously, making fan-out efficient without sender knowledge of each consumer.
Which consistency model allows reads to see stale data but guarantees eventual convergence across replicas?
Answer: Eventual consistency
Eventual consistency permits temporary staleness but guarantees all replicas will converge to the same value given no new updates.
A microservice architecture experiences cascading failures when a downstream service is slow. Which pattern prevents this?
Answer: Circuit breaker
A circuit breaker trips after repeated failures, stopping calls to the unhealthy service and allowing it time to recover.
You are designing a URL shortener expected to handle 10,000 writes/sec. What is the primary bottleneck to address first?
Answer: Unique ID generation at scale
At high write rates, generating collision-free short codes becomes the bottleneck; solutions include Snowflake IDs or distributed counters.
Which storage engine characteristic makes LSM trees preferable over B-trees for write-heavy workloads?
Answer: LSM trees write sequentially to memory then flush to disk
LSM trees batch writes in an in-memory buffer and flush sequentially, converting random writes into sequential I/O which is much faster.
A CDN serves static assets globally. A user in Tokyo requests an asset cached in Singapore. What metric describes the extra delay from that geographic distance?
Answer: Network latency (propagation delay)
Propagation delay is the time signal takes to travel the physical distance between nodes, which is a fundamental latency floor.