Uber OA HackerRank Interview Sharing|Uber Online Assessment Three Real Questions Analysis

1,946 Views

Recently we just took a student here to complete a tour Uber O.A. Like many previous events, this year many Uber OA has switched from CodeSignal to the HackerRank platform.

The structure of this exam is actually very typical: 3 coding questions + time limit to complete. This time we took the students through the entire OA with remote real-time assistance, and the overall rhythm was relatively stable. It took about 30 minutes to complete all three questions and pass the test. Let’s review the question types and core ideas of this Uber OA.

Uber OA HackerRank Interview Sharing|Uber Online Assessment Three Real Questions Analysis

Question 1: Python: Lambda Map

Question meaning

The question is given a two-dimensional array, and each sub-array needs to be processed: first filter out all positive integers, then square these positive integers, and finally return a new two-dimensional array.

Problem-solving ideas

The outer layer uses map to traverse each sub-array, and inside the sub-array, filter is first used to filter out positive integers, and then map is used to square these numbers, and finally the result is converted into a list and returned.

The core of this question is not the complexity of the algorithm, but whether you are familiar with functional writing methods such as Python lambda, map, and filter. If you are used to writing this way, you can basically complete the entire logic with one line of expressions.

Question 2: Node Disconnection

Question meaning

The question is given a string. Each operation can delete a continuous segment of the same characters. It is necessary to calculate the minimum number of operations to delete the entire string.

Problem-solving ideas

The key point is to understand the operating rules. A continuous segment of the same characters can be deleted in one operation, so the essence of the problem is to count how many consecutive character segments there are in the string.

The implementation only needs to scan the string from left to right. If the current character is different from the previous character, it means that a new continuous segment has been entered, and the count can be increased by one. The entire question is a linear traversal, and the time complexity is O(n).

Many people's first reaction to this question is to simulate the deletion process. In fact, it is completely unnecessary. As long as you grasp the core of "number of consecutive segments", you can write it quickly.

Question 3: Purchase Optimization

Question meaning

A more typical greedy question. The question gives the product price array prices, a starting position pos, and the total budget amount.

The rule is to purchase products starting from POS and continue purchasing as long as the current budget can afford it. The cumulative expenditure cannot exceed the amount. Stop when the remaining amount is not enough to buy the next item, and finally return how many items were purchased in total.

Problem-solving ideas

The solution is to traverse sequentially. Check each price starting from pos. If the amount is greater than or equal to the current product price, purchase it, update the remaining budget and increase the count; if the budget is not enough, end the loop directly.

The whole process is a simple sequential greedy strategy, and the complexity is also O(n).

Not familiar with OA? Don’t panic

If you are about to take Uber OA, but are not familiar with this online written test platform, or do not have much confidence in the time rhythm and question types, you can actually find someone with experience to prepare in advance. We have been leading students to do OA for various companies for a long time, such as coding assessment on platforms such as HackerRank and CodeSignal. I feel that I am not sure how to control it alone. Welcome Contact us .

author avatar
Jory Wang Amazon Senior Software Development Engineer
Amazon senior engineer, focusing on the research and development of infrastructure core systems, with rich practical experience in system scalability, reliability and cost optimization. Currently focusing on FAANG SDE interview coaching, helping 30+ candidates successfully obtain L5/L6 Offers within one year.
END
 0