Google Interview Questions:
Recruiter’s Email: October 19, 2024
Obtain the inorder predecessor and successor in a binary search tree. Follow up: without using extra memory
Self-evaluation: Hire
Took some time to modify the binary tree for parent pointers, hence not a strong hire, but did successfully code both question and follow-up within 35 minutes.
Given an array, return the largest subarray that is a special arithmetic sequence.
Self-evaluation: HireManaged to code the solution using a two-pointer approach in around 45 minutes.
A graph-based question. Alice and Bob are two friends in two cities. They want to go to a destination city, and they are open to cab sharing after meeting in a common city. Return the minimum cost of their travel.
Self-evaluation: Strong HireUsed multi-source BFS with hashmaps for optimisation. Interviewer was positive and impressed. G&L round here also went very well, it was a light-hearted and fun discussion.
We have been given a file with IP Addresses and their respective locations. We have also been given a query IP address, for which we need to obtain the location. Return the city to which the IP belongs. Follow up: instead of a single query, there are multiple queries in an array.
Self-evaluation: Lean No HireTook a bad turn into tries when followed up with multiple queries. Did code the optimal binary search approach, but was a little tensed, hence made small mistakes that I corrected under the time limit without any hints from the interviewer. The interviewer was a bit non-communicative, so the G&L round felt like a quiz with pre-meditated questions.
Additional rounds:
We have been given a file that has chat logs between people. We need to obtain the top n talkative users, where the most talkative user is the user with the highest count of words. Follow up was given by amending the file structure.
Self-evaluation: Strong HireCoded the entire solution using heap within 30 minutes. Initial code was dynamic in nature so the follow-up was already addressed in my solution. Interviewer was impressed, hence had an informal and friendly discussion for the remaining 15 minutes.
We have been given two arrays of two classes - Apartments (flat_number, no_of_bedrooms) and People(name, preference). There are people who prefer a single bedroom apartment (preference = False), and there are people who prefer having housemates : multiple bedroom apartments (preference = True). We need to prioritise preference of the people, but ensure that as many people are housed as possible.
Self-evaluation: Strong Hire Coded the initial solution in 35 minutes using heaps, interviewer was impressed with the code quality and clarity. Told me to expect a positive response from the recruiter soon.
Situation today:
They have told me to wait for a decision. The overall interview feedback is good, but apparently the hiring decisions for the 2025 batch are currently staggerred so it might take them till mid-June to deliver a concrete response.