The interview problem

Practice prompt

Build evidence retrieval over two million pages of technical reports. Questions refer to charts, captions, tables and adjacent columns. Return the supporting page and region, preserving document version and access permissions. Explain how you would prove improvement over text-only retrieval without confusing page retrieval with correct answer generation.

Original ML design practice, not a reported company interview. Examples, scale and metrics are illustrative. Primary paper first submitted June 27, 2024, revised February 28, 2025; retrieved September 27, 2026; interview date not applicable.

1. Define evidence granularity

The retrieval unit is a versioned page, optionally with one or more supporting regions. Return document ID, immutable version, page index, region coordinates and score provenance. A document match is too coarse when only one of 200 pages contains the answer. A relevant page is still insufficient when the chosen crop omits the legend needed to interpret a chart.

Support questions requiring multiple pages or regions, and permit an insufficient-evidence result. Distinguish evidence retrieval from reading the retrieved material and generating an answer. A retrieval score is neither answer confidence nor proof that the answer is stated in the document.

2. Preserve visual and textual representations

authorized document revision
             ↓
  deterministic page rendering + text/OCR with coordinates
             ↓
   immutable page manifest and region relationships
             ↓
 text index + page-image representation + metadata filters
             ↓
 query → candidate union → reranking → region selection
             ↓
     authorized evidence bundle with page/version citations

Store the original page dimensions and the transformation from source coordinates to rendered pixels. Rotation, cropping and resizing must not make highlights point to the wrong place. Keep renderer and encoder versions in the index manifest so reproducing a result does not depend on a later library's defaults.

Extract available text with reading-order and bounding-box metadata, then OCR scanned regions where needed. Preserve captions, figure identifiers and nearby section headings as relationships instead of flattening everything into a single string. Keep the rendered page as a fallback when extraction loses symbols or layout.

Index only completed manifests. A query should not combine text from revision A with page images from revision B. Recheck permission at evidence delivery, including cached crops and any neighboring pages expanded after the initial search.

3. Compare complementary retrieval paths

Start with lexical and text-embedding retrieval on pages or layout-respecting blocks. This baseline is valuable for exact equipment codes, quantities and terminology. Add an image-based page retrieval path for visual structure and material whose meaning is poorly captured by extracted text.

ColPali is a primary research example of retrieving document pages through visual multi-vector representations and late interaction. It motivates an experiment, not a guarantee that a particular model wins on this customer's corpus. Benchmark scanned diagrams, languages, fonts and tiny labels separately.

Take a bounded union of text and visual candidates, deduplicate by page version, and rerank using the query plus rendered page and available text. Do not directly add scores from unrelated retrievers without a validated fusion rule. Candidate recall puts an upper limit on what reranking can recover.

Select evidence regions only after page retrieval. Preserve supporting context such as axis units, legends and caption scope. If region localization is unreliable, return the full page rather than presenting a precise-looking but unsupported crop. A similarity heatmap can guide inspection without being treated as a faithful explanation.

4. Work through a cross-column error

Consider a report page with two columns. The left column describes Pump A at 60 liters/minute. The right column describes Pump B at 90 liters/minute. A figure at the bottom uses a dashed curve for A and a solid curve for B. The question asks which pump corresponds to the dashed curve and its flow rate.

A flattened extraction may interleave column text and associate Pump A with 90. Retrieving the page successfully does not repair that association. The evidence bundle needs the legend linking dashed to A and the left-column statement linking A to 60, with both regions tied to the same revision.

Annotate these as a required evidence set, not merely as two independently relevant fragments. An answer of A and 60 is correct only if the evidence supports both the identity and quantity. If the legend is unreadable, abstain or return the page for inspection rather than infer that dashed lines always mean the first item.

5. Evaluate retrieval, localization and reading separately

Build adjudicated queries with supporting page sets, necessary regions, answerability and document versions. Split by document family and time to prevent near-identical annual reports from leaking across training and evaluation. Include hard negatives from the same template and obsolete revisions. If several alternative evidence sets can support an answer, record those alternatives; do not mark valid evidence wrong merely because it differs from one annotator's preferred set.

For 200 queries each requiring two pages, there are 400 required query-page pairs. Suppose top-10 retrieval finds 360 pairs: pair-level recall is 90%. If 165 queries have both pages, 30 have one and five have none, complete-evidence recall is 165/200=82.5%. The pair count agrees: 165×2+30=360. Neither metric alone describes the other.

For 100 questions each with one adjudicated supporting page, suppose text-only top-10 succeeds on 72 queries, visual top-10 succeeds on 80, and both succeed on the same 60 queries. Unioning the two candidate lists separately for each query succeeds on 92 queries, because 72+80−60=92. This is 92% query-level candidate recall before any smaller final cutoff, not a count of globally distinct pages. Reranking the union down to ten may lose some of those pages; measure the final list separately.

Evaluate region containment, whether necessary legends and units remain visible, and answer accuracy conditional on complete evidence. Also report end-to-end accuracy across all queries. Do not exclude retrieval failures from the headline answer metric. Include unanswerable questions and report unsupported answers rather than only successful examples.

6. Account for multi-vector cost

As a sizing assumption, use 1,024 vectors per page, 128 dimensions each and two bytes per value. That is 262,144 bytes per page; two million pages require about 524.288 GB of raw vector values. Three copies require about 1.573 TB before search-index overhead, metadata and page images. These are illustrative dimensions, not a required model configuration.

If 32 query vectors are compared with all 1,024 vectors for each of 100 candidate pages using 128-dimensional dot products, the dense work is 32×1,024×100×128=419,430,400 scalar multiply-accumulate terms per query. Actual implementations can batch or compress this work, but candidate limits and measured latency matter.

Use staged retrieval, bounded reranking and selective region processing. Quantization or vector pruning can reduce storage and cost but may disproportionately hurt small labels and uncommon symbols. Evaluate those slices before declaring a compression change harmless. Cache by query representation, document revision and authorization context as appropriate.

7. Handle visual ambiguity and operational failures

A visually similar template can dominate retrieval while containing the wrong year or product. Add exact metadata filters when the query specifies a version, and retain near-duplicate hard negatives. Text and image paths may share the same failure, so their agreement is not independent confirmation.

Downsampling can erase fine print. Keep a higher-resolution source and request a bounded high-resolution crop when the evidence needs it. If OCR disagrees with the page, preserve both representations and avoid silently treating either as unquestionable truth.

Missing pages, failed renders and encrypted unsupported files must appear as ingestion failures rather than empty searchable documents. If one retrieval path is unavailable, return a clearly defined degraded result and measure its quality. Do not claim a full-corpus search when only part of the index is healthy.

Treat document text as evidence, not instructions to change the retrieval policy or disclose other files. Permission filtering applies to neighbor expansion, reranking inputs and generated citations, not only the initial candidate API.

8. Trade-offs and follow-ups

Text retrieval is compact and strong on exact strings but can lose spatial relationships. Visual page retrieval retains appearance but adds cost and resolution sensitivity. Region indexing increases precision yet can detach evidence from necessary context. A hybrid approach earns its complexity only through measured gains on representative questions.

Follow-ups: What distinguishes a relevant page from sufficient evidence? How would you handle a chart spanning two pages? Why does candidate-union recall not equal final top-10 recall? How do revised page numbers affect citations? What tests catch a crop transformation bug?

9. Self-review rubric

  • Define versioned pages and complete evidence sets.
  • Preserve coordinate transforms, captions and reading relationships.
  • Compare text and visual retrieval against a strong baseline.
  • Measure candidate recall, final retrieval and answer quality separately.
  • Include multi-page, unanswerable and obsolete-version cases.
  • Size multi-vector storage and reranking work explicitly.
  • Handle unreadable regions and incomplete ingestion honestly.
  • Apply permissions to every evidence-delivery path.

Sources and related practice

ColPali: Efficient Document Retrieval with Vision Language Models, first submitted June 27, 2024; revised February 28, 2025; retrieved September 27, 2026. Primary research reference for visual page retrieval and the ViDoRe benchmark. Architecture, examples and calculations here are original practice, not reproduced benchmark results.

Continue with document table extraction and retrieval freshness.

Continue your preparation

Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.