Valenx Press

Valenx Interview Pass: free Week 0 sample

This is a trimmed excerpt of Week 0, the 7-day starter plan every member gets the moment they join. The full Week 0 has 17 questions over 7 days, plus a timed mock and a study plan. A new pack lands every Monday; data science and product manager packs are included.

How to use it: answer out loud or in writing before you read the outline, then compare. Score yourself 1 to 4 on structure, technical depth, quantification and follow-ups.

Get the 12-month Pass for $79
Mid · aie-003

Explain the KV cache and why it matters for inference.

What it tests: Whether you understand autoregressive decoding well enough to explain what is cached and why, can estimate memory with the formula, and know that the cache, not only the weights, often limits batch size and context length.

Strong-answer outline

  1. State the reason: during autoregressive decoding the keys and values of earlier tokens do not change.
  2. State the saving: store and reuse them, so each new token computes only its own Q, K and V instead of recomputing the whole prefix.
  3. State the cost: memory per sequence is roughly 2 x layers x kv_heads x head_dim x tokens x bytes per value.
  4. State the consequence: it often limits batch size and context length more than the weights do.
  5. Name the mitigations: grouped-query attention, KV quantization and paged allocation (as in vLLM's PagedAttention).

Model answer (short)

During autoregressive decoding, the keys and values of earlier tokens do not change, so they are stored and reused; each new token computes only its own Q, K, V. This turns per-step attention from recomputing the whole prefix into one pass over cached tensors. The trade-off is memory: per sequence it is roughly 2 x layers x kv_heads x head_dim x tokens x bytes per value, and it often limits batch size and context length more than the weights do. Grouped-query attention, KV quantization and paged allocation (as in vLLM's PagedAttention) exist to shrink or pack it.

Likely follow-up: Estimate KV-cache memory for a 32-layer model, 8 KV heads, head_dim 128, 8k tokens, fp16. 2 x 32 x 8 x 128 x 8192 x 2 bytes, about 1 GiB per sequence.

Common mistakes

Senior · aie-040

How do you debug poor RAG answer quality?

What it tests: Whether you debug systematically by stage instead of rewriting the prompt, and whether you know where RAG usually breaks.

Strong-answer outline

  1. Collect failing questions and, for each, the document that should answer it.
  2. Ingestion and parsing: was the document indexed, and is its text intact (tables, PDFs, scans)?
  3. Chunking: is the answer inside one sensible chunk with its context?
  4. Retrieval and ranking: did the chunk appear in the top-k, and was it ranked high enough to reach the prompt?
  5. Generation: was it in the prompt and did the model use it? Fix the earliest failing stage, then add the case to the eval set.

Model answer (short)

Trace a failing question: was the right document ingested and parsed correctly, was it chunked sensibly, did it appear in the top-k, was it ranked high enough, was it included in the prompt, and did the model use it? Fix the earliest failing stage. Most issues are parsing, chunking or retrieval, not the generator.

Likely follow-up: The right chunk is retrieved but the answer is still wrong. What next? Check its position and the amount of competing context, tighten instructions to answer from sources, and evaluate faithfulness on that case.

Common mistakes

Senior · aie-031

How do you evaluate a RAG system?

What it tests: Whether you split evaluation into retrieval and generation, know concrete metrics for each, build a golden set from real questions, and can trace a failing answer to the stage that broke.

Strong-answer outline

  1. Evaluate retrieval and generation separately.
  2. Retrieval: recall@k, precision@k, MRR or nDCG against labelled question-to-source pairs.
  3. Generation: faithfulness (claims supported by the retrieved context), answer relevance, correctness against a reference, citation accuracy.
  4. Data and grading: a golden set from real user questions, an LLM judge calibrated against human labels, plus latency and cost per answer.
  5. Debugging: trace a failing question stage by stage and fix the earliest failing stage.

Model answer (short)

Separately. Retrieval: recall@k, precision@k, MRR or nDCG against labelled question-to-source pairs. Generation: faithfulness (claims supported by retrieved context), answer relevance, correctness against a reference, and citation accuracy. Build a golden set from real user questions, use an LLM judge calibrated against human labels, and track latency and cost per answer.

Likely follow-up: How do you debug poor RAG answer quality? Trace a failing question through ingestion, parsing, chunking, retrieval, ranking, prompt assembly and generation, and fix the earliest failing stage.

Common mistakes

Practice prompt and scoring rubric

"Explain the RAG architecture end to end, then tell me the first three things you would check if users say the answers are wrong." (5 minutes, out loud.)

Score yourself: 1 = names the parts only; 2 = indexing and query paths in order; 3 = adds metadata, re-ranking and a decline path; 4 = also separates retrieval from generation evaluation and fixes the earliest failing stage first (aie-026, aie-040, aie-031).

Want a second opinion? Paste your answer into the free answer check.

Get every Monday's pack

Best value

12-month Pass

$79 for 12 months

About $6.58 a month, about 22 cents a day. You pay once. It does not renew.

Get the 12-month Pass for $79

One-time payment, no auto-renew. Written only. Practice material, not a promise of any interview result. Full details on the Interview Pass page.

Valenx Press