Google L4 Chances
Summary
I completed Google's preliminary rounds; I could solve the first part of a modified Count Visible People problem in O(n) but couldn't optimize the full-array version, while the Googlyness round went well.
Full Experience
Hi all,
I had my Google preliminary rounds today and feeling a bit uneasy about how it went.
DSA Round:
I was given a question similar to “Count Visible People” but with a twist in visibility rules.
In this version, if the observer is taller, shorter people in between don’t block the view.
Example:
Array: 1, 10, 6, 7, 9, 2, 4, 5
For 5, visible people are: 4, 2, 9, 10
(In the usual LeetCode version, 2 wouldn’t be visible, but here it is.)
For the initial part, I was able to write an optimal O(n) solution.
Then the interviewer asked a follow‑up to compute it for the entire array.
I gave a brute force solution (O(n²)) verbally.
When asked to optimize, I tried a few approaches but couldn’t reach a correct solution in time.
Toward the end, I wrote a monotonic stack based pseudocode, but later realized it was incorrect.
After the interview, I tried to upsolve it. One alternative I found was using a segment tree, but that would be around O(n² log n), which is actually worse than my brute force. So now I feel my initial verbal solution might have been the best possible here.
Honestly, this round didn’t feel that strong. I feel interviewer wasn’t very impressed.
Googlyness Round: This went really well. The discussion felt natural, and I was able to answer everything confidently. This is the only part I feel good about.
For Google, is it still possible to move to next (on‑site) rounds with one average DSA round but strong googlyness round?
How long does Google usually take to get back after prelim rounds?
Right now it just feels like I missed it by a small margin, which is kind of hard to shake off.
Would really appreciate honest insights from people who’ve gone through loop.
Interview Questions (1)
Modified Count Visible People
Given an array of integers representing heights, compute for each position the set of people visible to the observer at that position with the following rule: if the observer is taller than the people in between, those shorter people do **not** block the view. In the standard "Count Visible People" problem, any taller person blocks the view, but here the rule is relaxed for taller observers.
Example:
- Array:
1, 10, 6, 7, 9, 2, 4, 5 - For the observer at height
5(last element), the visible people are4, 2, 9, 10. Note that2is visible despite being between5and9because the observer (5) is taller than2.
The task may ask for the visible set for a single index (initial part) and then for every index in the array (follow‑up).