Uber SDE Off-Campus OA 2023 | Rating Forgiveness & Parallel Fleet Optimization
Uber · Question · Posted Jun 2026
Problem 1 - Rating Forgiveness Problem Statement You are given an integer array ratings representing a driver's ratings history and an integer k. The driver may remove at most k non-5-star ratings. Return the maximum length of a contiguous segment consisting entirely of 5-star ratings after performing at most k removals. Constraints Constraint 1 ≤ ratings.length ≤ 105 1 ≤ ratings[i] ≤ 5 0 ≤ k ≤ ratings.length Test Case Input Output ratings = [5,5,4,5,3,5,5,5,2,5] k = 2 7 ...
The full answer & interview discussion are available to premium members.
Log in Create a free account