Shopify

Shopify Software Engineer Interview Questions

12+ questions from real Shopify Software Engineer interviews, reported by candidates.

12
Questions
3
Round Types
4
Topic Areas
2021-2026
Year Range

Round Types

System Design 1 Phone Screen 1 Onsite 1

Top Topics

Questions

**Question:** Implement a NUMBER guessing game. The user must guess a 4-digit number (without repeats). The user has 7 attempts. Every attempted guess must be a 4-digit number. They either: wins (gues

Hi everyone! I\'m gearing up for upcoming interviews at Dropbox and Shopify and would love to gather some insights from those who\'ve recently interviewed there. For Dropbox, I\'m preparing for...

So I got a technical interview (pair programming) for shopify SDE intern, and the email said that it is going to be a **Systems Design problem.** I have never given a systems design interview and I am

I passed the phone screen which was an easy question of having prices of items and discount strategies (e.g. apple buy one get one free, orange buy two get one...

I recently got an invitation for Shopify's 45-minute pair programming interview for their summer 2026 internship program, where interviewees take on a "real world challenge around object-oriented prog

## Problem Implement an `AccountManager` that handles user accounts with roles (`admin`, `member`, `guest`). Each role has different capabilities. The system must support: ```python class AccountManager: def create_account(self, username: str, role: str) -> str: # returns account_id def deactivate(self, account_id: str) -> bool: def change_role(self, requester_id: str, target_id: str, new_role: str) -> bool: def get_capabilities(self, account_id: str) -> list[str]: def audit_log(self) -> list[dict]: # returns all actions taken ``` Only `admin` accounts can change roles. Deactivated accounts cannot perform any actions. All state changes are logged. ## Example ``` am = AccountManager() admin_id = am.create_account("alice", "admin") member_id = am.create_account("bob", "member") am.change_role(member_id, admin_id, "guest") -> False # bob can't change roles am.change_role(admin_id, member_id, "admin") -> True am.deactivate(member_id) am.change_role(member_id, admin_id, "guest") -> False # deactivated ``` ## Follow-ups 1. How do you prevent privilege escalation bugs when adding new roles? 2. What test cases would you write to ensure role change authorization is correct? 3. How would you extend this to support time-limited role grants?

## Problem Design a car rental system supporting multiple vehicle types, locations, and concurrent reservations. Implement: ```python class CarRentalSystem: def add_vehicle(self, vehicle_id: str, type: str, location: str, rate_per_day: float) -> None: def search_available(self, location: str, start: date, end: date, type: str = None) -> list[str]: def reserve(self, user_id: str, vehicle_id: str, start: date, end: date) -> str: # reservation_id def cancel(self, reservation_id: str) -> bool: def get_bill(self, reservation_id: str) -> float: ``` A vehicle cannot be double-booked. `search_available` must return vehicles with no overlapping reservations. ## Example ``` system.add_vehicle("CAR-1", "sedan", "NYC", 50.0) system.reserve("alice", "CAR-1", date(2025,6,1), date(2025,6,5)) system.search_available("NYC", date(2025,6,3), date(2025,6,6), "sedan") # -> [] (CAR-1 overlaps: Jun 1-5 overlaps Jun 3-6) system.get_bill(reservation_id) # -> 200.0 (4 days * $50/day) ``` ## Follow-ups 1. How do you handle concurrent `reserve` calls for the same vehicle? 2. How would you model late returns and additional charges? 3. Sketch the database schema. How do you index reservations for fast availability search?

## Problem Given four single-digit integers, insert `+`, `-`, `*`, `/` between them (in any order, using each digit exactly once) to reach a target value. Return all distinct valid expressions. You may also use parentheses to change evaluation order. ```python def four_digits( digits: list[int], # exactly 4 digits target: int ) -> list[str]: # list of valid expression strings pass ``` ## Example ``` Input: digits=[1, 2, 3, 4], target=24 Sample valid outputs: "1 * 2 * 3 * 4" -> 24 "(1 + 2 + 3) * 4" -> 24 "(2 + 3 - 1) * 4" -> 16 (invalid) Output: ["1 * 2 * 3 * 4", "(1 + 2 + 3) * 4", ...] ``` ## Follow-ups 1. How many distinct expression trees are possible with 4 operands and 4 operators? Enumerate the cases. 2. How do you handle division by zero safely? 3. For which sets of 4 digits is it impossible to reach 24? 4. How does complexity scale if extended to `n` digits?

## Problem Implement a number guessing game with binary search or feedback-based narrowing of the answer range. ## Likely LeetCode equivalent Similar to Guess Number Higher or Lower (LC 374). ## Tags binary_search, shopify, pair_programming

## Problem Implement an inventory management system for a warehouse. It must track stock levels, process orders (reducing stock), accept restocks, and trigger automatic reorder alerts when stock falls below a threshold. ```python class InventorySystem: def add_product(self, sku: str, quantity: int, reorder_point: int, reorder_qty: int) -> None: def fulfill_order(self, sku: str, quantity: int) -> bool: # False if insufficient stock def restock(self, sku: str, quantity: int) -> None: def get_alerts(self) -> list[str]: # SKUs below reorder_point def inventory_snapshot(self) -> dict[str, int]: # sku -> current quantity ``` ## Example ``` inv.add_product("SKU-A", quantity=100, reorder_point=20, reorder_qty=50) inv.fulfill_order("SKU-A", 85) -> True (stock: 15) inv.get_alerts() -> ["SKU-A"] # 15 < 20 inv.restock("SKU-A", 50) # stock: 65 inv.get_alerts() -> [] # 65 >= 20 ``` ## Follow-ups 1. How would you handle concurrent fulfill_order calls for the same SKU? 2. Add support for batch orders across multiple SKUs — atomically succeed or fail all. 3. How would you design the database schema for this, with full order history?

## Problem A robot starts at position `(0, 0)` facing North on an infinite grid. You are given a string of commands and must parse and execute them: - `F` — move forward one step - `B` — move backward one step - `L` / `R` — rotate 90 degrees left/right - `REP n { ... }` — repeat the enclosed commands `n` times Return the robot's final `(x, y)` position and facing direction. ```python def run_robot(commands: str) -> tuple[int, int, str]: pass ``` ## Example ``` Input: "REP 3 { F R } F" Steps: Iteration 1: F -> (0,1) N; R -> facing E Iteration 2: F -> (1,1) E; R -> facing S Iteration 3: F -> (1,0) S; R -> facing W Final F -> (0,0) W Output: (0, 0, "W") ``` ## Follow-ups 1. How would you implement this using a recursive descent parser vs. a stack-based approach? 2. Add a `JUMP label` / `LABEL name` instruction — how does this change your execution model? 3. How do you detect and handle infinite loops in commands?

## Problem You have `n` items with sizes and `k` bins each with a fixed capacity. Assign each item to exactly one bin such that no bin exceeds its capacity, and the number of bins used is minimized. Items cannot be split. ```python def size_match( items: list[int], # sizes of items bin_capacity: int ) -> list[list[int]]: # each inner list = item indices in that bin pass ``` ## Example ``` Input: items=[4, 3, 5, 2, 6], bin_capacity=8 First-Fit Decreasing: Sorted: [6, 5, 4, 3, 2] Bin 1: [6, 2] (sum=8) Bin 2: [5, 3] (sum=8) Bin 3: [4] (sum=4) Output: [[4, 1], [2, 3], [0]] # indices # 3 bins used ``` ## Follow-ups 1. First-Fit Decreasing gives at most (11/9)OPT + 6/9 bins — can you prove why? 2. How do you solve this exactly using dynamic programming or ILP for small inputs? 3. How does the problem change if bins have both weight and volume constraints?

See All 12 Shopify Software Engineer Questions

Full question text, answer context, and frequency data for subscribers.

Get Access