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

SDE - Intern

Google inc
upvote
share-icon
3 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Journey
i started by taking a dsa course with c++ from the udemy and google visited my college int the 5th sem for providing internship opportunity and started interview preparation at the last of my 4th semester around 2 to 3 month of preparation require for any interview
Application story
i filled the form for google around 15/07/2022 provided by our college and online test was on 23/07/2022 in the afternoon which contain two codeing problems of medium level
Why selected/rejected for the role?
i was rejected by the company because that was my first interview so i was very nervous at that time and not well prepare
Preparation
Duration: 2.5 Months
Topics: Data Structures, OOPs, OS, DBMS, Pazzels
Tip
Tip

Tip 1 : striver sheet
Tip 2 : have some good project

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Good project in your resume
Tip 2 : Mention all your skills

Interview rounds

01
Round
Easy
Online Coding Interview
Duration60 Minutes
Interview date23 Jul 2022
Coding problem2

1. Maximum AND Sum of Array

Hard
0/120
Asked in companies
HCL TechnologiesWestern DigitalGoogle inc

You are given an array of coins ‘COINS’ of length ‘N’ and there are ‘S’ number of slots numbered from 1 to S such that 2*S >= N.

You have to place all N coins into some slots so that no slot contains more than two coins. After placing the coins you will calculate the AND sum as the sum of all the values obtained by performing the bitwise AND operation between the slot number and the value of the coin placed in that slot number .

You have to find AND sum between the coins and the slots.

Try solving now

2. Min Jumps

Easy
15m average time
85% success
0/40
Asked in companies
AckoHSBCIBM

You live in a Ninja town which is in the form of a N * M grid. In this town, people travel from one place to another by jumping over the buildings which are present in each cell of the grid. It is Christmas eve, and Santa wants to give gifts and chocolates to the kids who live in the building which is present at the cell (N - 1, M - 1). Initially, Santa is present on cell (0, 0). Since Santa is in a hurry, help him find a path from starting point to the endpoint with the least amount of time.

The Santa may go only from one building to any of its adjacent buildings which is present either to the right or to the bottom or bottom right cell i.e. if the current position is (x, y), he may go to (x + 1, y + 1) or (x + 1, y) or (x, y + 1) given that the new coordinates are in the grid. The time taken to reach from one building to another is equal to the absolute difference between the heights of buildings.

Note:

1. The heights of the buildings are positive.
2. Santa starts from the cell (0, 0) and he has to reach the building (N - 1, M - 1).
3. Santa cannot leave the grid at any point of time.
Try solving now
02
Round
Medium
Video Call
Duration60 Minutes
Interview date12 Aug 2022
Coding problem1

1. Connect Nodes at Same Level

Moderate
30m average time
70% success
0/80
Asked in companies
Expedia GroupMicrosoftOla

A binary tree is a tree where each node has at most two children i.e left child and right child.

You are given a binary tree, where the structure of the node is as follow -:

class BinaryTreeNode {
 int data;      // Value of the node.
 BinaryTreeNode *left;  // Pointer to left child node.
 BinaryTreeNode *right; // Pointer to right child node.
 BinaryTreeNode *next;  // Pointer to next right node at same level. 
}

Your task is to connect all the adjacent nodes at the same level in the given binary tree. You can do this by populating each 'next' pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL. Initially, all the next pointers are set to NULL.

For Example:

Consider the figure shown below. The left part represents the initial binary tree and right part represents the binary tree after connecting adjacent nodes at the same level.

alt text

In the tree shown in the picture above -:
The ‘next’ pointer of the node having value 2 is connected to the node having value 3.
The ‘next’ pointer of the node having value 4 is connected to the node having value 5.
The ‘next’ pointer of the node having value 5 is connected to the node having value 6.
The ‘next’ pointer of nodes having value 1, 3, 6 will have a value NULL as there are no next right nodes in their cases.

Note:

1. The structure of the ‘Node’ of a binary tree is already defined. You should not change it.   
2. The root of the binary tree is known to you.  
3. There is at least one node in the given binary tree.
4. You may only use constant extra space.
Problem approach

class Solution
{
public:
//Function to connect nodes at same level.
void connect(Node *root)
{
queues1;
queues2;
if(root==NULL)
return ;
s1.push(root);
while(s1.size()!=0 || s2.size()!=0)
{
Node* one=NULL;
Node* two=NULL;
while(s1.size()!=0)
{
if(one==NULL)
{
one=s1.front();
s1.pop();
if(one->left!=NULL)
s2.push(one->left);
if(one->right!=NULL)
s2.push(one->right);
}
else
{
one->nextRight=s1.front();
s1.pop();
one=one->nextRight;
if(one->left!=NULL)
s2.push(one->left);
if(one->right!=NULL)
s2.push(one->right);
}
}
while(s2.size()!=0)
{
{
if(two==NULL)
{
two=s2.front();
s2.pop();
if(two->left!=NULL)
s1.push(two->left);
if(two->right!=NULL)
s1.push(two->right);
}
else
{
two->nextRight=s2.front();
s2.pop();
two=two->nextRight;
if(two->left!=NULL)
s1.push(two->left);
if(two->right!=NULL)
s1.push(two->right);
}
}
}
}



};

Try solving now
03
Round
Easy
Video Call
Duration60 Minutes
Interview date12 Aug 2022
Coding problem1

1. Merge Two BSTs

Moderate
10m average time
90% success
0/80
Asked in companies
AmazonJosh Technology GroupD.E.Shaw

You are given two binary search trees of integers having ‘N’ and ‘M’ nodes. Return an array that contains elements of both BST in sorted order.


A binary search tree (BST) is a binary tree data structure with the following properties.

• The left subtree of a node contains only nodes with data less than the node’s data.

• The right subtree of a node contains only nodes with data greater than the node’s data.

• Both the left and right subtrees must also be binary search trees.


Problem approach

class Solution
{
public:
//Function to return a list of integers denoting the node 
//values of both the BST in a sorted order.
void inorder(Node* root,vector&v)
{
if(root==NULL)
return ;
inorder(root->left,v);
v.push_back(root->data);
inorder(root->right,v);
}
vector merge(Node *root1, Node *root2)
{
//Your code here
vectorv;
inorder(root1,v);
inorder(root2,v);
sort(v.begin(),v.end());
return v;

}
};

Try solving now

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 - Intern
2 rounds | 4 problems
Interviewed by Google inc
3050 views
3 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Google inc
1465 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 5 problems
Interviewed by Google inc
1279 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 5 problems
Interviewed by Google inc
1370 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
15605 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
15499 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
10216 views
2 comments
0 upvotes