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

SDE - Intern

Google
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 4 months
Topics: Data Structures, Algorithms, Arrays, Trees, Hashing, Two Pointers, Prefix Sum, Sorting Implementations
Tip
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
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
Asked in companies
AdobeGoogleRubrik, Inc.

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 array is 1, return 1.

Try solving now

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

Moderate
25m average time
60% success
0/80
Asked in companies
AmazonOracleGoogle

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?

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

Telephonic round on Google meet. 
Duration : In the evening

1. Minimum Frequency Check in Array

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

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.

Try solving now

2. Count Subgroups of Consecutive Elements

Moderate
15m average time
80% success
0/80
Asked in companies
GoogleQuikrWalmart

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? The solution approach changes if the array has only distinct values.

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 write a single-line comment in C++?

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
SDE - Intern
3 rounds | 4 problems
Interviewed by Google
1415 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Google
4068 views
2 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Google
1194 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Google
9356 views
4 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
13361 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
12385 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
8921 views
2 comments
0 upvotes