CONTENTS

    My Uber HackerRank OA Experience in 2025 and Real Questions

    avatar
    Silvia AN
    ·November 13, 2025
    ·8 min read
    Let me walk you through my uber hackerrank oa experience in 2025 and the tips that made all the difference

    Recently, Uber moved the SDE online assessment from CodeSignal to HackerRank. My OA had three questions in total, and the difficulty was slightly above medium.

    The first question was mostly about basic logic, while the second and third required more optimized algorithms. A brute-force approach would exceed the time limits, so it had to be avoided.

    I am really grateful for the tool Linkjob.ai, and that's also why I'm sharing my entire OA interview experience here. Having an undetectable AI assistant during the interview is indeed very convenient.

    Uber HackerRank OA Questions

    Question 1: Minimum operations to reduce n to 0

    When I first saw the question, my mind went straight to a binary or greedy approach. The idea was to always pick the largest power of two that doesn’t exceed the current value of n, but also check whether it’s better to subtract that power or overshoot by adding the next power and subtracting afterward.

    For example, when n = 5 (binary 101), you can subtract 1 and 4 — two steps.

    For n = 21 (binary 10101), subtracting 1, 4, and 16 also takes three steps.

    My approach looked like this:

    1. Go through powers of two from large to small (starting at 2¹⁹ since n < 2²⁰).

    2. Every time a power is less than or equal to n, subtract it and count one operation.

    3. Stop when n reaches zero; otherwise continue with the next smaller power.

    In essence, this breaks n into a sum of distinct powers of two, so the number of operations equals the number of 1s in its binary form. One corner case is something like n = 3 (binary 11) — you can subtract 4 and add 1, which also takes two steps, just like subtracting 1 and 2 directly.

    Question 2: Total cost after discounts and indices of full-price items

    At first, I considered a simple brute-force approach (for each item, scan to the right for the first price that is less than or equal to it). But with n as large as 1e5, that would time out, so a monotonic stack was necessary.

    The rule is:

    Each item gets a discount equal to the first price on its right that is less than or equal to it. If no such price exists, the item stays full price.

    My approach:

    1. Maintain a monotonic increasing stack while iterating from right to left.

    2. For each price, pop any prices in the stack that are greater, because they can never serve as a “first smaller or equal” element for anything on the left.

    3. The remaining stack top is the discount price (or none if the stack is empty).

    4. Add to the running total and record indices of full-price items when no discount exists.

    This brings the complexity to O(n), which handles n = 1e5 easily.

    Question 3: Determine whether each k in a permutation is “balanced”

    The key idea is to check whether numbers 1 through k appear inside a single continuous subarray. Since the array is a permutation, each number appears exactly once, so having a subarray that contains 1…k is equivalent to:

    the maximum value is k, and the subarray length is k.

    My approach was:

    1. First record the index of every value in the permutation (pos[x] = index of x).

    2. Then iterate k from 1 to n, keeping track of the smallest and largest positions of values 1…k.

    3. If r - l + 1 == k, then there exists a continuous subarray that contains 1…k, so this k is balanced (mark ‘T’); otherwise mark ‘F’.

    For example, with p = [4, 1, 3, 2]:

    • For k = 3, the positions of 1, 2, 3 are 2, 4, 3 → l = 2, r = 4 → r - l + 1 = 3, so it is balanced.

    • For k = 2, positions of 1, 2 are 2, 4 → r - l + 1 = 3 ≠ 2, so it is not balanced.

    This also runs in O(n), good for inputs up to 2e5.

    To be honest, finishing all three questions within the given time was pretty stressful. During the assessment, I used Linkjob AI, which gave me complete solution ideas and code. I ended up combining my own thinking with the AI’s suggestions to solve the problems. I’ve already passed the interview, and the AI usage wasn’t detected at all.

    Uber Hackerrank OA Format

    Number and Types of Questions

    My Uber HackerRank OA included three coding problems, all focused on algorithm design. They mainly covered:

    • Greedy or simulation-style logic problems (such as rule-based numeric operations or scenario-driven calculations)

    • Data structure optimization problems (where techniques like monotonic stacks or hash tables are required to avoid slow solutions)

    • Array and permutation problems (such as checking structural properties based on array characteristics)

    The questions were wrapped in light practical scenarios, like pricing or simple transformations, but the real goal was to test algorithmic reasoning.

    Time Limit and Setup

    Total time: 90 minutes, and everything had to be solved and submitted within that window.

    Per-problem runtime limits: HackerRank enforces strict execution limits for each question, so brute-force solutions will time out. Efficient time complexity is required.

    Environment: It supports all common languages, and the built-in editor lets you write and test your code. After submission, the platform automatically runs the full test suite.

    Difficulty Distribution

    The difficulty of the Uber OA increases gradually:

    • Problem 1: Easy to medium. The logic is fairly straightforward, and once the rules are clear, a greedy or simulation approach works (for example, operations related to binary representation). This mainly tests how well you understand the problem.

    • Problem 2: Medium. It requires proper use of data structures for optimization, such as a monotonic stack or hash map. The key is writing code with good time complexity to pass large test cases.

    • Problem 3: Medium to hard. It usually hides a key insight, such as leveraging uniqueness in permutations to simplify the logic. This one feels more clever and tests reasoning and problem-reduction skills.

    Uber HackerRank OA Common Question Patterns

    Coding Challenges

    Rule-driven greedy or simulation problems

    Problems often provide a set of operation rules. The solution requires understanding the core logic, then applying a greedy strategy or simulating the process. The key is to distill the essence of the operations and avoid redundant calculations.

    Complexity optimization for large datasets

    When input size reaches 1e5 or more, brute-force solutions (O(n²)) will time out. Optimized data structures are needed, such as using a monotonic stack to find the first element on the right meeting a condition, or a hash map to store element positions for O(1) queries. These problems test awareness of time complexity and algorithm efficiency.

    Substructure validation

    Some problems involve arrays or permutations, where it is necessary to check if a subarray meets certain conditions. Hidden patterns can be used to transform complex checks into calculations on ranges or extreme values.

    Real-World Scenarios

    Uber often wraps problems in scenarios resembling business or everyday life. Common examples include:

    • Consumer or transaction scenarios: product pricing, discount calculations, or fee statistics. Algorithms are embedded in shopping or payment flows, and solutions require extracting the core numerical or rule-based problem.

    • Operation or process scenarios: converting numbers or planning task steps. Examples include “how many steps to convert X into Y” or “result after executing rules in a process.” The underlying challenge is to abstract the operation logic.

    These scenarios do not increase problem difficulty but require mapping the scenario description to the algorithm problem quickly.

    Edge Cases

    Uber test cases cover a variety of boundary situations, including:

    1. Extreme input values: smallest input (n=1), largest input (n near 1e5), or fully sorted or unsorted arrays.

    2. No valid solution cases: situations where “if X does not exist, do Y” must be handled, otherwise test cases fail.

    3. Special operation combinations: reaching zero after multiple operations, or subarray length exactly matching a target. Correctness must be verified under these critical conditions.

    Preparation for Uber Hackerrank OA

    Best Resources

    When I started preparing, I looked for resources that matched the style of the uber hackerrank oa. I found LeetCode and HackerRank very helpful. Both platforms have a wide range of coding problems. I focused on topics like arrays, graphs, and heaps. I also used GeeksforGeeks for quick explanations and sample code. Sometimes, I checked YouTube for walkthroughs of tricky problems. Here’s a quick list of what worked best for me:

    • LeetCode (especially the "Top Interview Questions" list)

    • HackerRank (practice contests)

    • GeeksforGeeks (topic-wise explanations)

    • YouTube (problem walkthroughs)

    Practice and Simulation

    I tried to make my practice sessions feel like the real assessment. I set a timer for 90 minutes and picked two or three random problems. I used only one screen and avoided looking up hints. This helped me get used to the pressure. After each session, I reviewed my mistakes and wrote down what I could improve.

    Time Management

    Managing time was key for me. I always scanned all questions first and started with the one I felt most confident about. I set mini-deadlines for each problem. For example, I gave myself 25 minutes for the first question, 35 for the second, and left the rest for the hardest one.

    Uber Hackerrank OA Tips and Pitfalls

    Key Strategies

    I found a few strategies that helped me succeed during the uber hackerrank oa. I always read each question carefully before starting to code. I used built-in functions when possible to save time. I checked my code with sample inputs before submitting. I made sure to handle edge cases, like empty arrays or single elements. Here are some strategies I recommend:

    • Scan all questions first.

    • Start with the easiest problem.

    • Break down complex problems into smaller steps.

    • Test code with different inputs.

    • Keep code clean and readable.

    Mistakes to Avoid

    Here’s a table of common mistakes and how to avoid them:

    Mistake

    How to Avoid

    Skipping instructions

    Read carefully

    Ignoring edge cases

    Test with extremes

    Poor time management

    Set mini-deadlines

    FAQ

    Has Uber switched all positions to HackerRank for online assessments?

    For the SDE role I interviewed for, it was on HackerRank, but it’s unclear whether other roles use it as well. For those who used CodeSignal, there’s another post about the Uber CodeSignal OA in the “See Also” section.

    What programming languages can I use for the Uber Hackerrank OA?

    I used Python, but the platform also supports Java, C++, and JavaScript. I recommend choosing the language you feel most comfortable with.

    Does Uber allow the use of external resources or notes during the OA?

    No, I could not use outside resources or notes. The platform monitored my screen and webcam to make sure I followed the rules. However, Linkjob AI was completely invisible to both the platform and the interviewer, so I still used it to assist in answering the questions.

    See Also

    Navigating the OpenAI Interview Process: My 2025 Experience

    Strategies for Tackling Uber CodeSignal Questions in 2025

    My Comprehensive Guide to the Bloomberg New Grad Interview

    Preparing for My Generative AI Interview: A 2025 Journey

    Successfully Completing the BCG X CodeSignal Assessment in 2025