Practice
Solution
Step 1: Understand Context Manager role at Step 4
It must prepare input within the LLM's token window limit to avoid rejection.Step 2: Analyze behavior on exceeding token limit
Sending full history (B) causes LLM errors; splitting requests (C) breaks context continuity; caching and manual intervention (D) is impractical. Truncation (A) preserves recent context within limits.Final Answer:
Option A -> Option AQuick Check:
Context Manager truncates oldest messages to fit token window [check]
Solution
Step 1: Identify deployment isolation needs
Decoupling feature deployments requires independent service lifecycles, which microservices provide.Step 2: Evaluate alternatives
Monoliths (A and C) share deployment units, risking system-wide impact. Serverless (D) can be tightly coupled if functions share state or deployment.Final Answer:
Option A -> Option AQuick Check:
Microservices enable independent deploys and reduce blast radius [check]
Solution
Step 1: Identify the component that distributes traffic
A DNS server (A DNS server that resolves domain names to IP addresses) only resolves domain names and does not balance load dynamically. A caching proxy (A caching proxy that stores frequently accessed responses) serves cached content but does not distribute load evenly. A message queue (A message queue that buffers incoming requests for asynchronous processing) buffers requests asynchronously but does not route live HTTP requests to backend servers.Step 2: Understand load balancer role
A load balancer (A load balancer that routes requests based on server health and capacity) routes incoming requests to backend servers based on health checks and capacity, preventing overload and ensuring even distribution.Final Answer:
Option C -> Option CQuick Check:
Load balancer routes requests evenly based on server health [check]
Solution
Step 1: Analyze Redis Sorted Sets scaling limits
Sorted Sets require in-memory storage and have limited sharding options, making Redis cluster memory the bottleneck.Step 2: Compare other components
Databases can be scaled horizontally; Ranking Workers can be parallelized; API Gateways scale with load balancers.Step 3: Identify Redis cluster as first failure point
Memory pressure and inability to shard sorted sets efficiently cause Redis cluster to fail first under 10x load.Final Answer:
Option A -> Option AQuick Check:
Redis Sorted Sets memory and sharding limits cause first failure at scale [check]
Solution
Step 1: Analyze stateful components at scale
Chat servers maintain WebSocket connections statefully; scaling requires connection migration or sticky sessions.Step 2: Identify bottleneck
At 10x scale, chat servers hit connection limits and cannot shard existing connections, causing failure before DB or load balancer.Final Answer:
Option C -> Option CQuick Check:
Stateful WebSocket servers -> scaling bottleneck due to connection affinity [check]
