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

SDE - Intern

Google
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 1 month
Topics: Dynamic Programming, Trees, Graphs, Arrays, Strings
Tip
Tip

Tip 1 : Prepare core concepts well
Tip 2 : Practice medium level and hard questions 
 

Application process
Where: Other
Eligibility: No Criteria
Resume Tip
Resume tip

Tip 1 : Put good projects and experiences.
Tip 2 : Generally, don't put any false things on resume.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration60 minutes
Interview date16 Aug 2020
Coding problem2

Timing: Between 3-5 pm we could take the test anytime
The test environment was hackerrank. Great user interface and I did not suffer anyt problems.
There was no interviewer as it was coding test. 
There were 2 coding questions asked.

1. Subset OR

Moderate
20m average time
80% success
0/80
Asked in company
Google

You are given an array/list ‘ARR’ of ‘N’ positive integers’. Your task is to find out the size of the smallest subset with the maximum OR possible. That means that among all subsets that have OR of its elements maximum, you need to report the size of the smallest such subset.

For Example :
Input : arr[] = {5, 1, 3, 4, 2}   
Output : 2
7 is the maximum value possible of OR, 
5|2 = 7 and 5|3 = 7
Try solving now

2. Wildcard Queries

Hard
50m average time
55% success
0/120
Asked in company
Google

You are given a dictionary ‘D’ consisting of ‘N’ words. Each word of the dictionary is of fixed size ‘L’ and contains only lowercase English alphabets.

Now you have to answer ‘Q’ queries, in each query you are given a word ‘W’ of fixed size ‘L’ but this word can consist of either lowercase English alphabets or ‘?’ (wildcard characters). Where ‘?’ can be matched by any lowercase English alphabet.

For each query find how many words in the dictionary can be matched by the query word ‘W’ by replacing ‘?’(if present) with some lowercase English alphabet.

 

Example :
If the dictionary is: {"cat", "rat", "bat", "hat"}

And query words are "?at" and "b?t", then:

"?at" => can be matched by all the 4 dictionary words by replacing '?' with 'c', 'r', 'b' or 'h'.

"b?t" => can only be matched by the dictionary word "bat" by replacing '?' with 'a'.  
Try solving now
02
Round
Medium
Video Call
Duration45 minutes
Interview date9 Oct 2020
Coding problem2

Timing was late at night ie 9:30 PM for this round.
The environment was nice. It was on Google meet.
The interviewer was very friendly and explained the question well

1. Rat In A Maze

Easy
15m average time
85% success
0/40
Asked in companies
AdobeOYOCIS - Cyber Infrastructure

You are given a starting position for a rat which is stuck in a maze at an initial point (0, 0) (the maze can be thought of as a 2-dimensional plane). The maze would be given in the form of a square matrix of order 'N' * 'N' where the cells with value 0 represent the maze’s blocked locations while value 1 is the open/available path that the rat can take to reach its destination. The rat's destination is at ('N' - 1, 'N' - 1). Your task is to find all the possible paths that the rat can take to reach from source to destination in the maze. The possible directions that it can take to move in the maze are 'U'(up) i.e. (x, y - 1) , 'D'(down) i.e. (x, y + 1) , 'L' (left) i.e. (x - 1, y), 'R' (right) i.e. (x + 1, y).

Note:
Here, sorted paths mean that the expected output should be in alphabetical order.
For Example:
Given a square matrix of size 4*4 (i.e. here 'N' = 4):
1 0 0 0
1 1 0 0
1 1 0 0
0 1 1 1 
Expected Output:
DDRDRR DRDDRR 
i.e. Path-1: DDRDRR and Path-2: DRDDRR

The rat can reach the destination at (3, 3) from (0, 0) by two paths, i.e. DRDDRR and DDRDRR when printed in sorted order, we get DDRDRR DRDDRR.
Try solving now

2. BFS in Graph

Easy
10m average time
90% success
0/40
Asked in companies
DelhiverySAP LabsCognizant

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

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 create a function in JavaScript?

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Google
1230 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 4 problems
Interviewed by Google
1455 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Google
1306 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Google
9517 views
4 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
13595 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
12782 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
9048 views
2 comments
0 upvotes