google | Full-Time | Interview Experience
Interview Date: Not specified
Result: Not specified
Difficulty: Not specified
Interview Process
The interview was conducted via Google Meet using an online editor without syntax highlighting. It began with casual conversation about my background before moving directly to the coding questions.
-
First Round Coding: The problem was related to intervals, similar to the Meeting Rooms III problem. I spent about 10 minutes clarifying the problem and provided an optimal solution. During the dry run, I fixed a bug and simulated two test cases, discussing time and space complexity. The interviewer was satisfied with my answer.
-
Second Round Coding: I was asked to determine if subarrays within specified intervals had adjacent elements alternating in odd and even values. The solution involved preprocessing to build an auxiliary array that marked the parity of adjacent elements. For each query, I checked if there were any consecutive elements with the same parity in constant time.
-
Third Round Coding: Given an array
nums, I needed to find the shortest contiguous subarray containing at leastkdifferent integers. If no such subarray exists, I was to return -1. I initially discussed a brute-force approach that enumerated all subarrays to count distinct elements, but noted its O(n²) complexity. I then optimized the solution using a sliding window and frequency hash table, maintaining the window[l, r], wherecnt[x]recorded the frequency of elements anddistincttracked the count of different integers, achieving O(n) complexity. -
Fourth Round: This round focused on discussing my personal projects and internship experiences, along with behavioral questions about future plans and the classic question of why I wanted to join Google. No coding questions were asked in this round.
Technical Questions
- Meeting Rooms III (Greedy, Sort)
- Subarray with Odd Even Alternating Numbers (Array)
- Shortest Subarray with K Different Integers (Sliding Window)
Tips & Insights
The feedback from the HR was positive, and I am currently in the team match phase.