Practice
1. In the context of LLM serving infrastructure, which component is primarily responsible for reducing latency by reusing previously computed attention outputs?
easy
Solution
Step 1: Identify the component's role.
KV Cache stores key-value pairs from previous computations to avoid redundant calculations.Step 2: Eliminate wrong options.
Batching reduces overhead by processing multiple requests together, not by reusing computations. Speculative Decoding predicts future tokens, not reuse. Load Balancer distributes requests, unrelated to computation reuse.Final Answer:
Option C -> Option CQuick Check:
KV Cache reuses computations to cut latency. [OK]
Hint: KV Cache reuses computations to cut latency. [OK]
Common Mistakes:
2. When implementing a Guardrails System for LLMs, should you prioritize precision over recall, and why?
medium
Solution
Step 1: Understand the trade-off
Prioritizing precision minimizes false positives, crucial for user experience.Step 2: Eliminate wrong options
Recall is important but can lead to over-blocking, efficiency isn't the main concern, and equal importance isn't practical in all cases.Final Answer:
Option C -> Option CQuick Check:
Prioritize precision to avoid blocking legitimate content. [OK]
Hint: Prioritize precision to avoid blocking legitimate content. [OK]
Common Mistakes:
3. In a news feed system, should you prioritize collaborative filtering or content-based filtering when user data is sparse?
medium
Solution
Step 1: Analyze data availability
When user data is sparse, content-based filtering is more effective as it relies on item attributes rather than user interactions.Step 2: Eliminate wrong options
A: Collaborative filtering struggles with sparse data. C: It captures preferences well but needs data. D: Computational power is not the main concern here.Final Answer:
Option A -> Option AQuick Check:
Content-based works with sparse user data. [OK]
Hint: Content-based works with sparse user data. [OK]
Common Mistakes:
4. In a news feed system, what is a likely failure mode if the user feedback loop is not properly integrated?
medium
Solution
Step 1: Understand the role of feedback loops
Feedback loops are crucial for updating and refining recommendations based on user interactions.Step 2: Identify the impact of missing feedback
Without proper integration, recommendations become stale as they don't adapt to user preferences.Final Answer:
Option D -> Option DQuick Check:
Feedback loops prevent stale recommendations. [OK]
Hint: Feedback loops prevent stale recommendations. [OK]
Common Mistakes:
5. In a visual search system, when should you prefer using an Approximate Nearest Neighbor (ANN) index over an exact search method?
medium
Solution
Step 1: Consider the trade-offs
ANN is preferred when low latency is crucial because it speeds up search at the cost of some accuracy.Step 2: Eliminate wrong options
Exact matches require exact search, small datasets don't benefit much from ANN, and one-dimensional search doesn't need ANN complexity.Final Answer:
Option A -> Option AQuick Check:
ANN for speed, not exactness. [OK]
Hint: ANN for speed, not exactness. [OK]
Common Mistakes:
