Sharing my interview experience for the Google Summer Internship role. Hope this helps future interviewees 🚀
This round was mainly focused on understanding my background and technical exposure.
Problem Statement:
You are given coordinates one by one.
After each insertion, you need to check whether any four points seen so far can form a square.
A square can be formed using any subset of 4 points.
Approach:
For each new coordinate, I stored all points in a list and used a hash set to track visited points. Whenever a new point was added, I checked all possible combinations of four points involving the new point. For each set, I computed all pairwise squared distances and verified whether they formed exactly two distinct values corresponding to sides and diagonals of a square.
I was expected to:
Explain the logic, Write clean code, Do a dry run, Debug if needed, Discuss edge cases, Optimize the solution
Till the end of discussion, I was able to come up with a logic, coded, dry ran & addressed edge cases.
Due to time constraints, we couldn’t go into follow-up questions.
Interviewer ended with:
“Okay, see you in the next round.”
Which felt positive. 🙂
Problem Statement:
Given an array, find the sum of all subarrays that are in Arithmetic Progression (AP) with:
Common difference = 0 or 1
Every single element is also considered an AP
I explained the brute force (generate subarray & check), reasoned about the nature of AP to come up with an optimisation, however, time was running out.
What Google Focuses On:
✔️ Strong fundamentals
✔️ Clear thinking/ Problem Solving
✔️ Communication
✔️ Optimization skills
✔️ Culture fit
The interview process was intense but fair.
Interviewers were supportive and encouraged discussion.
Even when I didn’t get the most optimal solution, they valued my approach and reasoning.
Upvote if you liked!
All the best to everyone preparing. 💪