Screener (passed):
This was a simplified version where you could assume the "Dist" function was implemented. The interviewer was assessing my understanding of heaps and their correct utilization (e.g., min vs. max heap).
This question was identical to the description. I used offsets, BFS, and tracked min/max offsets (rather than sorting) for efficient iteration through keys and result construction.
Onsite:
a. pwd b. cd
Starting from pwd and given a cd string (e.g., pwd: /home/melder/goonfolder/ and cd: ././tobesorted), the task was to return the resulting path (/home/melder/goonfolder/tobesorted).
Only "..", ".", and lowercase letters between slashes were allowed (no double slashes //). The conditions were slightly easier than the question, but there was a twist I missed: the need to account for a leading "/" to differentiate between absolute and relative pathing.
Because I spent too much time on question 1, I tried to rush through this one. I neglected to pay attention to the leading "/" in the cd string. I believe I mostly solved it correctly but ran out of time for thorough testing.
Random Pick with Weight - This question was complicated by using a tuple as array elements (e.g., (1, "blue"), (5, "red")). The random function should return "red", "blue", etc., instead of the index. I became nervous and forgot about prefixing, spending too much time on this and separating the tuple into indexes for binary search.
Pow(x, n) - This question was identical to the problem. Unfortunately, I hadn't solved this before and couldn't solve it within 20 minutes. I discussed this with friends who have PhDs in math/physics, and even they couldn't find the optimal solution within 30 minutes. I question the appropriateness of this question for interviews.
System Design:
Design a system that processes user ad impressions and returns aggregated time series data to ad creators. This was a time series design question similar to those found in monitoring systems or stock markets. I wasn't fully prepared, and the interviewer seemed distracted and didn't actively collaborate in finding a suitable design. Similar to coding question #4, it felt like they expected me to know the solution beforehand, which I find unreasonable.
I hope this experience helps others. My impression is that it's advantageous to know the solutions beforehand, then feign uncertainty while demonstrating your problem-solving skills by efficiently solving these difficult questions within a short timeframe.