Grab on campus | SDE Backend
1479

Position: SDE at Grab
Location: Bangalore, India

College:- Tier 2

Round 1:
It was an online round. They asked 3 questions. Two questions were from DSA. I don't remember the question but one was easy and one was medium. Last question was to debug the code. Problem statement and their solution was there with some bugs.
I solved all three questions and they called me for the next round.

Round 2:

It was a technical round. He asked me for an introduction and quickly shared google docs with me for a problem statement.

Question 1:
Given an array objective is to reduce the sum of the final resultant array <= (half of the sum of given array) in minimum operation.
Operation allowed: You can divide one element of the array by 2 at a time.

Example: Let's consider an array [7, 4, 8, 1]. Its sum is 20. we have to reduce the sum <= 10.
operation 1: reduce 8 (arr[2]) to 4.
operation 2: reduce 7 (arr[0]) to 3.
operation 3: reduce 4 (arr[1] or arr[2]) to 2.
now the new array is [3, 4, 2, 1].
so here 3 operations are required.

I quickly gave him a solution using a heap. He said to write code for it.

Question 2: You are given a List of intervals (inclusive), we need to find out a number with the largest number of occurence in all the given intervals.

Example: input [[1, 10], [1, 3], [11, 24], [2, 4]].
return 2 or 3 because 2 is coming in three intervals ([1, 10], [1, 3], [2, 4]).
Similarly 3 is coming in three intervals ([1, 10], [1, 3], [2, 4]).

I clarify the range of the numbers (it was INT_MIN to INT_MAX) then I give him a solution with O(n) space and O(n) time complexity solution. I ask myself to dry run. Now he asked me to reduce the space complexity. I took some time and gave him a solution. He was happy and asked me to write the code. My code has a small bug. He asked me to find the bug. I found the bug and the interview ended after 1-2 general questions.

Round 3:
She was a 5-6 year experience person. She asked me to introduce myself, what technology I know, what am I doing at my internship, and general questions on databases. She asked me to design tinyurl (similar to Encode and Decode TinyURL), write algorithm for encode and decode, design database schema, write queries for all the operations.

I had seen this question on leetcode but i had not solved it. I stucked, she said to take some time and think. She gave me one hint meanwhile. The hint actually cleared my doubt and solved the problem.
In the end, do you have any questions for me?

Round 4:: It was a simple 15 minutes HR round. She gave her introduction and asked for mine. She asked strength, where do you see yourself in 5 years, why grab, are you available for internship, do you have any question for me.

Finally I was selected :-).

Comments (2)