Professional Documents
Culture Documents
- By Sunyul Hossen
🔥:
Note: [To Use this sheet optimally go and watch the "Cracking the Uber coding interview
The definitive prep guide" video on Debug Buzz Channel.
Link - https://youtu.be/CYKnE1FiVzU ]
1. You are given a 9x9 2D matrix with some empty cells (denoted by 0)
along with cells filled with digits (1-9) such that the final matrix is a
valid Sudoku solution.
2. Given a two-dimensional boolean matrix, find the number of islands.
An island is a group of connected 1s or a standalone 1. A cell in the
matrix can be connected to up to 8 neighbors: 2 vertical, 2 horizontal,
and 4 diagonal.
3. Implement a queue with two stacks.
4. You are given an array/list of unsorted ARR of N integers. Return the
length of the longest consecutive sequence. The consecutive
sentence in the form ['NUM', 'NUM' + 1, 'NUM' + 2, ..., 'NUM' + L],
where ‘NUM’ is the starting integer of the sequence while L + 1 is the
length of that sequence. If we find duplicates in the array, we will
consider only one of them in a consecutive sequence. Like, for the
given ARR [9,5,4,9,10,10,6], output = 3. Here, the longest consecutive
sequence is 4, 5, 6. Can you also solve this in 0(N) space complexity
and 0(N) time?
5. You are given a binary tree of integers. Print the right view of this
binary tree. The right view of a binary tree is a set of nodes when
viewed from its right side, while the nodes are printed in the top to
bottom order.
6. A group of friends went on a trip and lent each other money for
various purposes. The tuple (X, Y, Z) represents each transaction, i.e.,
person X gave person y $Z. Given a list of 'N' number of transactions,
return the minimum number of transactions required to settle the
debt.
7. Delete Edge to minimize the difference in subtree sum.
8. Find the Max Rectangle in a Histogram.
9. How to determine the max product of three numbers?
10.What is Contiguous Subarray Sum?
11.Merge two binary trees.
12.Implement a hash map.
13.Write an efficient and effective function that can check whether a
permutation of any input string is a palindrome.
14.Write a function to find an index of a rotation point in an array.
15.Write a function fib() that will take an integer n and return the
respective nth Fibonacci number.
16.Check whether your single-linked list contains a cycle.
How to answer: Talk about what you like about Uber and its
product/service. Try to focus on a specific reason that is motivating you to
work for Uber. You can also mention Uber’s work culture and excellent
employee benefits and why they’re valuable to you. Ensure that they
understand Uber is your first choice.