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

SDE - 2

Google
upvote
share-icon
2 rounds | 2 Coding problems

Interview preparation journey

expand-icon
Journey
I have applied to Google many times and usually received either a rejection email or no response at all. Recently, I saw a job opening on the careers page and applied directly for the role. I wasn’t expecting a response this time either, but the recruiter called me to discuss the position and asked if I was interested. I had already been preparing, but after that call, I resumed my preparation with renewed focus.
Application story
I came across a job opening and applied directly through the careers page. A few weeks later, I received a call from the recruiter. After the call, a basic screening was conducted, during which I was asked about my preparation, my problem-solving practice, and whether I needed more time. I was then given one week to prepare.
Why selected/rejected for the role?
After two rounds, the role was closed and the hiring process was stopped. I was informed over a call that I would be moved to the next round, but I never heard back from them. A few months later, I was notified that the role had been closed.
Preparation
Duration: 0.5 month
Topics: ChatGPT said: Data Structures, Algorithms, OOPs, Basic HLD, Basic LLD
Tip
Tip

Tip 1: Keep your resume updated.

Tip 2: Practice problems daily.

Tip 3: Try to observe patterns in problems.

Application process
Where: Company Website
Eligibility: Good problem solving, (Salary Package: 32+ LPA)
Resume Tip
Resume tip

Tip 1: Focus on improving problem-solving skills,

Tip 2: Try to identify patterns and solve some company-specific problems.

Interview rounds

01
Round
Easy
Telephonic
Duration20 minutes
Interview date22 Jul 2024
Coding problem0

I was asked about my preparation, work experience, and problem-solving involvement. Then, they explained the hiring process and their expectations for the role. Based on our conversation, my next round was scheduled a week later.

02
Round
Medium
Video Call
Duration45 minutes
Interview date31 Jul 2024
Coding problem2

After the first round, I received an email for the next round, which was a DSA round. There were two questions — one based on maps and the other on trees. I was a bit nervous but managed to solve and optimize the first problem. For the second problem, I initially missed one condition, but after receiving a hint, I was able to complete the solution.

1. Maximum Island Size in a Binary Tree

Moderate
0/80
Asked in company
Google

You are given a map represented as a binary tree. Each node in the tree is a block of land or water. A node with a value of 1 represents a land block, and a node with a value of 0 represents a water block.


An "island" is defined as a connected group of land blocks. In this tree structure, this means an "island" is a subtree where every node has the value 1.


Your task is to find the size of the largest possible island on this map. The size is the total number of nodes in that island (subtree of '1's).


Problem approach

I was asked to provide an example and come up with an approach. I discussed my approach and performed a dry run on the given test cases. After explaining it, I coded my solution and did a quick check to ensure there were no errors. I then asked the interviewer to review my code, and they informed me that I was missing a small check, which I hadn’t noticed.

Try solving now

2. Invariant Pairs

Easy
0/40
Asked in company
Google

You are given a list of N integers, a. Your task is to compute the number of ordered pairs of indices (i, j) that satisfy two conditions:


1) i != j


2) a[i] - a[j] = i - j


An ordered pair (i, j) is different from (j, i).


Insight: The condition a[i] - a[j] = i - j can be algebraically rearranged to a[i] - i = a[j] - j. This means we are looking for pairs of distinct indices (i, j) where the value a[k] - k is the same.


Problem approach

I was able to solve the problem in O(n²) time complexity, but then I was asked to optimize it, so I used an unordered_map.

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

Which SQL clause is used to specify the conditions in a query?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
1 rounds | 2 problems
Interviewed by Google
3541 views
1 comments
0 upvotes
company logo
SDE - 2
1 rounds | 1 problems
Interviewed by Google
9218 views
0 comments
0 upvotes
company logo
7 rounds | 16 problems
Interviewed by Google
4566 views
0 comments
0 upvotes
company logo
SDE - 2
4 rounds | 4 problems
Interviewed by Google
7942 views
1 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 2
5 rounds | 12 problems
Interviewed by Walmart
29182 views
8 comments
0 upvotes
company logo
SDE - 2
3 rounds | 5 problems
Interviewed by Amazon
6537 views
1 comments
0 upvotes
company logo
SDE - 2
6 rounds | 8 problems
Interviewed by Amazon
5025 views
0 comments
0 upvotes