PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/ML System Design/Shopify

Design a hierarchical multi-label classifier

Last updated: Mar 29, 2026

Quick Overview

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.

  • hard
  • Shopify
  • ML System Design
  • Machine Learning Engineer

Design a hierarchical multi-label classifier

Company: Shopify

Role: Machine Learning Engineer

Category: ML System Design

Difficulty: hard

Interview Round: Onsite

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.

Quick Answer: 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.

Related Interview Questions

  • Design Personalized Product Feeds - Shopify (medium)
  • Design hierarchical product classification - Shopify (medium)
  • Design search autocomplete ML system - Shopify (medium)
  • Design a baseline loan recommendation system - Shopify (hard)
  • Describe ML projects and tech choices - Shopify (medium)
Shopify logo
Shopify
Sep 6, 2025, 12:00 AM
Machine Learning Engineer
Onsite
ML System Design
29
0

System Design: Hierarchical Multi-Label Classifier for Noisy Taxonomy

Context

You have a catalog of items with hierarchical tags (e.g., Category → Subcategory → Leaf). Tags are:

  • Not mutually exclusive (an item can belong to multiple leaves/paths).
  • Inconsistent across levels (naming, missing parents, duplicate/overlapping nodes).

Design a production-ready classifier that predicts consistent hierarchical labels for new items, given raw item data (e.g., title, description, images, structured attributes).

Requirements

  1. Clarify and define the label space (multi-label vs. multi-class) and decision about predicting leaves vs. all ancestors.
  2. Propose data cleaning and taxonomy normalization steps (deduplication, synonym mapping, cycle detection, DAG enforcement, multi-parent handling).
  3. Choose model architecture(s) that capture label dependencies (e.g., top-down, multi-task per level, label-graph models) and explain trade-offs.
  4. Specify loss functions (binary cross-entropy) and any hierarchical/constraint-aware losses to enforce parent–child consistency and capture co-occurrences.
  5. Define thresholding, calibration, and decoding to turn scores into a valid hierarchical set (e.g., per-label thresholds, hierarchical closure, beam search).
  6. Handle severe class imbalance and long-tail labels.
  7. Propose evaluation metrics at leaf and hierarchy levels (micro/macro F1, PR-AUC, hierarchical precision/recall, path metrics) and how to construct validation splits.
  8. Explain training data requirements and strategies to obtain labels at scale (weak supervision, semi-supervised, active learning, PU-learning).
  9. Set realistic inference latency/throughput targets and model size constraints, plus optimization tactics.
  10. Monitoring and maintenance: data/label drift, calibration, constraint violations, taxonomy updates, human-in-the-loop.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More ML System Design•More Shopify•More Machine Learning Engineer•Shopify Machine Learning Engineer•Shopify ML System Design•Machine Learning Engineer ML System Design
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.