Uber Software Engineer Interview Questions
Practice the exact questions companies are asking right now.
Find cheapest flight with at most K stops
Problem You are given a directed weighted graph representing flights between cities. Inputs - An integer n: number of cities, labeled 0..n-1. - A list...
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...
Compute exclusive execution time from logs
Problem You are given execution logs from a single-threaded CPU that runs n functions labeled 0..n-1. The CPU can run only one function at a time. A f...
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...
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...
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 Uber Eats-style search function
Design the search function for a large-scale food delivery platform similar to Uber Eats. A user opens the app and types queries such as: - Restaurant...
Implement three interview-style coding tasks
You are given three separate coding tasks, all focused on algorithm and data-structure design. --- Task 1: Longest Bounded-Difference Subarray You are...
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...
Minimize time using elevator then climb stairs
Problem You need to go up n floors (from floor 0 to floor n). You may: 1. Take the elevator first (at most once, only at the start) for k floors, wher...
Print directory tree with indentation
You are given a root directory of a filesystem represented as a tree. Each node is either a directory (can have children) or a file (no children). Pri...
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...
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...
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...
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...
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 ...
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...