Sanjaay Gowda T S
Kweichow Moutai Co., Ltd. practice

ORIGINAL COMPANY-CONTEXT PRACTICE

Track bottle batches through corrections

System designHardConcept

Original practice scenario: Design a synthetic beverage traceability system connecting production batches, packaging lots and distributor shipments, including later data corrections.

Written for independent practice using company context; this is not a verified question from a company interview.

A REASONED APPROACH

Model answer.

Model traceability as versioned relationships between independently identified lots. The system must distinguish physical lineage from commercial shipment records and retain the evidence behind corrections.

Work through it

  1. Define identifiers and quantities for production, packaging and shipment entities; represent splits and merges with explicit edges and units.
  2. Validate conservation rules where applicable, quarantine conflicting scans and append corrections with author, time and reason rather than deleting history.
  3. Support bounded upstream and downstream searches from a lot, with tests for returns, partial shipments, duplicate events and missing links.

Tradeoffs to discuss

  • An append-only history supports investigation but requires clear views of current accepted lineage and disputed evidence.

Common pitfalls

  • A scanned label alone does not establish physical authenticity.
  • Do not assume every source reports events immediately or in causal order.

KEEP PRACTISING

Related questions.

Keep learning beyond the interview.

Explore the Learning Hub