CS System Architecture & Design 3 — Questions and Answers
Question 1: A video streaming service wants to reduce latency for users worldwide by serving static content from servers geographically close to them. Which technology accomplishes this?
- A relational database cluster
- A local browser cookie
- A content delivery network (CDN) (Correct answer)
- A single centralized origin server
Correct answer: A content delivery network (CDN)
A CDN caches static content at edge locations near users, cutting round-trip latency.
Question 2: Which database technique splits a large table's rows across multiple servers based on a key, such as user ID?
- Sharding (horizontal partitioning) (Correct answer)
- Indexing
- Normalization
- Denormalization
Correct answer: Sharding (horizontal partitioning)
Sharding distributes rows across servers by a partition key so each server holds a subset of the data.
Question 3: In a microservices system, an API gateway primarily serves to:
- Compile services into a single binary
- Store user passwords in plaintext for speed
- Provide a single entry point that routes requests to backend services (Correct answer)
- Replace all databases with one shared schema
Correct answer: Provide a single entry point that routes requests to backend services
An API gateway is the unified front door that routes, authenticates, and often rate-limits requests to services.
Question 4: A payment service occasionally receives the same request twice due to network retries. What property should the API be designed with so duplicate requests do not double-charge customers?
- Encapsulation
- Polymorphism
- Lazy loading
- Idempotency (Correct answer)
Correct answer: Idempotency
An idempotent operation produces the same result no matter how many times it is repeated.
Question 5: Which pattern prevents a failing downstream service from exhausting resources by temporarily blocking calls to it after repeated failures?
- Two-phase commit
- Factory pattern
- Observer pattern
- Circuit breaker (Correct answer)
Correct answer: Circuit breaker
A circuit breaker trips after repeated failures and short-circuits further calls until the service recovers.
Question 6: What is the main trade-off of eventual consistency in a distributed data store?
- All queries become slower than in strongly consistent systems
- Writes are permanently lost during replication
- Reads may temporarily return stale data in exchange for higher availability (Correct answer)
- The database cannot be backed up
Correct answer: Reads may temporarily return stale data in exchange for higher availability
Eventual consistency allows replicas to lag briefly, so reads can be stale, but availability and performance improve.
Question 7: A system requirement states it must handle 10,000 requests per second with 99.99% uptime. These are examples of:
- User stories
- Use case diagrams
- Functional requirements
- Non-functional requirements (Correct answer)
Correct answer: Non-functional requirements
Throughput and availability describe how a system performs, not what it does, making them non-functional requirements.
A video streaming service wants to reduce latency for users worldwide by serving static content from servers geographically close to them.
Which technology accomplishes this?