LEARN. PRACTICE. EXPLAIN.
Learning paths & interview practiceP
← Build a tenant-safe MCP tool server & eval runner
BUILD → VERIFY → EXPLAIN · STEP 3 OF 6

Build tenant-scoped hybrid retrieval & fallback

Bridge vocabulary mismatches and refuse to guess when evidence is weak.

UNDERSTAND

Bring these concepts with you

BUILD

Your implementation

  1. Implement retrieveGroundedChunks(query, docs, actor, options) pre-filtering docs by actor.organizationId.
  2. Combine exact query token hits with synonym expansion ('cancel' -> 'terminate', 'plan' -> 'membership').
  3. Return { grounded: false, citations: [], fallbackMessage } when no document meets minScore.
export function retrieveGroundedChunks(query, docs, actor, options = {}) {
  // Pre-filter tenant docs, score exact + synonym tokens, enforce minScore fallback.
}
Need a hint?
  • Filter by tenant BEFORE scoring so another tenant's documents never enter context.
  • Test both synonym vocabulary mismatch and an unanswerable out-of-scope query.

Saved on this device · 0 / 6000 · Do not include passwords or private data.

VERIFY

Acceptance checks

From the folder containing your downloaded files, run:

node checks.mjs ./starter.mjs 3

This runs checks up to this step. Earlier steps must work first. Mark each result only after checking your implementation; the website does not run or grade it.

Record your attempt to enable the checklist and reference comparison.

Compare with the reference

Attempt the step first, then compare decisions and behavior. There can be more than one correct implementation.

EXPLAIN

Your interviewer asks

If increasing top-k from 3 to 10 still misses the answer, what is wrong and how do you fix it?

Say your answer aloud, then record the trade-offs and evidence in your notes above.

LOCAL VOICE REHEARSAL

Rehearse your step walkthrough aloud

Target pacing: 02:00 · Stays in this browser only; never uploaded.

00:00/ 02:00
AlifBay Prep