A recruiter reached out to me after coming across my profile, and I showed interest.
After a quick call with them, they scheduled a 1-hour technical phone interview with an engineer.
They usually determine a suitable role for you after all interviews, identifying which skills you are strong at and your interest in different projects.
I did not make it to the onsite interview, but the phone call experience was good, and it felt like they were moving fast without any delays.
Task Description
Diamond Mine is your new favorite game. Its map is represented as a square matrix. The board is filled with cells, and each cell will have an initial value as follows:
The basic rules for playing Diamond Mine are as follows:
For example, consider the following grid:
0 1 -1 0
Start at the top left corner. Move right one, collecting a diamond. Move down one to the goal. Cell (1, 0) is blocked, so we can only return on the path we took initially. All paths have been explored, and 1 diamond was collected.
Function Description
Complete the function collectMax in the editor below. It must return an integer denoting the maximum number of diamonds you can collect given the current map.
collectMax has the following parameter(s):
mat[mat[0],...mat[n-1]]: an array of integers describing the game grid mapConstraints
Input Format for Custom Testing
Sample Case 0 Sample Input 0 3 3 0 1 -1 1 0 -1 1 1 1
Sample Output 0 5
Explanation 0 You can collect a maximum of 5 diamonds by taking the following path: (0, 0) → (0,1) → (1,1) → (2, 1) → (2, 2) → (2, 1) → (2, 0) → (1, 0) → (0, 0)
Sample Case 1 Sample Input 1 3 3 0 1 1 1 0 1 1 1 1
Sample Output 1 7
You can collect all 7 diamonds by following the path:
0 1 1 ↑ ↓ 1 0 1 ↑ ↓ 1 ← 1 ← 1
Sample Case 2 Sample Input 2 3 3 0 1 1 1 0 -1 1 1 -1
Sample Output 2 0
Explanation 2 The cell at (2, 2) is blocked, so you cannot collect any diamonds.
The following metrics were computed from 373 interview experiences for the Uber Software Engineer role in United States.
Uber's interview process for their Software Engineer roles in the United States is very selective, failing most engineers who go through it.
Candidates reported having good feelings for Uber's Software Engineer interview process in United States.