Uber software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
Move Through Array You are given an array where each element represents the number of steps you can move from that position. Positive numbers move...
Input: Arrayprices where prices[i] is the price of an item. For each item at index i, find the first item at index j > i such that...Input: Arrayi in an array. From each position, you can jump to: - i + 1 (one step forward) - Any position i + k where k ends in digit...Input: Arraynums (containing positive integers) and queries (each containing a target sum). For each query, return the maximum...Input: Arrayn, in one operation you may replace n with either: - n = n + 2^i, or - n = n - 2^i for any integer i >= 0. Find...Input: Integer(s)arr and an integer k, a subarray is called good if it contains at least k distinct integers. Return the length of the...Input: ArrayO = Robot - E =...Input: ArrayMeeting Reservation System Design a meeting reservation system that manages meeting rooms and schedules. Implement a MeetingReservationSystem...
Unimodal Cost Function Minimum You are given a unimodal cost function f(x) = A * (x - C)^2 + D defined over the interval [lo, hi], where `A >...
Hierarchy Path Finder You are given an org chart represented as a tree. Each node in the tree has a unique integer ID and a display name. You are...
Input: ListWeight Partition Check You are given a list of distinct positive integer weights and a capacity value. Determine whether any subset of the weights...
Input: ListStraight Line Sequence Search You are given an m x n grid of characters and a target sequence string. Determine whether the sequence appears in...
Next Palindrome Number Given a string num representing a positive integer, find and return the smallest palindrome that is strictly greater than...
Nested Arithmetic Expression Evaluator You are given a string expression containing nested calls to two functions: plus(a, b) and minus(a, b)....
[process_name, action, timestamp],...Input: Array of stringsOA [CodeSignal] Prime Jumps A game is played with the following rules: - A player starts at cell 0 with a score of 0. - There is a row of n cells...
def shortest_path(graph: Dict[str, List[Tuple[str, int]]], start: str, end: str) -> Tuple[int, List[str]]:graph = {'A': [('B', 2), ('C', 5)], 'B': [('A', 2), ('C', 1)], 'C': [('A', 5), ('B', 1)]} start = 'A', end = 'C' (3, ['A', 'B', 'C']) graph = {'A': [('B', 4), ('D', 1)], 'B': [('A', 4), ('C', 1)], 'C': [('B', 1), ('D', 3)], 'D': [('A', 1), ('C', 3)]} start = 'A', end = 'C' (5, ['A', 'D', 'C']) 1 ≤ |graph| ≤ 1000 (number of locations) 1 ≤ time ≤ 10^40 represents a free cell and 1 represents a blocked cell. You need to find the shortest path from the top-left corner (0, 0) to the bottom-right corner (n-1, m-1). If there is no possible path, return -1.def shortest_path(grid: List[List[int]]) -> int:[[0, 0, 0], [0, 1, 0], [0, 0, 0]] 4 [[0, 1], [1, 0]] -1 1 <= grid.length, grid[i].length <= 100 0 or 1 (where 1 is a blocked cell).m x n grid, you start at the top-left corner and can only move either down or right at any point in time. Your task is to find how many unique paths there are to reach the bottom-right corner. Implement a function named uniquePaths that takes two integers, m and n, and returns the number of unique paths.def uniquePaths(m: int, n: int) -> int: m = 3, n = 7 28 m = 3, n = 2 3 1 <= m, n <= 100 n x m grid, where cells can either be open (0) or blocked (1), determine the shortest path from the top-left corner (0, 0) to the bottom-right corner (n-1, m-1). Return the length of the path, if it exists, or -1 if there is no valid path.def shortest_path(grid: List[List[int]]) -> int:[[0, 0, 0], [0, 1, 0], [0, 0, 0]] 4 (0,0) → (0,1) → (0,2) → (1,2) → (2,2).[[0, 1], [1, 0]] -1 1 <= n, m <= 100grid[i][j] is either 0 or 1. grid[0][0] and grid[n-1][m-1] are guaranteed to be 0.n x m grid where 0 represents an open cell and 1 represents a blocked cell, write a function that finds the shortest path from the top-left corner (0, 0) to the bottom-right corner (n-1, m-1). You can only move right, down, left, or up. If there is no valid path, return -1.def shortest_path(grid: List[List[int]]) -> int:[[0,0,0],[0,1,0],[0,0,0]] 4 (0,0) -> (0,1) -> (0,2) -> (1,2) -> (2,2). [[0,1,0],[1,1,0],[0,0,0]] 5 1 <= n, m <= 100 0 or 1.grid of size m x n, where empty cells are represented by 0 and obstacles are represented by 1, you need to implement an algorithm to find the shortest path from the top-left corner (0, 0) to the bottom-right corner (m-1, n-1). The path can only move down or right. Your task is to return the length of the shortest path or -1 if no such path exists.def shortest_path(grid: List[List[int]]) -> int:[[0,0,0],[0,1,0],[0,0,0]]4 [[0,1,0],[0,1,0],[0,0,0]]-1 1 <= m, n <= 100grid[i][j] is either 0 (empty) or 1 (obstacle).def shortest_path(graph: Dict[str, List[Tuple[str, int]]], start: str, end: str) -> Tuple[int, List[str]]: graph = { 'A': [('B', 5), ('C', 10)], 'B': [('D', 2)], 'C': [('D', 1)], 'D': [] } start = 'A' end = 'D' (7, ['A', 'B', 'D']) graph = { 'A': [('B', 1),('C', 5)], 'B': [('C', 2), ('D', 4)], 'C': [('D', 1)], 'D': [] } start = 'A' end = 'D' (5, ['A', 'B', 'C', 'D']) Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free