Practice
1. A high-traffic e-commerce platform expects a sudden surge in user requests immediately after launch. Which component is best suited to pre-populate the cache with frequently accessed product data to avoid cold-start latency?
easy
Solution
Step 1: Identify cache warming purpose
Cache warming service proactively loads hot keys to avoid cold cache latency at launch.Step 2: Eliminate lazy and write-through options
Lazy loading causes initial latency; write-through updates cache reactively, not proactively.Final Answer:
Option A -> Option AQuick Check:
Preloading hot keys before launch avoids cold cache misses [check]
Hint: Preload hot keys before launch to avoid cold cache misses [OK]
Common Mistakes:
2. A company wants to hide internal client IP addresses from external servers while allowing clients to access the internet. Which proxy type should be used to achieve this?
easy
Solution
Step 1: Identify proxy role in hiding client IPs
A forward proxy acts on behalf of clients, masking their IP addresses from external servers.Step 2: Eliminate other options
Reverse proxies hide backend servers, not clients; load balancers distribute load but don't hide clients; DNS proxies only resolve names.Final Answer:
Option D -> Option DQuick Check:
Forward proxy hides client IPs from external servers [check]
Hint: Forward proxy hides clients; reverse proxy hides servers [check]
Common Mistakes:
3. A messaging system must handle 1 million writes per second and fan-out delivery to thousands of consumers without blocking producers. Which component is primarily responsible for decoupling producers from consumers to achieve this?
easy
Solution
Step 1: Identify the decoupling mechanism
Relational DBs with WAL (Use a relational database with write-ahead logging to buffer messages) are durable but cannot handle 1M writes/sec with fan-out efficiently; Redis (Use a centralized in-memory cache like Redis to store messages temporarily) is fast but lacks durability and persistence guarantees at this scale; direct HTTP calls (Use direct synchronous HTTP calls from producers to consumers) block producers and do not decouple.Step 2: Recognize distributed brokers' role
Distributed message brokers with partitioned logs (Use a distributed message broker with partitioned logs and asynchronous consumers) allow asynchronous writes and reads, decoupling producers and consumers, enabling high throughput and scalable fan-out.Final Answer:
Option D -> Option DQuick Check:
Partitioned broker logs decouple producers and consumers for high throughput [check]
Hint: Partitioned brokers decouple producers and consumers [check]
Common Mistakes:
4. If the Inverted Index Update Service crashes and stops updating document frequencies (DF), what is the exact failure observed in search relevance?
medium
Solution
Step 1: Understand DF update role
Inverted Index Update Service maintains DF counts; if it crashes, DF stops updating and becomes stale.Step 2: Trace impact on ranking
Ranking cannot rely on fresh DF; system falls back to BM25 variant that tolerates stale DF or uses approximations; queries do not error out; new documents may still be indexed but DF is outdated.Final Answer:
Option A -> Option AQuick Check:
System falls back to BM25 variant tolerating stale DF [check]
Hint: Without DF updates, system falls back to BM25 variant [check]
Common Mistakes:
5. At 10x scale, which MongoDB component is most likely to become the bottleneck first when using the bucket pattern for time-series data, and why?
hard
Solution
Step 1: Identify bucket pattern scaling challenges
Bucket pattern creates many bucket documents requiring precise routing by mongos.Step 2: Mongos metadata overhead
Mongos maintains routing metadata and must route each write to correct shard and bucket, increasing load at scale.Step 3: Compare other components
Shard servers handle writes but document splits are less frequent; network saturates later; app server bottleneck unlikely.Final Answer:
Option B -> Option BQuick Check:
Mongos routing metadata load grows fastest at 10x scale [check]
Hint: Mongos routing metadata overload is first bottleneck at scale [check]
Common Mistakes:
