Uber Software Engineer Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Improve robustness of graph cycle detection code
You have written code to detect cycles in a directed dependency graph of services, where nodes represent services and edges represent dependencies bet...
Detect cycle in directed dependency graph
You are given a directed dependency graph representing services in a system. - There are n services, labeled from 0 to n - 1. - You are given a list o...
Design a ride-hailing platform like Uber
You are asked to design a large-scale ride-hailing platform similar to Uber. Requirements Functional requirements - Riders can: - Sign up, log in, a...
Check feasibility of AI course schedule
You are designing a learning path for n AI-related courses, labeled from 0 to n - 1. Some courses have prerequisites. For example, to take course b, y...
Maximize stock profit with one or two trades
You are given an array prices where prices[i] is the price of a given stock on day i (0-indexed). You want to maximize your profit by choosing when to...
Design an object-oriented parking lot system
Design an object-oriented model for a parking lot management system. Requirements: - The parking lot has multiple levels; each level has multiple park...
Compute outer boundary of an N-ary tree
You are given the root of a rooted N-ary tree. Each node contains: - An integer value. - An ordered list of children from left to right (0 or more chi...
Solve three algorithmic optimization and search problems
You are given three independent coding problems. --- Problem 1: Allocate tasks between two workers to maximize reward You have n independent tasks tha...
Implement 2D word search variants and analyze complexity
Given an m x n grid of uppercase letters board and a string word, implement two related functions: ( 1) Fixed-direction search: Return true if word ap...
Prioritize rooms for allocation
System Design: Room Allocation and Ranking Service Context and assumptions: - The client sends a meeting request with: (a) time window or fixed start/...
Find next and closest palindromes
Given a non-negative integer represented as a string n (no leading zeros unless n == "0"), return the smallest palindromic integer strictly greater th...
Simulate views on an n-ary tree
Given a rooted, ordered n-ary tree (each node has a value and an ordered list of children), simulate an observer who starts at the bottom-left, moves ...
Design real-time driver heatmap
Design a Real-Time Driver Heatmap (500k events/sec) You are designing a real-time heatmap service for a ride‑hailing app. Mobile clients send frequent...
Compare Paxos and Raft
Consensus over a Replicated Log: Paxos vs. Raft Context You are designing a fault-tolerant replicated log to back a stateful service (e.g., a key-valu...
Develop test plan and TDD for word search
Design a Comprehensive Test Plan and TDD Workflow for Word-Search Functions Context and Assumptions We are testing two grid-based word search function...
Implement binary search variants
Implement binary search on a sorted integer array without using library functions. Provide both iterative and recursive versions that: (a) return the ...
Find earliest common slot
Given calendars for N attendees, each as a sorted list of non-overlapping, closed-open intervals [start, end) in minutes since epoch, and a required m...
Simulate fixed-shape tiling on a grid
You are given an empty n-by-m grid and a list of tile patterns, patterns[0..k-1]. Each pattern is a binary matrix (1 = filled cell, 0 = hole) and must...
Find leftmost point of maximum brightness
You are given an array of lights, where each light is [p, r] representing a lamp centered at coordinate p on the real number line with radius r, illum...
Design top-K frequency structure
Design an in-memory data structure that supports: add(x) to observe an item, inc(x) to increment its frequency, dec(x) to decrement (deleting when zer...