Category: Array coding problem# 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: Array Output: Computed result
codingHardVerified Question#2
2. OA [CodeSignal] Adventure Levels
Category: Array coding problem# OA [CodeSignal] Adventure Levels You start with initial energy K. You need to clear a series of adventure levels. For each level i: -...Input: Array Output: Array
codingHardVerified Question#3
3. OA [CodeSignal] Balanced Numbers in Permutation
Category: Array coding problem# OA [CodeSignal] Balanced Numbers in Permutation Given a permutation p of integers from 1 to n. A number k (where 1 <= k <= n) is called...Input: Array Output: Computed result
codingHardVerified Question#4
4. OA [CodeSignal] Count Palindrome Paths in Tree
Category: Tree coding problemGiven a tree with n nodes where each node has a lowercase English character c[i]. A path is palindromic if the characters along the path can...Input: List Output: Computed result
codingMediumVerified Question#5
5. OA [CodeSignal] Final Prices After Discount
Category: Array coding problemYou are given an array prices 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: Array Output: Computed result
codingMediumVerified Question#6
6. OA [CodeSignal] Jump Game
Category: Array coding problemYou are at position i 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: Array Output: Computed result
codingMediumVerified Question#7
7. OA [CodeSignal] Longest Subsequence With Limited Sum
Category: Array coding problemYou are given two arrays: nums (containing positive integers) and queries (each containing a target sum). For each query, return the maximum...Input: Array Output:** Computed result
codingHardVerified Question#8
8. OA [CodeSignal] Max Throughput With Budget
Category: Algorithm coding problemYou have a pipeline of services. Each service has: - Current throughput throughput[i] - Cost to scale up by 1 unit scalecost[i] You have a fixed...Input: List Output: Integer
codingHardVerified Question#9
9. OA [CodeSignal] Minimum Edge Reversal Root
Category: Graph coding problemGiven a directed graph (represented as a tree with directed edges), choose a root node such that the minimum number of edges must be reversed so that...Input: Graph (nodes and edges) Output: Integer
codingMediumVerified Question#10
10. OA [CodeSignal] Minimum Operation To Reduce n To 0
Category: Algorithm coding problemGiven a positive integer n, 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) Output: Integer
codingHardVerified Question#11
11. OA [CodeSignal] Purchase Optimization
Category: Array coding problemAlex is shopping at Ozone Gallerie Mall where cubicles are arranged in non-decreasing order of prices from left to right. Given: - prices: array of...Input: Array Output: Integer
codingMediumVerified Question#12
12. OA [CodeSignal] Shortest Good Subarray
Category: Array coding problemGiven an array arr and an integer k, a subarray is called good if it contains at least k distinct integers. Return the length of the...Input: Array Output: Integer
codingHardVerified Question#13
13. OA [CodeSignal] Touring the Building
Category: Algorithm coding problemYou are on floor 0 of a building and need to reach floor n. You can use either the lift or stairs. Lift: - Takes t1 time per floor -...Input: Given input Output: Computed result
codingMediumVerified Question#14
14. Robot Map
Category: Array coding problemGiven a location map and a query, find which robot matches the query. Location Map: A 2D array where each cell contains: - O = Robot - E =...Input: Array Output: Computed result
Category: Algorithm coding problemIn the Uber Eats marketplace, the final price of an order is a dynamic calculation involving multiple factors. Design the core classes and interfaces...Input: Given input Output: Computed result
codingMediumVerified Question#16
16. [Object Oriented Design] Meeting Reservation System
Category: Interval-based coding problem# Meeting Reservation System Design a meeting reservation system that manages meeting rooms and schedules. Implement a MeetingReservationSystem...Input: Integer(s) Output: Computed result
codingHardVerified Question#17
17. Capital Gains Tax Calculator
Category: String coding problemYou are given a chronologically sorted list of stock transactions. Each transaction is a list of strings in the format `[<timestamp>, <type>,...Input: Array of strings Output: Computed result
codingMediumVerified Question#18
18. Unimodal Cost Function Minimum
Category: Interval-based coding problem# 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 >...Input: Given input Output: Computed result
codingMediumVerified Question#19
19. Hierarchy Path Finder
Category: Tree coding problem# 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: List Output: Computed result
codingMediumVerified Question#20
20. Weight Partition Check
Category: Algorithm coding problem# Weight Partition Check You are given a list of distinct positive integer weights and a capacity value. Determine whether any subset of the weights...Input: List Output: Computed result
codingMediumVerified Question#21
21. Straight Line Sequence Search
Category: Grid/matrix coding problem# Straight Line Sequence Search You are given an m x n grid of characters and a target sequence string. Determine whether the sequence appears in...Input: 2D grid Output: Computed result
codingHardVerified Question#22
22. Longest Valid Container Nesting
Category: String coding problem# Longest Valid Container Nesting You are given a string consisting only of the characters {, }, [, ], (, ). These represent three levels...Input: String Output: Integer
codingMediumVerified Question#23
23. Next Palindrome Number
Category: String coding problem# Next Palindrome Number Given a string num representing a positive integer, find and return the smallest palindrome that is strictly greater than...Input: String Output: Computed result
codingEasyVerified Question#24
24. Annotate First Pattern Match
Category: String coding problem# Annotate First Pattern Match You are given a string text containing words separated by spaces, and a list of patterns. For each word in text,...Input: List Output: Computed result
codingMediumVerified Question#25
25. Nested Arithmetic Expression Evaluator
Category: String coding problem# Nested Arithmetic Expression Evaluator You are given a string expression containing nested calls to two functions: plus(a, b) and minus(a, b)....Input: String Output: Computed result
codingMediumVerified Question#26
26. Process CPU Time Calculator
Category: Interval-based coding problemYou are given a list of log entries from a single-threaded CPU scheduler. Each entry is a list of three strings: [process_name, action, timestamp],...Input: Array of strings Output: Computed result
codingMediumVerified Question#27
27. OA [CodeSignal] Prime Jumps
Category: Algorithm coding problem# OA [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...Input: Number(s) Output: Computed result
codingHardVerified Question#28
28. Palindrome Paths From Query
Category: Tree coding problem# Palindrome Paths From Query A disk stores hierarchical data in an undirected tree with tree_nodes nodes numbered from 0 to tree_nodes - 1,...Input: Array Output: Computed result
codingHardtwo pointers#1
1. [OA] Two Pointers — Find overlapping ride requests during peak hours
During busy times, Uber may receive overlapping ride requests that affect driver availability. We need to identify these to optimize vehicle distribution. Problem statement: Given two arrays representing the start and end times of ride requests, determine how many requests overlap at any point in time. Method Signature: - countOverlaps(start: number[], end: number[]): number — Returns the total count of overlapping ride requests.Example 1: Input: start = [1, 2, 3], end = [2, 3, 4] Output: 2 Explanation: The requests at indices 0 and 1 overlap.Example 2: Input: start = [1, 10, 5], end = [5, 15, 8] Output: 3 Explanation: All ride requests overlap.Constraints: - 1 <= start.length == end.length <= 1000 - 1 <= start[i] < end[i] <= 10000
codingMediumsliding window#2
2. [OA] Sliding Window — Implement a dynamic pricing calculator for Uber's ride service
Uber dynamically adjusts ride prices based on demand and availability. This requires a system to efficiently keep track of ride request milestones over time to optimize pricing. Problem statement: You need to implement a method that computes the average price over the last k time intervals given an array of ride prices and an integer k. Ensure that the function correctly handles edge cases with array boundaries. Method Signature: - calculateAverage(prices: number[], k: number): number — Returns the average price over the last k ride prices.Example 1: Input: prices = [10, 20, 30, 40, 50], k = 3 Output: 40 Explanation: The last three prices are 30, 40, and 50; their average is 40.Example 2: Input: prices = [5, 15, 25], k = 2 Output: 20 Explanation: The last two prices are 15 and 25; their average is 20.Constraints: - 1 <= prices.length <= 10000 - 1 <= prices[i] <= 1000 - 1 <= k <= prices.length