The interview problem

Practice prompt

A marketplace needs structured material, dimensions, capacity and compatibility attributes from seller listings. Listings mix titles, descriptions, images and structured fields, and often omit or contradict values. Design an extraction service that improves search filters without silently inventing product facts.

Original ML-design practice, not a reported company interview. Examples and capacities are hypothetical. Primary schema references retrieved September 27, 2026; interview date not applicable.

Quick answer

Product attribute extraction maps source text into typed catalog fields while retaining evidence. Identify the product variant and whether a value describes an item, package or accessory before normalizing units. Abstain on conflicts or unsupported fields instead of filling a plausible value.

1. Define the extraction contract

Extract claims supported by the current listing version, not everything that might be true about the product. An absent material is unknown, not plastic, even if most similar products are plastic. Distinguish supported, missing, conflicting, not-applicable and unreadable states. Keep inferred enrichment in a separate field with a different policy if the business later wants it.

Use a versioned category schema. Shoe size requires a sizing system; battery capacity and container capacity have different dimensions; package weight is not product weight. Model the entity being described: a listing may sell a case compatible with a phone rather than the phone itself. Parent-product claims must not automatically override a selected variant.

Schema.org provides product properties and quantitative values with units and ranges. Use such vocabularies for interchange where appropriate, but maintain an explicit internal contract for evidence, missingness and variant scope. A schema-valid number can still describe the wrong object.

2. Separate extraction from normalization

listing version + category + selected variant
                      ↓
      text parsing / structured fields / image OCR
                      ↓
      evidence-linked attribute candidates
                      ↓
     scope, conflict and unit validation
                      ↓
   field-specific acceptance or review/abstention
                      ↓
       versioned attribute store → search filters

Start with exact parsers for stable structured fields and common units, then use a span extractor or constrained generative model for variable language. A category router selects allowed attributes; uncertain category assignment should restrict extraction or trigger review. Evaluate the router and downstream extraction jointly, since a correct extractor with the wrong schema still fails.

Store raw value, normalized value, unit, evidence location, source modality, listing revision, schema version and model version. Text evidence offsets must refer to a preserved source version, not mutable text. OCR needs image identity and bounding region. A valid citation identifies a source location; it does not prove that the model used it or that the cited text entails the output. Validate the relationship.

Treat listing instructions as content, never instructions to the extraction service. Constrained output can prevent malformed fields but cannot guarantee factual correctness. Keep parsing, allowed-unit checks and source-scope checks outside the model, and make publication conditional on them.

3. Work through units and conflicting scope

A listing says “Pack of 3 bottles, 750 mL each.” Per-unit capacity is 0.75 L, package count is three and total nominal capacity is 2.25 L. Store these as distinct attributes. Replacing per-unit capacity with 2.25 L would produce a valid number and a wrong search filter. Preserve the multiplication as a derived value with its operands rather than pretending 2.25 L was directly written.

For “width 20–22 cm,” retain the interval [0.20, 0.22] meters. Do not choose the midpoint unless the downstream contract explicitly requests an estimate. “Fits 20 cm shelves” is a compatibility claim, not necessarily the product's width. Unit normalization cannot resolve semantic role errors.

If the selected variant says 500 mL while a generic description says 750 mL, apply an explicitly agreed source hierarchy or mark a conflict. Record both claims. Never resolve disagreement by averaging the capacities. Locale-aware parsing matters: a comma can be a decimal marker or a separator; unclear input should remain unresolved rather than silently becoming a different magnitude.

4. Label what is knowable from the input

Build annotations for category, attribute, value, unit, entity/variant scope, supporting span and state. Give annotators the exact inputs available to the model. External manufacturer knowledge cannot become extraction ground truth unless that source is also part of the task. Include missing attributes, negation, accessories, contradictory descriptions, ranges and unreadable images.

Use adjudication for ambiguous cases and maintain a documented conflict policy. Seller-provided structured fields are useful weak labels, not automatically truth. Train on clean evidence-backed examples and explicitly identify noisy supervision. Preserve original seller values and provenance rather than overwriting them during annotation.

Split by product family and near-duplicate listings, then use a later time window for final evaluation. Otherwise the same manufacturer description can appear in both training and test. Report new sellers, categories, languages and templates separately. A good result on common electronics does not establish accuracy for apparel sizing.

5. Make precision, recall and coverage explicit

Consider 1,000 eligible listing–attribute slots. For this simplified single-valued example, annotation finds 600 supported values and 400 genuinely missing values; conflicting, unreadable and not-applicable slots are evaluated in separate slices, not silently dropped from overall reporting. The service emits 500 values: 450 correct, 30 incorrect on supported slots and 20 invented on missing slots. Precision is 450/500 = 90%; recall of supported values is 450/600 = 75%; output coverage is 500/1,000 = 50%. The missing-slot invention rate is 20/400 = 5%.

The remaining 500 abstentions consist of 120 missed supported values and 380 correctly unfilled missing slots. Counting all abstentions as errors understates useful behavior; counting all as correct rewards refusing to extract. Report these states separately. Incorrect values on supported slots contribute both a wrong prediction and a missed correct value under exact-match extraction scoring.

A stricter threshold emits 400 values: 388 correct, eight wrong on supported slots and four invented on missing slots. Precision becomes 97%, supported-value recall approximately 64.67%, coverage 40% and missing-slot invention 1%. This is a precision–coverage trade-off, not an unconditional improvement. Choose thresholds using attribute-specific error costs and validation data, then evaluate on a held-out set.

Score canonical values with documented equivalence rules and numerical tolerances. Evaluate evidence correctness, variant assignment and units independently as diagnostic metrics, plus end-to-end correctness. Report per-category and per-attribute metrics so high-volume easy fields cannot hide catastrophic unit errors in a rare field.

6. Publish with revision control and bounded review

Key extraction jobs by listing revision and schema/model version. At publication, atomically check the current source revision and the authorized extraction-release identifier, not just the last completed job. Reject revision 12 as soon as source revision 13 exists, even if its extraction has not finished. An old model job for revision 13 must also be rejected after a new release becomes authoritative. When the source changes, invalidate affected derived fields; do not keep old claims merely because the new version omits them. Reprocessing requires the intended source version, not whatever text happens to be current.

At one million updated listings per day, sending 2% to review creates 20,000 cases. At 90 seconds each, that is 500 reviewer-hours per day, or 100 reviewers at five productive review hours each. A review queue is therefore a capacity decision. Prioritize high-impact conflicts, sample low-risk outputs for audits and leave low-value unresolved fields unknown when review capacity is exhausted.

Roll out by category with shadow comparisons and sampled audits. Measure filter correctness, support complaints and correction rates as well as extraction metrics. A click-through increase does not prove attributes are true. Keep a rollback path to the prior extraction release while preserving source revisions and valid seller corrections; a model rollback must not resurrect obsolete listing facts.

7. Failure analysis and self-review

Test “not leather,” a phone case mistaken for a phone, identical titles with different variants, decimal-comma dimensions, package-versus-item weight, unreadable labels, malicious embedded instructions and late results from old revisions. Monitor publication lag, unsupported output rate, conflict rate, category drift and review backlog age.

Trade-offs: A schema narrows output variability but needs category maintenance. Evidence-only extraction improves auditability while leaving some true facts unknown. Conservative thresholds reduce wrong filters at the cost of coverage. Multimodal extraction can recover labels from images but adds OCR errors and serving expense.

Follow-ups: Does missing mean false? No. Is a cited span sufficient? No, it must support the correct attribute and entity. Can a unit conversion fix a scope mistake? No. Is 97% precision always preferable to 90%? Only with the corresponding coverage, costs and uncertainty considered.

Score 0–2 each for unknown/conflict semantics, category and variant schema, evidence-preserving normalization, explicit evaluation denominators and revision-safe publication. A strong answer treats unsupported facts as a distinct failure rather than a formatting problem.

Evaluate selective extraction without hiding abstentions

A reviewed set contains 1,000 requested attribute slots. The extractor returns a value for 600, of which 588 are supported and correct. Precision among returned values is 588/600 = 98%; output coverage is 600/1,000 = 60%. These numbers do not establish recall: some of the 400 abstentions may have no extractable answer in the source.

Annotate whether each slot is answerable. If 800 slots are answerable and the 588 correct returns cover distinct answerable slots, extraction recall is 588/800 = 73.5%. Keep incorrect values, unsupported guesses and correct abstentions distinguishable in the review.

For example, “shipping weight 2 kg” does not establish an item’s net weight, and package dimensions are not automatically product dimensions. A source span alone is insufficient if it supports the wrong semantic field. Report results by attribute and product category so frequent easy fields cannot conceal failures on units, variants or regulated claims.

Original worked follow-up, reviewed October 7, 2026. Reference: Schema.org: QuantitativeValue.

Sources and next steps

Retrieved pages identified themselves as development-version documentation; pin a chosen vocabulary version in implementation. Publication dates not established. Architecture, examples, metrics and review rubric are original proposals. Continue with document table extraction for row/column structure rather than listing semantics.

Continue your preparation

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