Recently appeared for Uber online assessment test for SDE2 role. There were in total 4 questions to be solved within 70 minutes and difficulty was relatively easy and medium level. Following are 3 of the 4 questions that I remember from the OA for reference:
Q2: You are given a list of N strings where each string denotes arrival time of the ith train, and one more string denoting current_time, find the minimum wait time for catching the next upcoming train corresponding to the current time. Return 0 if there are no more trains available past current time.
Q3: Given a matrix, output the sum of elements whose index is divisible by 3 in spiral order.
Q4: You are given a task with Q queries and an integer input limit, where each query can be either of the following:
+X: Add value X to the list-X: Remove first occuring X from the listInitially the list should contain zero elements. For each query, perform the given operation and find the total number of pairs in the list such that their absolute difference is equal to limit. Return the list of output for all Q queries.