Design a hierarchical multi-label classifier
ShopifyMachine Learning Engineer · OnsiteLast updated
This question evaluates a candidate's competency in designing production-grade hierarchical multi-label classification systems, covering taxonomy normalization, label dependency modeling, loss and decoding strategies, class imbalance handling, evaluation metrics, data labeling at scale, and operational constraints such as latency, model size, and monitoring. Commonly asked in the ML System Design domain to assess both conceptual understanding of hierarchical label structures and practical application-level trade-offs in architecture, training, deployment, and maintenance.
You are given hierarchical tags for items, but the tags are not mutually exclusive and contain inconsistencies across levels. Design a classifier that handles this taxonomy: clarify the label space (multi-label vs. multi-class), propose data cleaning and taxonomy normalization, choose model architecture(s) to capture label dependencies, specify loss functions (e.g., binary cross-entropy, hierarchical/constraint-aware losses), define thresholding/calibration, handle class imbalance, and propose appropriate evaluation metrics at leaf and hierarchy levels. Explain training data requirements, inference latency targets, and monitoring.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.