Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding
Ninjas X Naukri.com

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

Google

3 rounds | 7 Coding
problems

Journey

In my second year, I did the course of competitive programming from Coding Ninjas, which helped me to dive deep into DSA, and then I started practicing problems on Codeforces, Codechef, and leetcode.

Application story

I applied through college or university. The process took multiple day. The event had three rounds mainly consisting of coding questions.

Why selected/rejected for the role?

They gave me two DSA questions which I solved and answered all Cs fundamental question they asked.
They also checks your OOPS skills

Preparation

Duration: 5 months

Topics: Data Structures - Trie, HashMap, Sets, Priority Queue, Stack, Advanced Topics like Fenwick Tree, Segment Trees, Game Theory, Dynamic Programming, Union Find, Graph Algorithms, Bitmasks

Tip

Tip 1 : Reading other’s interview experiences is one of the best ways to get yourselves ready for the next job interview. Practice daily atleast 5 questions.

Tip 2 : Most commonly asked topics in Google Interviews ( as per the mail I received from my recruiter ) :

BFS/DFS/Flood fill, Binary Search, Tree traversals, Hash tables, Linked list, stacks, queues, two pointers/sliding window

Binary heaps, Ad hoc/string manipulations.

Tip 3 : Highly recommended sites for practicing questions ( usually practice medium and hard level questions) -

Leetcode (highly encouraged)

Geeksforgeeks (highly encouraged)

CodeZen( highly encouraged)

Codeforces

Application process

Where: Campus

Eligibility: No Criteria

Resume tip

Tip 1 : Mention past working experience in detail as how you were important to your previous company.

Tip 2 : Try to keep your resume to 1 page if work experience < 5 years

Tip 3 : Update your resume according to role you are applying for and never put false things on resume.

01

Round

Medium

Online Coding Test

Duration60 minutes

Interview date4 Dec 2020

Coding problem2

This round was held on Hackerearth from 2:00 PM to 3:00 PM

This round had 2 questions of easy/medium difficulty. Both were based on concepts of DP.

The use of offline IDE was prohibited so we were supposed to code it on Hackerearth IDE itself.

```
1) Subtract 1 from it. (n = n - 1) ,
2) If n is divisible by 2, divide by 2.( if n % 2 == 0, then n = n / 2 ) ,
3) If n is divisible by 3, divide by 3. (if n % 3 == 0, then n = n / 3 ).
```

```
Given:
‘N’ = 4, it will take 2 steps to reduce it to 1, i.e., first divide it by 2 giving 2 and then subtract 1, giving 1.
```

```
str = "ababc"
The longest palindromic substring of "ababc" is "aba", since "aba" is a palindrome and it is the longest substring of length 3 which is a palindrome.
There is another palindromic substring of length 3 is "bab". Since starting index of "aba" is less than "bab", so "aba" is the answer.
```

02

Round

Medium

Video Call

Duration45 minutes

Interview date11 Dec 2020

Coding problem2

The round was held on Google Meet and I was given 2 coding problems for which first I had to explain my approach and then I had to write code in Shared Google Docs and dry run on sample test cases and discuss Time and Space Complexity.

There were 2 interviewers and both were very friendly and helpful and tried to bring us to our comfort level first.

```
Let text = “this is a good place to have a good start”, pattern = “good” so you have to return {10, 31} because at 10 and 31 index pattern is present in the text.
```

```
If there is no such index in the text then just return an array containing -1.
```

```
[2,3,4] - median is 3.
[2,3] - median is floor((2+3)/2) = 2.
```

03

Round

Hard

Online Coding Test

Duration90 minutes

Interview date17 Dec 2020

Coding problem3

This round was also virtual. It has some difficult questions when compared to the previous rounds.

This was also held on Google Meet with shared docs for writing code.

There were 2 interviewers and both were helpful.

```
N = 4, redEdges = [[0, 1], [2, 3]], blueEdges = [[1, 2], [1, 3]]
```

```
The shortest paths for each node from node ‘0’ are:
1: 0->1 Length: 1
2: 0->1->2 Length: 2
3: 0->1->3 Length: 2
So, the ‘answer’ array will be: [0, 1, 2, 2].
```

```
1. The given graph could be a disconnected graph.
2. Any two nodes ‘i’ and ‘j’ can have at most one red edge from ‘i’ to ‘j’ and at most one blue edge from ‘i’ to ‘j’.
```

```
1) The suggested correct strings for the string ‘QUERY’ will be all those strings present in the ‘DICTIONARY[]’ that have the prefix same as the longest prefix of string ‘QUERY’.
2) The ‘DICTIONARY[]’ contains only distinct strings.
```

```
Given 'DICTIONARY[]' = {“ninja”, “ninjas”, “nineteen”, “ninny”} and query = “ninjk”. Since “ninjk” is not present in the ‘DICTIONARY[]’, it is an incorrect string. The suggested current spellings for “ninjk” are “ninja” and “ninjas”. It is because “ninj” is the longest prefix of “ninjk” which is present as the prefix in ‘DICTIONARY’.
```

```
There must be no consecutive horizontal lines of equal height in the output skyline. For instance, [...,[2 3], [4 5], [7 5], [11 5], [12 7],...] is not acceptable; the three lines of height 5 should be merged into one in the final output.
As such: [..., [2 3], [4 5], [12 7],...].
Also, the buildings are sorted by a non-decreasing order.
For more clarification see sample case 1.
```

Here's your problem of the day

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

What is the index number of the last element of an array with 9 elements?

Choose another skill to practice

Similar interview experiences

SDE - 1

1 rounds | 2 problems

Interviewed by Google

2149 views

0 comments

0 upvotes

SDE - 1

1 rounds | 1 problems

Interviewed by Google

1444 views

1 comments

0 upvotes

SDE - 1

4 rounds | 5 problems

Interviewed by Google

2894 views

0 comments

0 upvotes

SDE - 1

3 rounds | 5 problems

Interviewed by Google

1327 views

0 comments

0 upvotes

Companies with similar interview experiences

SDE - 1

5 rounds | 12 problems

Interviewed by Amazon

105288 views

24 comments

0 upvotes

SDE - 1

4 rounds | 5 problems

Interviewed by Microsoft

50191 views

5 comments

0 upvotes

SDE - 1

3 rounds | 7 problems

Interviewed by Amazon

31267 views

6 comments

0 upvotes

asadbekotabekovasadbekotabekov