The interview problem

Practice prompt

Design a model that orders text blocks in newsletters with columns, captions and sidebars before downstream summarization.

Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.

1. Scope and worked approach

Assume OCR supplies block text and coordinates; recognition quality is measured separately. Represent each block with text, geometry and page identity. Predict precedence edges, then construct a deterministic acyclic order with uncertainty attached to ambiguous edges. Include a simple column-and-coordinate baseline. Train on human block sequences with explicit conventions for captions and footnotes. Split by publication template to avoid memorizing page layouts. Store block IDs so the output can be traced back to page regions.

2. Trace the design or derivation

OCR blocks
  → text and geometry encoder
  → precedence edges
  → cycle resolution
  → ordered sections

Annotate ambiguous layouts with the permitted alternatives or a section hierarchy. A single arbitrary gold order can punish a valid reading path. For deployment, expose block references and a reorder control so corrected sequences can improve evaluation without silently changing the underlying OCR text or page coordinates.

3. Calculate the example

For four blocks, there are 4×3/2 = 6 unordered pairs. Five correctly ordered pairs give 83.3% pairwise accuracy even if the one wrong pair moves a critical warning after its conclusion.

4. Failure cases and trade-offs

Pairwise predictions can form cycles; remove the weakest edge with an audit flag rather than silently presenting inconsistent order. A total order simplifies consumers but loses legitimate parallel sidebars. Report section-boundary and task-level errors alongside pair accuracy.

5. Validation, follow-ups and self-review

Use two-column pages, spanning headings and footnotes as fixtures. Follow-up: when should output be a hierarchy rather than one sequence? Self-review: specify annotation policy, cycle handling and a downstream summary-quality check.

Sources and related practice

Technical reference: arxiv.org — Joint text, image and layout representations; ordering graph is an original proposal.

Source publication/update: Submitted December 29, 2020; revised January 10, 2022. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.

Continue with Extract structured tables from enterprise documents; Retrieve evidence across page layout and text.

Continue your preparation

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