← Shopify Interview Insights

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

SeniorPrefer not to say
Jun 2026Remote

Summary

Shopify ML Engineer system design round, one big open-ended question about building a product classification system from scratch. Pretty grueling given how many angles they expected you to cover in a single session.

Questions Asked (4)

Q1

Design an ML system that classifies products into a hierarchical category taxonomy (e.g., Electronics > Phones > Smartphones), supporting both real-time inference for new listings and batch re-classification of an existing catalog.

System DesignTechnical Trade-offsData Modeling
Author's notes

This question has a lot of surface area and I underestimated how deep they wanted to go on the bootstrapping piece.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then propose a two-path architecture: a low-latency service for real-time inference and a batch pipeline for catalog re-classification. Focus on the hierarchical nature of the taxonomy, discussing how to model it (e.g., flat vs. hierarchical classification) and the trade-offs between accuracy, latency, and cost.

Pro tip: Emphasize the importance of handling taxonomy changes gracefully—design for versioned models and taxonomies, and consider a human-in-the-loop fallback for low-confidence predictions to maintain catalog quality.

1. Clarify Requirements and Constraints

Ask about scale (number of products, categories, depth of hierarchy), latency requirements for real-time, throughput for batch, and accuracy targets. Also discuss how often the taxonomy changes and the cost of misclassification.

2. Design Data and Model Architecture

Propose a hierarchical classification approach, such as using a sequence of classifiers (one per level) or a single model with a hierarchical loss. Discuss feature engineering from product titles, descriptions, images, and metadata. Consider using embeddings and a two-tower model for efficient retrieval of candidate categories.

3. Design Real-Time Inference Service

Outline a low-latency service that takes product data, computes features, and runs the model to predict a category path. Discuss caching, model serving (e.g., TensorFlow Serving, TorchServe), and fallback strategies for low confidence.

4. Design Batch Re-classification Pipeline

Describe a scalable batch pipeline (e.g., using Spark or Beam) that processes the entire catalog periodically or on-demand. Include steps for data ingestion, feature extraction, model inference, and writing results back to the catalog.

5. Address Monitoring, Feedback, and Iteration

Discuss how to monitor model performance (e.g., accuracy, latency, drift), collect feedback (e.g., from human corrections), and retrain models. Also cover A/B testing and gradual rollout of new models.

Key Points to Mention

  • Hierarchical classification strategies: flat vs. hierarchical, local vs. global classifiers, and handling of partial paths.
  • Feature engineering: text (title, description), images, and structured metadata; use of pre-trained embeddings (e.g., BERT, ResNet).
  • Trade-offs between real-time and batch: latency vs. throughput, model complexity, and cost.
  • Scalability: distributed inference for batch, caching and model optimization for real-time.
  • Handling taxonomy changes: versioning, model retraining, and backward compatibility.
  • Evaluation metrics: hierarchical precision/recall, top-k accuracy, and business impact (e.g., conversion rate).

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

Q2

How would you handle adding new categories to the taxonomy after the model is already deployed?

Technical Trade-offsSystem DesignAdaptability & Ambiguity
Author's notes

Came up as a follow-up but felt like a core part of what they were evaluating.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging that adding new categories post-deployment is a common challenge in production ML, then outline a structured approach that balances model performance, system reliability, and business needs. Emphasize the trade-offs between retraining frequency, latency, and accuracy, and propose a solution that includes monitoring, fallback mechanisms, and a feedback loop.

Pro tip: Mention the importance of a human-in-the-loop or active learning pipeline to collect and label new category data efficiently, and highlight how you would measure the impact of new categories on existing ones to avoid regressions.

1. Detect the need for new categories

Monitor model predictions and user feedback to identify when new categories emerge or when existing categories are insufficient. Use metrics like low confidence scores, high error rates, or explicit user requests.

2. Assess impact and define success criteria

Evaluate how adding new categories might affect existing categories and overall system performance. Define clear success metrics such as precision, recall, and business KPIs like conversion rate.

3. Choose an adaptation strategy

Decide between retraining the model from scratch, fine-tuning on new data, or using a modular approach (e.g., adding a new classifier for the new category). Consider trade-offs in latency, cost, and complexity.

4. Implement and deploy with safeguards

Roll out the updated model gradually (e.g., canary deployment) with fallback to the previous version if performance degrades. Ensure the system can handle new categories without disrupting existing ones.

5. Monitor and iterate

Continuously monitor performance of new and existing categories, collect feedback, and set up a pipeline for regular updates. Use A/B testing to validate improvements.

Key Points to Mention

  • Trade-offs between retraining frequency and model freshness vs. computational cost and latency.
  • Handling class imbalance and few-shot learning for new categories with limited data.
  • Backward compatibility: ensuring new categories don't degrade performance on existing ones.
  • Use of active learning and human-in-the-loop to efficiently label new category data.
  • Deployment strategies like canary releases and shadow mode to mitigate risks.
  • Monitoring and alerting for data drift and concept drift to trigger updates.

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

Q3

Walk through your approach to evaluation: what metrics would you track at each level of the hierarchy, and how would you detect and respond to drift over time?

Product Analytics & MetricsA/B Testing & ExperimentationSystem Design
Author's notes

I defaulted to accuracy and F1 pretty quickly and they pushed back asking about calibration specifically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer around a three-tier evaluation hierarchy: offline metrics, online metrics, and business metrics. For each tier, specify the key metrics you would track, and then explain how you would monitor for drift using statistical tests and automated alerts, with a clear response plan.

Pro tip: Emphasize that drift detection should be proactive, not reactive—set up automated alerts and have a playbook for retraining or rollback. Also, tie metrics to Shopify's business goals like GMV and merchant success to show product sense.

1. Define the evaluation hierarchy

Outline three levels: offline (model performance), online (system and user behavior), and business (company KPIs). Explain why each level matters and how they connect.

2. Select metrics per level

For offline: precision, recall, AUC, RMSE, etc. For online: latency, throughput, CTR, conversion rate, user engagement. For business: GMV, revenue, merchant retention, customer satisfaction.

3. Monitor for drift

Describe techniques: statistical tests (KS, PSI), monitoring feature distributions, prediction distributions, and performance metrics over time. Set thresholds and alerts.

4. Respond to drift

Outline a response plan: investigate root cause, retrain model, update features, or rollback. Include A/B testing to validate fixes and communication with stakeholders.

5. Iterate and improve

Emphasize continuous improvement: regularly review metrics, update drift detection thresholds, and incorporate feedback from online experiments.

Key Points to Mention

  • Offline metrics: precision, recall, F1, AUC, RMSE, MAE
  • Online metrics: latency, throughput, error rate, CTR, conversion rate, engagement
  • Business metrics: GMV, revenue, merchant retention, NPS
  • Drift detection: data drift, concept drift, statistical tests (KS, PSI), monitoring dashboards
  • Response strategies: retraining, feature updates, rollback, A/B testing
  • Automation: alerts, CI/CD for models, playbooks

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

Q4

How would you design the serving infrastructure to meet sub-200ms p99 latency for real-time requests while also supporting high-throughput batch jobs?

System DesignTechnical Trade-offs
Author's notes

Felt more like a systems question than ML.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: what is the expected request rate, batch job size, and data freshness? Then propose a hybrid architecture that separates real-time serving (using optimized models, caching, and autoscaling) from batch processing (using distributed frameworks like Spark or Ray), while sharing a common feature store and model registry. Finally, discuss trade-offs and how you would monitor and iterate to meet the latency and throughput goals.

Pro tip: Emphasize the importance of a feature store to ensure consistency between training and serving, and mention that you would use canary deployments and A/B testing to safely roll out changes without impacting p99 latency.

1. Clarify requirements and constraints

Ask about expected QPS, batch job frequency and size, data freshness requirements, and hardware budget. This ensures your design is grounded in actual needs.

2. Design real-time serving path

Propose a low-latency serving stack: model optimization (quantization, pruning), caching, load balancing, and autoscaling. Use a fast inference server like NVIDIA Triton or TensorFlow Serving.

3. Design batch processing path

Outline a scalable batch system using distributed processing (e.g., Spark, Ray) that can run on spot instances and write results to a store for serving. Ensure it doesn't interfere with real-time traffic.

4. Integrate with shared components

Describe how both paths share a feature store (e.g., Feast, Tecton) and model registry to maintain consistency and reduce duplication. Highlight data versioning and lineage.

5. Address trade-offs and monitoring

Discuss trade-offs like cost vs. latency, consistency vs. availability, and how you would monitor p99 latency, throughput, and model drift. Mention canary deployments and rollback strategies.

Key Points to Mention

  • Separation of concerns: real-time serving vs. batch processing with shared feature store
  • Model optimization techniques: quantization, pruning, distillation, and hardware acceleration (GPU/TPU)
  • Caching strategies: feature caching, prediction caching, and CDN for static assets
  • Autoscaling and load balancing to handle traffic spikes while maintaining p99 latency
  • Batch processing frameworks: Spark, Ray, or Kubernetes jobs with spot instances for cost efficiency
  • Monitoring and observability: tracking p99 latency, throughput, error rates, and model performance metrics

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