Wrap-Up

Interview Tips

Open with the evidence contract:

“I would separate document preparation from question answering. Every answer must use current, permitted, applicable evidence. I would start with a simple read-only RAG workflow, validate source references, and buffer responses for a final authorization check.”

Then drive the interview toward the difficult parts rather than listing model vendors.

Time in a 40-minute roundFocus
First 5 minutesScope, caller identity, supported questions, confidentiality
Next 5 minutesTraffic, tokens, storage, and provider quota arithmetic
Next 10 minutesIngestion path and the first complete answer path
Next 15 minutesRetrieval quality, atomic version activation, and release authorization
Final 5 minutesOutages, evaluation, cost, and trade-offs

Useful talking points:

  • A vector database is optional. Retrieval can begin with keyword search or database vector support.
  • RAG is not training. Current policy arrives as evidence during inference.
  • Access is not a prompt instruction. The retrieval and release boundaries enforce it.
  • Citations are not proof by themselves. Check actual source support.
  • Average QPS hides model capacity. Include tokens and in-flight requests.
  • A cache is another evidence consumer. Reuse needs current dependencies.
  • Do not add an agent to a fixed workflow. This case has no autonomous write task.

Resiliency

FailureProtectionUser-visible behavior
Application instance crashStateless API tier and durable request stateRetry/reconcile the same logical request
Worker crashDurable queue, lease, deterministic IDsProcessing resumes or reports failure
Database/queue dual-write gapTransactional outboxAccepted upload is not silently lost
Poison documentBounded retries and dead-letter handlingAdministrator sees a failed job
Authorization authority unavailableFail closedExplicit temporary error
Model rate limit/outageAdmission limits, bounded retries, circuit breakerClear retryable service error
Source changed during generationFinal consistent source checkNo stale answer release from that snapshot
Search copy lagsAuthoritative source eligibility checkSkip old data or report not-ready state
Optional cache unavailableRun normal path within capacity limitsSlower response or explicit overload

Avoid “fallbacks” that invent policy answers. An approved alternate model must pass quality and data-handling requirements before it becomes an outage path.

Disaster Recovery

  • Back up authoritative metadata and original files with tested restoration.
  • Preserve compatible source versions and preparation configurations.
  • Search indexes can be rebuilt from originals and version metadata, but rebuilding takes time and embedding capacity.
  • Keep authorization and deletion state authoritative during recovery; do not restore an old index and serve it without current eligibility checks.
  • Define recovery point and recovery time objectives with the business. Backups and replication do not eliminate every data-loss scenario.

Observability

Service-Level Indicators

  • Eligible-request completion within the 12-second deadline.
  • p50/p99 time to validated answer.
  • Model and embedding quota utilization.
  • Source preparation/activation lag.
  • Provider failure, refusal, and incomplete-output rates.
  • Source-change and final-authorization rejection rates.
  • Cost per successful task, including failed attempts.

Quality Indicators

  • Sufficient-evidence recall by question slice.
  • Correctness and support on reviewed samples.
  • Citation accuracy and coverage.
  • Unnecessary refusal and clarification rates.
  • Cross-tenant/forbidden-source test failures as release blockers.

Do not treat a low HTTP error rate as answer correctness. A 200 response with an invented policy is still a product failure.

Tracing and Safe Logging

Propagate a request ID through admission, retrieval, generation, and validation. Record versions, timings, usage, safe source identifiers, and reason codes.

Do not put unrestricted prompts, source excerpts, employee details, or raw conversation content into default logs. Restrict trace access, bound retention, and avoid sensitive/high-cardinality metric labels.

Alerts

SignalPossible explanation
Empty evidence risesIngestion breakage, filter bug, or new unsupported questions
Active-version mismatch risesSearch lag or lifecycle regression
Provider retries riseQuota pressure or outage
Input tokens riseRedundant retrieval or history growth
Validation errors rise after releasePrompt/schema/model incompatibility
Contractor slice quality fallsApplicability or retrieval regression

Concepts Used

Final Trade-offs

DecisionWhy chosenWhat we give up
Read-only fixed workflowSmaller, testable control surfaceAutonomous task execution
Existing database plus search indexesFewer synchronization boundariesPotential shared-resource contention
Immutable versions and activationComplete reader-visible evidenceExtra storage and lifecycle work
Authoritative access checksDefined revocation semanticsAvailability depends on authorization
Buffered answer releaseFinal output/source checksImmediate answer-token streaming
No answer cache initiallySimpler correctness baselineHigher model-call volume
Managed model initially if compliantLower initial serving ownershipProvider dependency and quota constraints

Test Your Understanding

These questions combine architecture, arithmetic, and failure reasoning. Try drawing the relevant request or lifecycle timeline before expanding the answer.

  1. Why does this design have separate ingestion and question paths?
Document extraction and embedding happen when sources change; retrieval and generation happen for each question. Separating them avoids repeatedly processing whole documents and allows independent quotas, retries, and freshness tracking.
  1. How do 20,000 daily users produce the 30-QPS peak estimate?
20,000 * 10 = 200,000 questions/day. Dividing by 86,400 gives about 2.31/s. Applying the assumed 12x peak factor gives 27.8/s, rounded upward to 30. The factor must be validated against real traffic.
  1. Why is five million vectors not automatically a sharding requirement?
Capacity depends on dimensions, indexes, filters, hardware, and load. The raw vectors are 15.36 GB under the stated assumptions. Benchmark a simpler deployment before adding distributed coordination.
  1. Does 15.36 GB describe total database storage?
No. It excludes text, metadata, graph/index structures, retained versions, replicas, logs, backups, and rebuild headroom.
  1. Why does 30 requests/s also require a token-quota estimate?
At 2,400 average input-plus-output tokens, typical peak traffic is about 4.32 million tokens/minute. The admission cap is 6,000 input plus 600 reserved output, or 11.88 million tokens/minute. A request quota, or a token quota sized from the average, does not establish that the provider can serve the workload.
  1. What is the assumed average number of in-flight requests at peak?
30 requests/s * 4 seconds average duration = 120. This uses a planning mean, not p50, and does not establish tail-latency capacity.
  1. The upload returns 202. Can the employee immediately rely on the policy being searchable?
No. The upload is accepted, but preparation and activation are asynchronous. Expose status and retain the prior active version until the replacement is ready.
  1. What prevents a database write succeeding while its queue event is lost?
Write an outbox event in the same database transaction as the version/job metadata. A publisher retries delivery, and the worker processes the event idempotently.
  1. Why cannot a delayed version-2 worker replace active version 3?
Activation checks the current requested version, row revision, and tombstone in an authoritative transaction. A stale job becomes superseded rather than moving the active pointer backward.
  1. Can physical index cleanup be asynchronous after deletion?
Yes, if authoritative source eligibility blocks future use immediately under the defined boundary. Physical cleanup and retention still need an explicit tracked process.
  1. Why is a copied ACL in the vector index insufficient?
It can lag permission updates. Current source authorization must be established before downstream text use and again at the defined release point.
  1. A permission is revoked during model generation. What happens?
If revocation precedes the final authorization snapshot, discard the buffered answer and report the source change or access failure. Do not release text from the now-ineligible source.
  1. What if revocation occurs after the final authorization snapshot?
The response may already be authorized and in flight. The design does not claim atomicity between database state and bytes reaching the user, nor retroactive revocation.
  1. Why buffer answer text instead of streaming immediately?
The chosen contract requires final source and output checks before answer release. Immediate streaming can disclose text that later fails validation or authorization.
  1. Can the UI still show progress while buffering?
Yes. It can show safe application-generated progress events such as searching or validating. These are different from releasing unvalidated model answer content.
  1. The model cites a real document but invents a carryover rule. Which checks matter?
Source existence and access pass, but claim support and citation coverage fail. A real citation does not support every statement attached to it.
  1. Why return a service error rather than unsupported during a provider outage?
Unsupported describes missing evidence. An outage is an operational failure and must remain visible to users, retries, availability metrics, and alerts. A classified provider safety refusal is 422 provider_refused, not unsupported and not 503, when it arrives before the deadline. A timely 409 source_changed is a valid consistency result and does not count against availability; a timeout during that recheck does.
  1. The question is identical but the employee’s region changed. Can the cache hit be reused?
Not without checking current applicability and source dependencies. Exact question text is not sufficient identity for a policy answer.
  1. Why must idempotency replay recheck source eligibility?
A previously valid result can become stale or forbidden. Idempotency avoids duplicate logical operations; it does not override current access and freshness requirements.
  1. Can application idempotency guarantee exactly-once model billing after a crash?
Not without compatible provider semantics. A prior call may have completed with its response lost. Record provider identifiers, reconcile where possible, and bound any duplicate inference cost.
  1. Why not send all top candidates to an external reranker before permission filtering?
That would disclose forbidden source text to the reranker. The authorization boundary must precede every downstream text processor, not only the final generator.
  1. A perfect reranker cannot find the missing exception. Why?
The exception may not be in the candidate set, may have been lost during extraction, or may have been separated from its rule. Reranking cannot recover absent evidence.
  1. Why is generated conversation history not authoritative policy evidence?
It can contain prior hallucinations, stale source summaries, and revoked content. Revalidate dependencies and retrieve current sources rather than treating earlier prose as truth.
  1. What is wrong with using stale token group claims for immediate revocation?
The claims can continue granting membership until token expiry. Current membership/permission state must support the promised revocation boundary.
  1. How can two incompatible embedding models silently break a working query?
Matching vector dimensions do not imply matching coordinate spaces. Switch the query encoder and prepared index as a compatible versioned pair.
  1. Does the hypothetical $720/day include all system costs?
No. It covers average answer-model usage at the stated rates. Add embeddings, retries, discarded generations, search, storage, network, review, and operations.
  1. Why do the average 2,000 input tokens and hard 6,000-token cap coexist?
One is a workload estimate for capacity/cost; the other is a per-request boundary. Averages do not replace hard limits, and long-tail requests can cost more.
  1. Is passing 95% answer correctness enough if one case leaks another tenant’s policy?
No. Cross-tenant exposure is a separate release blocker. It must not be averaged into an otherwise good quality score.
  1. What is the safest fallback when current permission cannot be established?
Fail closed with an explicit temporary service error. Do not reuse an old answer or assume copied index metadata is current.
  1. What single sentence best summarizes this architecture?
Prepare versioned evidence once, retrieve only current permitted sources for each request, generate within a bounded budget, and release only after explicit output and source checks.