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

# SDE - Intern

2 rounds | 4 Coding problems

## Interview preparation journey

Preparation
Duration: 4 months
Topics: Data Structures, Algorithms, Arrays, Trees, Hashing, Two Pointers, Prefix Sum, Sorting Implementations
Tip

Tip 1: Build a strong resume reflecting your coding skills for the resume shortlisting round. Include some achievements to highlight your resume.

Tip 2: Have good knowledge of data structures and algorithms.

Tip 3: Be proficient in at least one coding language.

Application process
Where: Other
Eligibility: No current backlogs
Resume tip

Tip 1: Build a strong resume reflecting your coding skills, including some simple projects in any tech bucket.

Tip 2: Mention some achievements to highlight your resume and set yourself apart from other candidates.

## Interview rounds

01
Round
Easy
Video Call
Duration45
Interview date7 Feb 2020
Coding problem2

The round was held in the evening, and it was a telephonic interview conducted on Google Meet. The interviewer was very friendly and told me to relax and stay focused.

### 1. Maximum Deletion Operations

Moderate
15m average time
85% success
0/80

Given an array A[] of size N, find the maximum number of operations required to delete all the elements from the array such that in one operation, if you delete the ith element (A[i]), you must also delete A[i] +1 and A[i] - 1 elements, if present.

Problem approach

I had the most optimized approach right from the start, as the question was straightforward and the interview time was very limited. My approach was to sort the array in ascending order and check the condition on the next element, incrementing the pointer accordingly until we reach N. The interviewer was satisfied with the approach and instructed me to code it directly.

If the size of the...

View more

### 2. Count Nodes Between Root and Given Node in a Generic Tree

Moderate
25m average time
60% success
0/80

Given the root of a generic tree and a node N, count the number of nodes between the two (inclusive both).

Problem approach

I used tree traversal using recursion. When you reach node N, return 1 from there (base case) and accordingly increase your count in the recursion itself. The interviewer was satisfied with the approach and instructed me to code it directly.

What if node N is not present?

Is node N the address of that node or the node value?

02
Round
Medium
Video Call
Duration45
Interview date7 Feb 2020
Coding problem2

Duration : In the evening

### 1. Minimum Frequency Check in Array

Easy
10m average time
90% success
0/40

Given an array A[] of integers of size N, check if every element of the array has a frequency >=2.The problem was displayed in a tricky manner. (A real life problem was mentioned before me)

Problem approach

I provided two approaches for the same problem, one using hashing and the other using sorting, specifying the space and time complexity for each. The interviewer instructed me to code using the sorting approach.

If the value of N is 1, return false.

### 2. Count Subgroups of Consecutive Elements

Moderate
15m average time
80% success
0/80

Given an array A[] of size N, find the number of subgroups you can create from this array such that each subgroup should consist of 5 consecutive elements.

Problem approach

I initially explained the approach using a frequency array and traversing it. The interviewer pointed out that the constraints for A[i] were very high, so creating a frequency array was not feasible. I then used hashmaps to store the count of each element and traversed from the smallest to the largest element, storing the answer concurrently.

What if the array does not contain duplicates?...

View more

Here's your problem of the day

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

What is the result of 4 % 2?

Start a Discussion
Similar interview experiences
SDE - Intern
3 rounds | 4 problems
1384 views
SDE - Intern
2 rounds | 4 problems
3948 views
SDE - Intern
2 rounds | 4 problems
1127 views
SDE - Intern
2 rounds | 3 problems
9169 views
Companies with similar interview experiences
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
13169 views