
Let’s take a look at the freshly uber oa question released experience together.
一、Uber oa Hackerrank Test
Uber oa question 1
Firstly, the test assesses coding skills. Moreover, it includes various coding challenges.
Given an undirected tree, we need to remove an edge to minimize the difference in the sum of the two subtrees obtained.

Steps:
- Calculate the total sum of the tree: First, calculate the sum of the node weights of the entire tree.
- Depth first search: Traverse the tree through DFS and calculate the weight sum of the subtree with each node as the root.
- Calculate difference: Traverse all edges, for each edge, calculate the weight and difference of the two subtrees formed after deleting this edge, andfind the minimum difference.
Here’s a Python function to accomplish this:
def min_subtree_diff(n, edges, weights):
from collections import defaultdict
# Build adjacency table
tree = defaultdict(list)
for u, v in edges:
tree[u].append(v)
tree[v].append(u)
total_sum = sum(weights)
subtree_sum = [0] * n
min_diff = float('inf')
def dfs(node, parent):
nonlocal min_diff
subtree_sum[node] = weights[node]
for neigh in tree[node]:
if neigh != parent:
dfs(neigh, node)
subtree_sum[node] += subtree_sum[neigh]
if node != 0:
diff = abs(total_sum - 2 * subtree_sum[node])
min_diff = min(min_diff, diff)
dfs(0, -1)
return min_diff
Uber oa question 2
Determine the time since the last bus departure given a schedule of bus departure times and the current time.
Input: strings schedule (24-hour format HH:MM) and current_time.
Output: The number of minutes since the last bus left. If the first bus of the day has yet to leave, return -1.
Here’s a Python function to accomplish this:
def time_since_last_bus(schedule, current_time):
def to_minutes(t):
h, m = map(int, t.split(':'))
return h * 60 + m
now = to_minutes(current_time)
departed = [to_minutes(t) for t in schedule if to_minutes(t) <= now]
if not departed:
return -1
return now - max(departed)
二、Uber oa Technical Question
Secondly, these questions evaluate problem-solving abilities. Therefore, it’s important to practice them.
- Discussion on jitter.
- TCP vs UDP.
- How does the operating system handle page errors?
- Explain the layers of the OSI model.
- Given an array, print the next larger element (NGE) for each element. If none exists, use -1.
- The rightmost element always has NGE = -1.
三、Uber oa Problem Solution
Additionally, this round’s code issues only require candidates to share their solutions and ideas; no live coding is required.
Given arr = [5, 6, 1], constructing a BST in that order yields the same tree as [5, 1, 6]. How many permutations produce the same BST?
四、Uber oa Hr + System Design
Interviewers asked candidates to suggest solutions for managing concurrency in BookMyShow’s booking process.
- What are design patterns and why use them? Explain two.
- Discussion on database standardization.
- Which is more suitable for distributed systems: standardized or non-standardized?
- What do you do when you can’t find a solution to a project problem?
Finally, candidates are invited to ask questions about enterprise values, vision, and past research. Good communication and clear thinking are key.
In conclusion, preparing for the Uber OA interview requires practice and a thorough understanding of the format. Best of luck!
Learn More
最后,经过我们的强力面试辅助,候选人展示了清晰的思路和有效的沟通技巧,帮助应对 Uber 面试,提升了解决实际问题的能力。祝大家面试顺利!
如果您也需要面试辅助服务,请联系我们。