The interview problem
Design a shared model that predicts product category and shipping weight without letting one objective dominate training.
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 both labels exist for some products, with missing-label masks. Use a shared encoder and separate heads; normalize each task loss over its observed labels, then combine with explicit weights. Compare against independent models under equal compute. Log per-task gradients and validation metrics, not just the summed loss. Split by product family to avoid near-duplicate leakage. Missing labels contribute no supervised loss, not a fabricated zero target.
2. Trace the design or derivation
Shared inputs → encoder → masked task heads → weighted losses → per-task release gates
Measure whether task gradients point in conflicting directions on representative batches, but treat this as diagnostic evidence rather than a sufficient optimizer-selection rule. A practical fallback is partial sharing: retain a common early encoder and separate later layers when the shared representation harms one task's validation performance.
3. Calculate the example
If category loss is 0.5 and weight loss is 100 in squared kilograms, equal numeric weights produce a total of 100.5 dominated by units. Scaling targets can change this total without improving either task, so validation metrics must remain in meaningful units.
4. Failure cases and trade-offs
Tasks may conflict even after scale normalization. Dynamic weighting can conceal degradation of a small but important task. Shared serving saves memory while independent heads or models simplify rollback. Establish per-task release gates and a fallback for negative transfer.
5. Validation, follow-ups and self-review
Test missing-label batches and compare each head with its standalone baseline. Follow-up: how would a newly added task affect old heads? Self-review: address scale, label masks and negative transfer explicitly.
Sources and related practice
Technical reference: arxiv.org — Combining task losses and the problem of differing scales.
Source publication/update: Submitted May 19, 2017; revised April 24, 2018. 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 Compare large batches and gradient accumulation; Design a model rollout and rollback platform.
Continue your preparation
Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.