Zoox Software Engineer Interview Questions
7+ questions from real Zoox Software Engineer interviews, reported by candidates.
Round Types
Top Topics
Questions
After how many days I should accept that I am rejected
I recently finished a coding interview at Zoox and was curious about others’ experiences. If you’ve been through one ..How long did it take to hear back after the coding round?
## Problem Design a cost estimation engine for a platform that offers multiple services (e.g., compute, storage, network). Each service has its own pricing rules. The engine must support adding new service types without modifying existing code. ```python from abc import ABC, abstractmethod class ServicePricer(ABC): @abstractmethod def estimate(self, usage: dict) -> float: pass class ComputePricer(ServicePricer): # $0.05/hour per vCPU, $0.01/GB-hour RAM def estimate(self, usage: dict) -> float: # usage: {"vcpus": int, "ram_gb": float, "hours": float} pass class StoragePricer(ServicePricer): # $0.023/GB-month def estimate(self, usage: dict) -> float: pass class CostEstimator: def add_service(self, name: str, pricer: ServicePricer) -> None: ... def total_cost(self, usages: dict[str, dict]) -> float: ... ``` ``` ce = CostEstimator() ce.add_service("compute", ComputePricer()) ce.add_service("storage", StoragePricer()) ce.total_cost({"compute": {"vcpus":4,"ram_gb":16,"hours":720}, "storage": {"gb":100}}) -> (4*0.05 + 16*0.01)*720 + 100*0.023 = ... ``` ## Follow-ups 1. Which design pattern does this use, and why is it appropriate here? 2. How would you add tiered pricing (first 100 GB at rate A, next at rate B) cleanly? 3. How do you handle currency conversion if services are priced in different currencies? 4. How would you add a discount system without modifying the `ServicePricer` interface?
## Problem You are given a list of variable definitions of the form `"name = expr"` where `expr` is an arithmetic expression involving integer literals, `+`, `-`, `*`, `/`, parentheses, and previously defined variable names. Evaluate each definition in order and return the final value of a queried variable. ```python def evaluate_formula(definitions: list[str], query: str) -> float: """ definitions: ["x = 3", "y = x + 2", "z = (x * y) - 1"] query: "z" """ pass ``` ``` Input: definitions = ["a = 4", "b = a * 2", "c = (a + b) / 3"] query = "c" Output: 4.0 # a=4, b=8, c=(4+8)/3=4.0 Input: definitions = ["n = 10", "m = n - 3", "r = m * m"] query = "r" Output: 49.0 ``` ## Follow-ups 1. How would you build a recursive descent parser for arithmetic expressions with operator precedence? 2. What data structure holds the evaluated variable context during parsing? 3. How do you detect and report undefined variable references? 4. Extend to support built-in functions like `sqrt(x)` and `abs(x)` in expressions.
## Problem Compute the H-index of a researcher given an array of citation counts. ## Likely LeetCode equivalent LeetCode 274 - H-Index ## Tags coding, sorting, math, onsite
## Problem Design a `LaneController` for a highway with `n` lanes. Vehicles enter and exit lanes. Each lane has a capacity. Support queries for the lane with the most available space, merging two adjacent lanes, and reporting congestion alerts when any lane exceeds 80% capacity. ```python class LaneController: def __init__(self, n: int, capacity_per_lane: int): ... def vehicle_enter(self, lane: int) -> bool: """Add vehicle to lane. Return False if at capacity.""" ... def vehicle_exit(self, lane: int) -> bool: """Remove vehicle from lane. Return False if lane is empty.""" ... def most_available_lane(self) -> int: """Return lane index with the most free space.""" ... def merge_lanes(self, lane_a: int, lane_b: int) -> None: """Merge two adjacent lanes into one with combined capacity.""" ... def get_congestion_alerts(self) -> list[int]: """Return list of lane indices exceeding 80% capacity.""" ... ``` ``` lc = LaneController(3, 10) lc.vehicle_enter(0) # 7 times lc.get_congestion_alerts() -> [0] # 7/10 = 70%? No, 8/10=80% triggers. ``` ## Follow-ups 1. How does a priority queue help with `most_available_lane` if lanes update frequently? 2. How do you handle `merge_lanes` when vehicles must be redistributed? 3. How would you make this thread-safe for concurrent highway simulations? 4. Extend to support per-vehicle-type restrictions (e.g., lane 0 for trucks only).
## Problem You are given a list of `2n` players each with a skill rating. Split them into two teams of exactly `n` players such that the absolute difference in total skill between the two teams is minimized. Return the minimum possible difference. ```python def min_team_difference(ratings: list[int]) -> int: """len(ratings) is always even. Return min |sum(team1) - sum(team2)|.""" pass ``` ``` Input: ratings = [3, 1, 4, 2] Output: 0 # Team1=[3,2]=5, Team2=[1,4]=5 -> diff=0 Input: ratings = [1, 2, 3, 4, 5, 6] Output: 1 # Total=21, need each team close to 10.5 # Team1=[1,4,6]=11, Team2=[2,3,5]=10 -> diff=1 Input: ratings = [10, 1, 1, 1] Output: 7 # Team1=[10,1]=11, Team2=[1,1]=2 -> diff=9 # Team1=[1,1]=2, Team2=[10,1]=11 -> diff=9 # Optimal: same. ``` ## Follow-ups 1. Is this NP-hard in general? What constraint makes a DP solution tractable here? 2. Describe the DP state and transition for solving this exactly. 3. If teams don't have to be equal size, how does the problem simplify or change? 4. Extend: each player has two attributes (skill, cost) and you want to minimize skill difference subject to total cost <= budget.
## Problem Design the core class structure for a turn-based RPG battle system. Characters take turns attacking, using abilities, or defending. Each ability has a cooldown. A character is defeated when HP drops to 0. ```python class Character: def __init__(self, name: str, hp: int, attack: int, defense: int): ... def take_damage(self, amount: int) -> int: """Return actual damage after defense.""" def is_alive(self) -> bool: ... def use_ability(self, ability_name: str, target: 'Character') -> str: ... class Ability: def __init__(self, name: str, damage: int, cooldown: int): ... def is_ready(self) -> bool: ... def activate(self) -> None: ... def tick(self) -> None: """Called each turn to reduce cooldown.""" class BattleSystem: def __init__(self, team1: list[Character], team2: list[Character]): ... def next_turn(self) -> str: """Execute one turn, return action log.""" def is_battle_over(self) -> bool: ... def winner(self) -> str | None: ... ``` ``` battle = BattleSystem([warrior], [mage]) while not battle.is_battle_over(): print(battle.next_turn()) print(battle.winner()) ``` ## Follow-ups 1. How would you implement a status effect system (poison, stun) cleanly without modifying the `Character` class? 2. How do you ensure ability cooldowns are tracked correctly across multi-character teams? 3. How would you serialize and restore battle state for a save/load feature? 4. Extend to support items that any character can use on their turn.
See All 7 Zoox Software Engineer Questions
Full question text, answer context, and frequency data for subscribers.
Get Access