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

Google inc
upvote
share-icon
7 rounds | 16 Coding problems

Interview preparation journey

expand-icon
Journey
I was working as an SDE-1 at Amazon but got impacted by layoffs 2023. Before that I completed my B.Tech. in July, 2022. I had almost 1 year experience at amazon. Before that I have worked as an Frontend Web developer Intern at an early startup. Also was mentor and teaching assistant for 2 ed-tech startups, Geekster and pepcoding.
Application story
I was contacted by recruiter on linkedIn (as my linkedIn profile is well maintained including all projects, achievements and all details I have mentoined in detail ). She scheduled a phone call with me and asked for my timing to schedule a pre-screening round for 30 mins. More details further.
Why selected/rejected for the role?
I think my experience with amazon boosted my profile. Also I have great score on coding platforms like gfg, leetcode and others. I also have good communication skill so I explained in deapth. My project at Amazon was also very impressing. Apart from that maintaing good LinkedIn was very helpful as out of nowhere she reached me out and not only google but several other recruiter also reached me out like Revolute (32,00,000 base salary with complete work from home option), coinbase( 48 LPA package with complete wfh benefits) and few other good companies.
Preparation
Duration: 4 months (but had previously done for almost 2 years in college time)
Topics: DP, graphs, binary search, hashmap and heaps and also stack and queues
Tip
Tip

Tip 1 : Make your you are understanding the logic of any question
Tip 2 : Do not skip the brute force approach
Tip 3 : If you are confidant with your your coding skills then only read or watch the questions video and try to complete as much questions as possible.

Application process
Eligibility: minimum 1 year experience working as an full time employee.
Resume Tip
Resume tip

Tip 1: Make sure your resume is updated with your best achievments and experience at top and is self explainatory.
Tip 2: Try to write small and precise information and your top skills.

Interview rounds

01
Round
Easy
HR Round
Duration30
Interview date2 Nov 2023
Coding problem1

This was a pre screening round with recruiter where she verified that my experience was genuine and wrote down all my experience and work in details. Then she wanted to know my interests and areas of expertise.

1.

1) My Introducation
2) Experience details
3) Projects worked at Amazon
4) What are my areas of expertise

Problem approach

Tip 1: Be honest because Google actually verify your details
Tip 2: Communicate well.
Tip 3: Ask your clearifying questions

02
Round
Medium
Online Coding Test
Duration70
Interview date14 Nov 2023
Coding problem2

It was a 90 mins long online test.
Normal Hackerrank IDE
video and audio was on the whole time

1. A barcode scanner can be configured by scanning a series of barcodes in the correct order, Barcode configurations are encoded into a single string and stored as a blob in the backend system. The client requests the configuration from the backend configuration service, and then needs to present the configurations in the correct order. The encoded configuartion string is a series of pairs separated by |. The ordinal index value is a 4 digit numeric prefixed with zeros. For example, the first prefixed with zeros. For example, the first configuration will be represented as 0001. The goals are to 1) validate the configuration string: and 2) provide the configuration client the configuration values in the order required to successfully configure the barcode scanner. Validation conditions All configurations must be separated by a ”|” charcater. Configurations cannot skip a number in the ordering. If there are three configuration strings, there must be a 1, 2, and 3 index. Configuration values are alphanumeric and may contain no other characters. Configuration value length is exactly 10 characters. Ordinal indices may not repeat, for example there cannot be two occurences of the number ”1”. Each configuratin value is unique, configurations do not repeat. “0000” is not a valid ordinal index. If a configuration string is not valid, return [“Invalid configuration"]. ## Happy path configuration = "0002f7c22e7904|000176a3a4d214|000305d29f4a4b" # Based on the `order` value, the expected output of this configuration string is: ## Output [ "76a3a4d214", # 0001 "f7c22e7904", # 0002 "05d29f4a4b" # 0003 ] Function Description Complete the function ordered_configuration in the editor below. ordered_configuration has the following parameter(s): * str *configuration*: the encoded configuration string Returns: * str configuration[n]: an array of configurations in the correct order Constraints and Assumptions 1 <= order <= 9999 1 <= count(configuration) <= 9,999 Order values may not be unique or complete. Configuration values are not always unique, the same configuration may appear in multiple configuration steps. Sample Case 0 configuration = 0001LAJ5KBX9H8|0003UKURNK403F|0002MO6K1Z9WFA|0004OWRXZFMS2C Sample Output: LAJ5KBX9H8 MO6K1Z9WFA UKURNK403F OWRXZFMS2C

Problem approach

Iterate over whole string and spilt in from "|" character.
Then check for the given conditions.

2. In this challenge, you are provided with an array of deployment results. Parse the data and determine the number of deployments that were successful or unsuccessful. Also, test that the JSON input is valid based on the parameters listed below. Otherwise, make it as an error. Return the result with the number of deployments that were successful, failed, or errors encountered parsing the data. Deployment parameter examples [ ' { "deployment_id": "d-123456abcd", "status": "Success" } ', ' { "deployment_id": "d-098765efgh", "status": "fail" } ' ] output: [1, 1, 0] Returns: results[0] = number of successful deployments results[1] = number of failed deployments results[2] = number of errors parsing deployments

Problem approach

Iterate over whole string and spilt in from "|" character.
Then check for the given conditions.

03
Round
Hard
Face to Face
Duration45
Interview date15 Dec 2023
Coding problem1

This was a hard problem and follow ups were also very difficult.
for 60 mins I tried my best to explain and code
it was on normal google doc.
Interviewer was giving more complex follow ups and was trying to break me every time I got comfortable and was deeply judging my problem solving skills.
interviewer was very polite and helpful but at the same time was giving harder follow ups. He communicated with me the whole time.

This question was already given on interviewbit but I did not knew this before, thus I had to come up with a solution on the spot. It tool me 60 mins to just solve one problem.

1. Given two water jugs with capacities X and Y litres. Initially, both the jugs are empty. Also given that there is an infinite amount of water available. The jugs do not have markings to measure smaller quantities. One can perform the following operations on the jug: Fill any of the jugs completely with water. Pour water from one jug to the other until one of the jugs is either empty or full, (X, Y) -> (X – d, Y + d) Empty any of the jugs The task is to determine whether it is possible to measure Z litres of water using both jugs. And if true, print any of the possible ways. Input: X = 4, Y = 3, Z = 2 Output: {(0, 0), (0, 3), (3, 0), (3, 3), (4, 2), (0, 2)} Explanation: Fill the 4-litre jug completely with water. Empty water from 4-litre jug into 3-litre (leaving 1L water in 4L jug and 3L completely full). Empty water from 3L. Pour water from 4L jug into 3L jug (4L being completely empty and 1L water in 3L litre jug) Fill the 4L jug with water completely again. Transfer water from 4L jug to 3L jug, resulting in 2L water in 4L jug. Input: X = 3, Y = 5, Z = 4 Output: 6 Explanation: Fill a 5-litres jug to its maximum capacity. Transfer 3 litres from 5-litre jug to 3-litre jug. Empty the 3-litre jug. Transfer 2-litres from 5-litre jug to 3-litres jug. Fill a 5-litres jug to its maximum capacity. Pour water into a 3L jug from a 5L jug until it’s full. (exact question link: https://www.interviewbit.com/blog/water-jug-problem/ )

Problem approach

Initialise a queue to implement BFS.
Since, initially, both the jugs are empty, insert the state {0, 0} into the queue.
Perform the following state, till the queue becomes empty:
Pop out the first element of the queue.
If the value of popped element is equal to Z, return True.
Let X_left and Y_left be the amount of water left in the jugs respectively.
Now perform the fill operation:
If the value of X_left < X, insert ({X_left, Y}) into the hashmap, since this state hasn’t been visited and some water can still be poured in the jug.
If the value of Y_left < Y, insert ({Y_left, X}) into the hashmap, since this state hasn’t been visited and some water can still be poured in the jug.
Perform the empty operation:
If the state ({0, Y_left}) isn’t visited, insert it into the hashmap, since we can empty any of the jugs.
Similarly, if the state ({X_left, 0) isn’t visited, insert it into the hashmap, since we can empty any of the jugs.
Perform the transfer of water operation:
min({X-X_left, Y}) can be poured from second jug to first jug. Therefore, in case – {X + min({X-X_left, Y}) , Y – min({X-X_left, Y}) isn’t visited, put it into hashmap.
min({X_left, Y-Y_left}) can be poured from first jug to second jug. Therefore, in case – {X_left – min({X_left, Y – X_left}) , Y + min({X_left, Y – Y_left}) isn’t visited, put it into hashmap.
Return False, since, it is not possible to measure Z litres.

This problem can easily be solved by mathematical equations but I did not knew that earlier. I had only explained the interviewer BFS approach and memoized it at the end.

04
Round
Hard
Face to Face
Duration45
Interview date19 Dec 2023
Coding problem2

This had 2 questions and both were medium-hard level. I could only solve and code first question in 30 mins and for the second question I was only able to tell the approach and did not write code.

1. This question was very similar to Missing and Repeating Nnumber. A story was created but the logic was same. Given an unsorted array of size n. Array elements are in the range of 1 to n. One number from set {1, 2, …n} is missing and one number occurs twice in the array. Find these two numbers. Input: arr[] = {3, 1, 3} Output: Missing = 2, Repeating = 3 Explanation: In the array, 2 is missing and 3 occurs twice Input: arr[] = {4, 3, 6, 2, 1, 1} Output: Missing = 5, Repeating = 1 (her eis link for better understanding: Logic was same only the story telling was complex https://www.geeksforgeeks.org/find-a-repeating-and-a-missing-number/)

Problem approach

Method 1 (Use count array)
Approach:

Create a temp array temp[] of size n with all initial values as 0.
Traverse the input array arr[], and do the following for each arr[i]
if(temp[arr[i]-1] == 0), set temp[arr[i]-1] = 1;
if(temp[arr[i]-1] == 1) output “arr[i]” //repeating number
Traverse temp[] and output ‘i+1’ corresponding to the element of array temp[] having value as 0. (This is the missing number)
Note that, we use ‘arr[i]-1’ as the corresponding element to the ‘arr[i]’ in temp[] array, as indexing in an array starts from 0 to n-1 and the input array arr[] has numbers from 1 to n.

void printTwoElements(int arr[], int size)
{
int i;
cout << "The repeating element is ";

for (i = 0; i < size; i++) {
if (arr[abs(arr[i]) - 1] > 0)
arr[abs(arr[i]) - 1] = -arr[abs(arr[i]) - 1];
else
cout << abs(arr[i]) << "\n";
}

cout << "and the missing element is ";
for (i = 0; i < size; i++) {
if (arr[i] > 0)
cout << (i + 1);
}
}

2. Find number of rectangles that can be formed from a given set of coordinates. This problem was only discussed and I only gave the approach for the question and not the code. here is the exact link for the question I was asked. https://www.geeksforgeeks.org/find-number-of-rectangles-that-can-be-formed-from-a-given-set-of-coordinates/ Given an array arr[][] consisting of pair of integers denoting coordinates. The task is to count the total number of rectangles that can be formed using given coordinates. Input: arr[][] = {{0, 0}, {0, 1}, {1, 0}, {1, 1}, {2, 0}, {2, 1}, {11, 11}} Output: 3 Explanation: Following are the rectangles formed using given coordinates. First Rectangle (0, 0), (0, 1), (1, 0), (1, 1) Second Rectangle (0, 0), (0, 1), (2, 0), (2, 1) Third Rectangle (1, 0), (1, 1), (2, 0), (2, 1) Input: arr[][] = {{10, 0}, {0, 10}, {11, 11}, {0, 11}, {12, 10}} Output: 0 Explanation: No Rectangles can be formed using these co-ordinates

Problem approach

Approach: This problem can be solved by using the property of the rectangle and Hash maps. If two coordinates of a rectangle are known then the other two remaining coordinates can be easily determined. For every pair of coordinates find the other two coordinates that can form a rectangle.

Below is the implementation of the above approach.

int countRectangles(vector >& ob)
{

// Creating TreeSet containing elements
set > it;

// Inserting the pairs in the set
for (int i = 0; i < ob.size(); ++i) {
it.insert(ob[i]);
}

int ans = 0;
for (int i = 0; i < ob.size(); ++i)
{
for (int j = 0; j < ob.size(); ++j)
{
if (ob[i].first != ob[j].first
&& ob[i].second != ob[j].second)
{

// Searching the pairs in the set
if (it.count({ ob[i].first, ob[j].second })
&& it.count(
{ ob[j].first, ob[i].second }))
{

// Increase the answer
++ans;
}
}
}
}

// Return the final answer
return ans / 4;
}

05
Round
Easy
Face to Face
Duration45
Interview date19 Dec 2023
Coding problem2

This round was 45 min long
It was on Google doc
2 medium to hard level questions were asked in this round. I was only able to explain and code the first question and for the second question I only explained the approach.
The interviewer was polite and helpful throughout but I was judging my problem solving skills through out.

1. Given array arr of size n and an integer k, find the top k people who have send the most chats. arr = { { mike: "hi", steve: "Hello mike, how are you", adam: "is everyone free in the evening", mike: "yes", steve: "yes" }} k = 2 output = steve and adam explanation: here all words spoken by mike are 2, steve was 6 and adam are 6. so top 2 most spoken words are from steve and adam.

Problem approach

use hashmap to store all unique name and corresponding to that frequency of the words spoken.
iterate over the array and split chats on the basis of single space character " ".
After that iterate over the hashmap and use min heap to store k most frequent elements.

2. Check if a Tree can be split into K equal connected components Given Adjacency List representation of a tree and an integer K., the task is to find whether the given tree can be split into K equal Connected Components or not. Note: Two connected components are said to be equal if they contain equal number of nodes. example: 1 / \ 2 3 / \ / \ 4 5 6 7 / \ 8 9 k = 3 output: yes explanation: we can split the tree into 3 equal connected components 1 4 3 / / \ / \ 2 8 9 6 7 \ 5

Problem approach

Approach:
The idea is to use Depth First Search(DFS) traversal on the given tree of N nodes to find whether the given tree can be split into K equal Connected Components or not. Following are the steps:

Start DFS Traversal with the root of the tree.
For every vertex not visited during DFS traversal, recursively call DFS for that vertex keeping the count of nodes traverse during every DFS recursive call.
If the count of nodes is equals to (N/K) then we got our one of the set of Connected Components.
If the total number of the set of Connected Components of (N/K) nodes is equal to K. Then the given graph can be split into K equals Connected Components.

#include

using namespace std;

// For checking if the graph
// can be split into K equal
// Connected Components

int flag = 0;

// DFS Traversal

int DFS(vector adj[], int k,

int i, int x)
{


// Initialise ans to 1

int ans = 1;


// Traverse the adjacency

// for vertex i

for (auto& it : adj[i]) {

if (it != k) {

ans += DFS(adj, i, it, x);

}

}


// If number of nodes is

// greater than x, then

// the tree cannot be split

if (ans > x) {

flag = 1;

return 0;

}


// Check for requirement

// of nodes

else if (ans == x) {

ans = 0;

}

return ans;
}

// A utility function to add
// an edge in an undirected
// Tree

void addEdge(vector adj[],

int u, int v)
{

adj[u].push_back(v);

adj[v].push_back(u);
}

06
Round
Medium
HR Round
Duration45
Interview date21 Dec 2023
Coding problem4

this was a 45 min long round
it was on google meet
this was Googliness and Leadership round where interviewer wanted to check if I have character which matches their principles.
The interviewer was asking behavioural questions and in every question I had to frame a story in STAR format.
Interviewer was polite.

1.

Problem approach

Tip 1: Start from your most recent position and describe what you did in that position. What were your responsibilities and project. What impact did you make etc.
Tip 2: Be honest and try to communicate well. In every sentence try to show your personality with that.
Tip 3: Also show anything you did not wrote in your resume.

2.

Problem approach

Tip 1: Be honest about the question and go in deapth of the approach or challenges you faced.
Tip 2: You can exaggerate a little but make sure you have great understanding about what you are saying.
Tip 3: Interviewer might ask any follow ups so be prepared.

3.

Problem approach

Tip 1: This is a trick question and do not blame anyone for this.
Tip 2: Prepare all this questions before and create stories to frame.
Tip 3: Go through previuosly asked behavioral questions and prepare 1 or 2 stories for all questions

4.

Problem approach

Tip 1: In this question they were trying to find how I dive deep in problem and find solution.
Tip 2: Speak in STAR format.
Tip 3: Try to prepare few stories of your previous experience and frame them in any question which is most alligned.

07
Round
Medium
HR Round
Duration30
Interview date4 Jan 2024
Coding problem4

Team match round.
This was a 30 mins long discussion with hiring manager for team matching.
It was on google meet.
I was told that this is going to be general discussion with manager but instead I found behavioural question for which I was not at all prepared for.
Interviewer was polite and sweet but at the same time judging all mhy answers.

1.

Problem approach

Tip 1: Start from your most recent position and describe what you did in that position. What were your responsibilities and project. What impact did you make etc.
Tip 2: Be honest and try to communicate well. In every sentence try to show your personality with that.
Tip 3: Also show anything you did not wrote in your resume.

2.

Problem approach

Tip 1: Be honest and tell them if you were impacted by layoffs or recession.
Tip 2: Tell them you had completed great projects for this company which had huge impact.
Tip 3: Try to be positive about the company and don't blame anyone.

3.

Problem approach

Tip 1: Be prepared about principles on google and on what basis they judge.
Tip 2: Tell how you are already following principles which google follows.
Tip 3: Be honest in this round.

4.

Problem approach

Tip 1: Make sure you do not say 3 BAD QUALITIES instead of AREA OF OPPORTUNITY.
Tip 2: Prepare all this before coming to interview.
Tip 3: Tell the interviewer that how you are trying to improve these areas of opportunity.

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
Software Engineer
4 rounds | 4 problems
Interviewed by Google inc
0 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
company logo
SDET-2
2 rounds | 3 problems
Interviewed by Google inc
4573 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
5 rounds | 10 problems
Interviewed by Arcesium
487 views
0 comments
0 upvotes