← Shopify Interview Insights

Shopify·Machine Learning Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Jun 2026Remote

Summary

ML system design round at Shopify for an MLE role. The whole thing was one big open-ended problem about real-time product categorization at scale, and they went deep on basically every layer of the stack.

Questions Asked (5)

Q1

Design an ML system that categorizes product listings in real-time against Shopify's taxonomy of 10,000+ categories organized across 26+ business verticals. Listings come in as a stream with title, description, images, and attributes, and need to be assigned to taxonomy nodes within seconds.

System DesignTechnical Trade-offsAlgorithms & Data Structures
Author's notes

This is a beast of a question.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints (latency, accuracy, scale, taxonomy dynamics), then propose a two-stage hierarchical classification system: a fast coarse-grained vertical classifier followed by fine-grained category prediction within the vertical. Discuss trade-offs between model complexity, latency, and accuracy, and outline how to handle cold-start, multi-modal inputs, and continuous taxonomy updates.

Pro tip: Emphasize that the taxonomy is hierarchical and dynamic—design a system that leverages the hierarchy to reduce the search space and can adapt to new categories without full retraining, e.g., via few-shot learning or embedding-based nearest neighbor search.

1. Clarify Requirements and Constraints

Ask about latency SLA (e.g., <2 seconds), throughput, accuracy targets, taxonomy update frequency, and available data (labeled examples per category). This shapes the entire design.

2. Design a Two-Stage Hierarchical Classifier

Propose a coarse model to predict the business vertical (26+ classes) using text and image features, then a fine-grained model per vertical to predict the specific category among its subcategories. This reduces the 10k-class problem to manageable subproblems.

3. Handle Multi-Modal Inputs and Feature Engineering

Describe how to combine title, description, images, and attributes: e.g., use a text encoder (BERT) and image encoder (CNN/ViT), concatenate embeddings, and include attribute embeddings. Consider late fusion or attention mechanisms.

4. Address Real-Time Serving and Scalability

Outline an architecture with a streaming pipeline (Kafka), feature store, model serving (TensorFlow Serving/TorchServe), and caching. Discuss batching, async processing, and fallback strategies for low-latency.

5. Plan for Taxonomy Evolution and Monitoring

Explain how to handle new categories: use embedding-based nearest neighbor for zero-shot, or periodic retraining with active learning. Include monitoring for drift, accuracy, and latency, with A/B testing for model updates.

Key Points to Mention

  • Hierarchical classification to reduce complexity and improve accuracy
  • Multi-modal fusion of text, images, and attributes
  • Real-time inference with low latency (e.g., model quantization, caching, async)
  • Handling taxonomy updates and cold-start categories (few-shot, zero-shot, embedding search)
  • Scalability and distributed serving (streaming, batching, load balancing)
  • Evaluation metrics: top-k accuracy, hierarchical precision/recall, latency percentiles

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would you handle rare categories and class imbalance in this taxonomy classification setting?

Technical Trade-offsAdaptability & Ambiguity
Author's notes

The long tail is brutal here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging the problem's impact on model performance and business metrics, then outline a structured approach that combines data-level, algorithm-level, and evaluation strategies. Emphasize the need to balance trade-offs between handling rare categories and maintaining overall accuracy, and highlight iterative experimentation with clear success metrics.

Pro tip: Propose a hybrid approach that combines techniques like re-sampling with cost-sensitive learning, and stress the importance of using appropriate evaluation metrics like macro-F1 or per-class recall to avoid misleading conclusions from accuracy alone.

1. Diagnose the Imbalance

Quantify the class distribution and identify rare categories. Assess the impact of imbalance on current model performance using per-class metrics.

2. Choose Data-Level Strategies

Consider resampling techniques such as oversampling rare classes (e.g., SMOTE) or undersampling frequent classes, being mindful of potential overfitting or information loss.

3. Apply Algorithm-Level Adjustments

Use cost-sensitive learning by assigning higher misclassification costs to rare classes, or employ ensemble methods like balanced random forests that inherently handle imbalance.

4. Leverage Transfer Learning or Hierarchical Methods

If applicable, use pre-trained models or hierarchical classification to share information across related categories, helping rare classes benefit from common patterns.

5. Evaluate and Iterate

Select appropriate metrics (e.g., macro-F1, per-class recall) and validate with cross-validation. Iterate on the combination of techniques based on business impact and trade-offs.

Key Points to Mention

  • Class imbalance challenges: bias towards majority classes, poor generalization on rare categories.
  • Resampling techniques: oversampling (SMOTE, ADASYN) and undersampling, with pros and cons.
  • Cost-sensitive learning: assigning class weights or using focal loss to penalize rare class errors.
  • Evaluation metrics: accuracy paradox, use macro-F1, per-class recall, precision-recall curves.
  • Ensemble methods: balanced bagging, random forests with class weights.
  • Business context: aligning with Shopify's taxonomy needs, such as minimizing false negatives for rare but important categories.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Walk through the feature pipeline for this system, covering both text and image inputs.

System DesignData Modeling
Author's notes

Pretty standard multimodal stuff.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's purpose and scale, then walk through the pipeline end-to-end for both modalities, highlighting where they converge and diverge. Emphasize data validation, feature extraction, storage, and serving, and discuss trade-offs and monitoring at each stage.

Pro tip: Tie each pipeline stage to business impact (e.g., how feature freshness affects product ranking) and mention how you'd monitor and debug issues in production.

1. Clarify Requirements and Scope

Ask about the system's goal, expected scale, latency requirements, and how text and image features are used (e.g., search, recommendations). Confirm whether the pipeline is batch, streaming, or both.

2. Data Ingestion and Validation

Describe how raw text and images are ingested from sources (e.g., product listings, user uploads). Explain validation steps like format checks, size limits, and deduplication.

3. Feature Extraction and Transformation

Detail modality-specific processing: for text, tokenization, embedding, or TF-IDF; for images, resizing, normalization, and CNN or vision transformer embeddings. Mention any shared preprocessing like normalization.

4. Feature Storage and Versioning

Explain where features are stored (e.g., feature store, data lake) and how versioning, backfilling, and consistency between training and serving are handled.

5. Serving and Monitoring

Describe how features are served online (low-latency lookup) and offline (batch), and how you monitor drift, latency, and quality, with feedback loops for retraining.

Key Points to Mention

  • Handling modality-specific challenges: text (variable length, vocabulary) and images (resolution, color channels)
  • Feature store for consistency and reuse across models
  • Batch vs. online processing and latency considerations
  • Data validation and quality checks to prevent training-serving skew
  • Scalability and cost trade-offs (e.g., embedding computation, storage)
  • Monitoring and drift detection for both text and image features

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

Describe the streaming architecture connecting ingestion to model inference to storage.

System DesignTechnical Trade-offs
Author's notes

Kafka for ingestion, a feature service that enriches and transforms, model service that runs inference, then writes to a store.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the business context and requirements (e.g., real-time vs batch, latency, scale) before diving into the architecture. Then walk through the end-to-end flow from ingestion to inference to storage, highlighting key components, data transformations, and trade-offs at each stage. Finally, discuss how you would monitor, scale, and evolve the system.

Pro tip: Emphasize how your design choices directly impact model performance and business metrics, such as feature freshness and prediction latency, and be ready to justify trade-offs with concrete examples from your experience.

1. Clarify Requirements and Constraints

Ask about data volume, velocity, variety, latency requirements, and consistency needs. Understand the use case (e.g., real-time recommendations, fraud detection) to tailor the architecture.

2. Design the Ingestion Layer

Describe how data enters the system: sources (clickstream, transactions, logs), ingestion tools (Kafka, Kinesis, Pub/Sub), and initial processing (validation, enrichment, deduplication).

3. Outline the Inference Layer

Explain how features are computed and served to models: stream processing (Flink, Spark Streaming) for real-time features, feature stores for consistency, and model serving (TensorFlow Serving, TorchServe) with low-latency endpoints.

4. Detail the Storage Layer

Cover where data is stored for different purposes: online stores (Redis, DynamoDB) for low-latency feature retrieval, offline stores (S3, HDFS) for training, and data lakes/warehouses for analytics and compliance.

5. Address Monitoring, Scaling, and Trade-offs

Discuss how to monitor data quality, model drift, and system health; scale components horizontally; and handle trade-offs like latency vs cost, consistency vs availability.

Key Points to Mention

  • Event-driven architecture with message queues (e.g., Kafka) for decoupling and backpressure handling.
  • Stream processing for real-time feature engineering and the role of a feature store to ensure training-serving consistency.
  • Model serving considerations: batch vs real-time inference, model versioning, A/B testing, and canary deployments.
  • Storage tiering: hot storage (online feature store) vs cold storage (data lake) and data retention policies.
  • Exactly-once semantics, idempotency, and data quality checks to prevent garbage-in-garbage-out.
  • Monitoring and observability: tracking data drift, model performance, and system metrics with tools like Prometheus, Grafana, and custom dashboards.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

How would you set up online evaluation and drift monitoring, and what's your retraining strategy when the taxonomy itself changes rather than just the data distribution?

A/B Testing & ExperimentationSystem DesignAdaptability & Ambiguity
Author's notes

The taxonomy-change angle is what makes this hard and I didn't fully nail it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by outlining a layered monitoring system that tracks both data drift and model performance, then address taxonomy changes as a distinct challenge requiring versioned models and a human-in-the-loop retraining pipeline. Emphasize the need for a feedback loop that captures new labels and adapts the model incrementally, while maintaining backward compatibility and clear rollback strategies.

Pro tip: Frame taxonomy changes as a product evolution problem, not just a technical one—propose a staged rollout with shadow deployment and A/B tests to measure impact on business metrics before full migration.

1. Establish baseline monitoring

Set up dashboards for data drift (e.g., PSI, KL divergence) and model performance (e.g., accuracy, F1) with alerting thresholds. Include prediction distribution and feature importance shifts.

2. Detect and classify drift

Differentiate between data drift (input distribution changes) and concept drift (relationship between inputs and labels changes). Use statistical tests and windowed comparisons to trigger alerts.

3. Handle taxonomy changes

Version the taxonomy and model together. When taxonomy changes, treat it as a new task: map old labels to new ones where possible, and collect new labeled data for the changed classes.

4. Design retraining pipeline

Automate retraining with a mix of old and new data, using techniques like continual learning or transfer learning. Include human review for ambiguous cases and a staging environment for validation.

5. Deploy and validate

Roll out new models via shadow deployment or canary release, monitor business metrics (e.g., conversion, CTR), and have a rollback plan. Use A/B tests to compare old vs. new taxonomy performance.

Key Points to Mention

  • Data drift metrics (PSI, KL divergence) and concept drift detection
  • Taxonomy versioning and label mapping strategies
  • Human-in-the-loop for labeling and validation
  • Continual learning or transfer learning for retraining
  • Shadow deployment and A/B testing for safe rollout
  • Feedback loops from production to training data

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.