Practice
Solution
Step 1: Identify ingestion requirements
High throughput and low latency ingestion require a scalable, partitioned system that can handle parallel writes.Step 2: Evaluate components
Relational DBs (A) can't handle this write volume with low latency; single-threaded queues (C) limit throughput; batch systems (D) increase latency.Final Answer:
Option C -> Option CQuick Check:
Kafka partitions enable parallel ingestion with low latency [check]
Solution
Step 1: Evaluate client-specific optimization needs
Separate BFF layers per client type allow tailored APIs, improving UX and reducing client complexity.Step 2: Assess maintainability
Separate BFF layers per client type behind a common API Gateway isolates client-specific logic in BFFs, keeping microservices generic and maintainable. Single API Gateway forwarding requests directly to microservices with client logic inside services mixes client logic into services, increasing coupling. One monolithic backend serving all clients with feature flags for client differences's monolith reduces flexibility and scalability. Client apps call microservices directly, bypassing API Gateway and BFF breaks encapsulation and complicates security.Final Answer:
Option B -> Option BQuick Check:
Separate BFFs isolate client logic, improving maintainability and optimization [check]
Solution
Step 1: Trace Kafka's role in upload pipeline
Kafka buffers upload events for async processing; frontend uploads don't block on Kafka (A wrong).Step 2: Identify failure impact
Metadata extraction and transcoding (B) stall but do not cause immediate video unavailability; feed algorithm (D) depends on processed data, not Kafka directly.Step 3: Recognize CDN caching dependency
Without Kafka, processed videos don't reach CDN timely, causing cache misses and playback failures (C).Final Answer:
Option D -> Option DQuick Check:
Kafka outage delays CDN caching, causing playback failures [check]
Solution
Step 1: Analyze client connectivity constraints
Mobile clients often have intermittent connectivity and poor support for HTTP/2 streaming.Step 2: Evaluate streaming options
Direct gRPC streaming (A) is unreliable on mobile. WebSockets (C) add complexity and JSON is less efficient. REST long polling (D) is less efficient and higher latency. Unary calls with polling and backoff (B) handle intermittent connectivity gracefully.Final Answer:
Option B -> Option BQuick Check:
Mobile intermittent -> unary calls + polling with backoff [check]
Solution
Step 1: Analyze latency and consistency needs
Real-time games require fast access to player state with strong consistency.Step 2: Evaluate architecture trade-offs
Stateful servers with in-memory state reduce latency and allow immediate state updates; periodic persistence balances durability.Final Answer:
Option D -> Option DQuick Check:
Stateful in-memory state + persistence -> low latency, consistent [check]
