I recently interviewed at google for the role of SWE Undergrad 2021 and sadly couldn't make it through. Although the interviewer was very friendly but I believe a bit more practice of certain topics like segment trees and sparse tables would've helped me to clear this round with flying colors.
Anyway, not focusing more on my rejection part and would like to share the interview experience with this community! The question was-
Given an array arr[], the task is to answer stream of queries to find the maximum of all the elements in the index range arr[L…R] within O(logn) time.
I gave a solution involving precomputation and storing max for each range using previous max values.
I did some follow up and came to know that this is a classic range query problem and could be solved more efficiently using segment trees or sparse tables.
Aghh I didn't expect a segment tree question in the first round itself so didn't focus majorly on this topic during my final prep!! My bad :')
Hope this helps and more importantly, may the force be with you!