Google inc interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Google inc
upvote
share-icon
6 rounds | 9 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: data structures, OOPS, problem-solving, algorithms, puzzles, DP
Tip
Tip

Tip 1 : Try to cover as many different patterns of questions as you can, if you get unlucky you can even be asked questions related to geometry or segment trees! Obviously, there were other sources as well but this is quite a good amount

Tip 2 : I tried to complete as many googles tagged questions as I could. I used to sort questions by frequency and do questions that had bar colors of green and yellow. Maintain a notebook to note down questions that you are not able to do on your own and try them again after 2-3 weeks.

Tip 3 : Coding cleanly and at speed are also important. Write modular code otherwise, that would be a negative comment for you! I would recommend to try written practice 10 days before the interview so that you have a good hands-on

Application process
Where: Campus
Eligibility: 7 cgpa
Resume Tip
Resume tip

Tip 1 : Good experience
Tip 2 : Google mainly focuses on logic and how you are coming up with a solution. It notes down each and every small mistake. Interviewers are really very helpful. They expect clear code with the optimal approach

Interview rounds

01
Round
Medium
Telephonic
Duration45 Minutes
Interview date28 Jan 2022
Coding problem1

Discussion and problem solving. Tell me something about yourself.

1. Rotate Function

Moderate
25m average time
75% success
0/80
Asked in companies
AppleMicrosoftGoogle inc

Given an array of integers ā€˜ARR’. Let Ck be defined as an array obtained after cyclically shifting 'K' elements towards the right.

The power of an array is defined as follows.

Power(k) = 0 * Ck[0] + 1 * Ck[1] + ... + (n - 1) * Ck[n - 1].

You have to find the maximum value among Power(0), Power(1), Power(2), ……., Power(n - 1).

Try solving now
02
Round
Medium
Video Call
Duration60 Minutes
Interview date31 Jan 2022
Coding problem2

Problem solving

1. Duplicate Subtrees

Moderate
30m average time
70% success
0/80
Asked in companies
OlaMathworksNagarro Software

You have been given a binary tree, you are supposed to return the root values of all the duplicate subtrees. For each duplicate subtree, you only need to return the root value of any one of them.

Two subtrees are duplicate if and only if they have the same structure with the same node values.

For example:
In the below binary tree :

alt text

The duplicate subtrees are {{2, 3}, {3}} and we have to just return the root values of each duplicate subtree, so the output is {2, 3}.
Try solving now

2. Maximum Size Rectangle Sub-matrix With All 1's

Hard
10m average time
80% success
0/120
Asked in companies
AmazonDunzoRazorpay

You are given an 'N' * 'M' sized binary-valued matrix 'MAT, where 'N' is the number of rows and 'M' is the number of columns. You need to return the maximum size (area) of the submatrix which consists of all 1’s i.e. the maximum area of a submatrix in which each cell has only the value ā€˜1’.

subMatrix_image

In the above image, areas in green, red, and violet color are all submatrices of the original 4x4 matrix.

Note:

1. Binary valued matrix has only two values in each cell : 0 and 1.
2. A submatrix is a matrix formed by selecting certain rows and columns from a larger matrix.
3. The area of a matrix with 'h' rows and 'w' columns is equal to 'h' * 'w'. 
Try solving now
03
Round
Easy
Video Call
Duration60 Minutes
Interview date3 Feb 2022
Coding problem2

1. Break The Tree

Moderate
30m average time
70% success
0/80
Asked in companies
OlaAdobeGoogle inc

You are given a binary tree whose each node is associated with some integer value. You have to break this tree into two parts by removing exactly one edge. You also have to maximise the product of the sum of the integers associated with each node in both parts.

For Example:

Example

Consider the above example, if we break the tree by removing the edge between nodes that has integers 5 and 6 then we get the maximum product of the sum of integers on nodes i.e. ( (6 + 4 + 1) * (5 + 1 + 3 + 2) ) = 121.
Note:
The answer may be very large so, you have to take the modulo with 10^9 + 7.
Try solving now

2. Weighted Job Scheduling

Moderate
15m average time
85% success
0/80
Asked in companies
AmazonIntuitPhonePe

You are given 'N' jobs with their start time 'Start', end time 'End' and profit 'Profit'. You need to tell the maximum profit you can obtain by performing these jobs such that no two jobs overlap.

Note:
The start time of one job can be equal to the end time of another.
Try solving now
04
Round
Medium
Video Call
Duration60 Minutes
Interview date8 Feb 2022
Coding problem2

1. Covid Vaccination

Moderate
0/80
Asked in companies
OracleAmerican ExpressShareChat

We are suffering from the Second wave of Covid-19. The Government is trying to increase its vaccination drives. Ninja wants to help the Government to plan an effective method to help increase vaccination following safety measures. Time is running out. Can you help the nation?

You are given two positive integers: ā€˜n,’ ā€˜maxVaccines’ denoting the number of days for which this vaccination drive will go on and the total number of vaccines available for the drive, respectively. You have to find the number of vaccines administered each day. You are also given a number ā€˜dayNumber,’ and we are interested to know the maximum number of vaccines that can be administered on ā€˜dayNumber’ th day.

The rules of the vaccination drive :

1. There should be a positive number of vaccines administered each day during the vaccination drive.

2. The absolute difference between the number of vaccines in two consecutive days should not exceed 1.

3. The sum of all the elements of the vaccines array does not exceed maxVaccines, that is, you cannot administer more vaccines than what is provided to you.

4. Vaccines administered on ā€˜dayNumber’ th day should be maximized.

Problem approach

Two modifications are performed on binary search logic.

1) instead of sorted array, unsorted array has been given

2) Mid element is decided based on random function. Now we have to find out numbers from given array for which this function gives true result.

Hint: Function will return true for value x, if all numbers on left side of x are small and all number on the right side of x are greater. 

Example: [ 4, 3, 1, 5, 7, 6, 10]

Ans: 5, 10

Time Complexity: O(n)

Space Complexity: O(n)

Try solving now

2. BFS in Graph

Easy
10m average time
90% success
0/40
Asked in companies
Morgan StanleySamsung R&D InstituteRubrik, Inc.

Given an adjacency list representation of a directed graph with ā€˜n’ vertices and ā€˜m’ edges. Your task is to return a list consisting of Breadth-First Traversal (BFS) starting from vertex 0.


In this traversal, one can move from vertex 'u' to vertex 'v' only if there is an edge from 'u' to 'v'. The BFS traversal should include all nodes directly or indirectly connected to vertex 0.


Note:
The traversal should proceed from left to right according to the input adjacency list.


Example:
Adjacency list: { {1,2,3},{4}, {5}, {},{},{}}

The interpretation of this adjacency list is as follows:
Vertex 0 has directed edges towards vertices 1, 2, and 3.
Vertex 1 has a directed edge towards vertex 4.
Vertex 2 has a directed edge towards vertex 5.
Vertices 3, 4, and 5 have no outgoing edges.

We can also see this in the diagram below.

BFS traversal: 0 1 2 3 4 5

example

Try solving now
05
Round
Easy
Video Call
Duration60 Minutes
Interview date11 Feb 2022
Coding problem2

1. Chocolate and Sweetness

Hard
0/120
Asked in companies
ShareChatGoogle inc

Ninja wants to try some sweets in a sweet shop. There are ā€˜N’ types of sweets available at that shop. Each sweet has a sweetness level and expiry date. Ninja is fond of sweets, so he sets a specific sweetness level ā€˜X’ and is only likely to buy the sweets having a sweetness level greater than equal to ā€˜X’. But Ninja also wants fresher sweets, so he only buys having expiry date strictly greater than ā€˜Y’. Can you help Ninja to find the number of sweets suitable for him to buy?

You are given two arrays, ā€˜SWEET’ and ā€˜EXPIRY’, both having ā€˜N’ values corresponding to the sweetness and expiry date of ith sweet. Ninja will ask ā€˜Q’ queries with ā€˜X’ as the minimum sweetness level and ā€˜Y’ as the minimum expiry date. Your task is to answer all ā€˜Q’ queries and tell the number of sweets satisfying the given condition for each query.

For Example
For the given if N = ā€˜5’, ā€˜SWEET’ = [1,3,6,7,2] and ā€˜EXPIRY = [10,7,2,6,4].
And the query is ā€˜X’=2  and  ā€˜Y’ =6 ,then the number of sweets satisfying the condition is only 1 (having sweetness 3 and expiry date 7). 
Try solving now

2. Painter's Partition Problem

Moderate
25m average time
75% success
0/80
Asked in companies
OYOHSBCPayPal

Given an array/list of length ā€˜n’, where the array/list represents the boards and each element of the given array/list represents the length of each board. Some ā€˜k’ numbers of painters are available to paint these boards. Consider that each unit of a board takes 1 unit of time to paint.


You are supposed to return the area of the minimum time to get this job done of painting all the ā€˜n’ boards under a constraint that any painter will only paint the continuous sections of boards.


Example :
Input: arr = [2, 1, 5, 6, 2, 3], k = 2

Output: 11

Explanation:
First painter can paint boards 1 to 3 in 8 units of time and the second painter can paint boards 4-6 in 11 units of time. Thus both painters will paint all the boards in max(8,11) = 11 units of time. It can be shown that all the boards can't be painted in less than 11 units of time.


Try solving now
06
Round
Medium
HR Round
Duration50 Minutes
Interview date22 Feb 2022
Coding problem0

Tell me about yourself
Why Google?
Which product of Google do you like most? Why? Any competing products in the market?
If I asked your current organization for feedback then what will they say? Focusing on negative points.
If you have to improve one technical and one behavioral point then which one will you improve?
In your last organization or before that any leadership work have you done? Mentorship/organizer type.
What will you do when your work’s credit will be given to another person?
Any situation when your manager didn’t agree with your idea and how did you convince him?
Why you are leaving before 1 year?
What is your plan for 2 years in technical and non-technical aspects?
Do you have any questions for me?
And googlyness questions

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
1 rounds | 1 problems
Interviewed by Google inc
6180 views
0 comments
0 upvotes
company logo
SDE - 1
1 rounds | 1 problems
Interviewed by Google inc
1574 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 3 problems
Interviewed by Google inc
0 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by Google inc
0 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115097 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58238 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35147 views
7 comments
0 upvotes