Virtual onsite consisted of 4 rounds, 3 coding + 1 behavioral.
Behavioral was easy and basically chatting with the interviewer, super chill.
Coding 1 was a LC medium.
float temperatureRecord(float temperature,Instant time)
the ask is to return maximum temperature in last 24 hours, for every call of this method in a sliding window fashion.
eg : if (x,y) represents the input parameters, for input : [(24,0),(14,8),(21,16),(20,25)]
the o/p for each of these calls would be [ 24, 24, ,24, 21]Discussed heap solution and deque solution and implemented cleanup solution as followup. Interviewer seemed satisfied.
Coding 2 was this problem https://leetcode.com/problems/shortest-way-to-form-string/
I came up with brute force, then thought it was DP. Came up with O(MN) greedy, but interviewer wanted better. Struggled to come up with O(log M * N) solution using binary search, and O(N) solution via flattening the dict so ended up implementing O(MN) greedy. Prob no hire for this.
Coding 3 was an interesting one. Interviewer said he came up w it himself lol.
Essentially implement git bisect (binary search) with followup being given a parallel function and asked to optimize from O(Log(base 2)(N)) to O(log(base M)N); ended up finding right intuition and implementing but didn't have time to finish.
Overall easier problems than I expected but prob didn't nail all the followups.
Result: Still waiting, wish me luck y'all
Edit:
Just got the rejection sadly.
Takeaway is just to do more LC; I was very close I was told
It's a crapshoot, but oh well, better luck in a year
From thread:
#1 is like https://leetcode.com/problems/stock-price-fluctuation/solution/
#3 is like https://leetcode.com/problems/first-bad-version/ with a twist of using base n binary search instead. To clarify, the scenario is that you are running tests, which take a while, and tests fail sequentially after the first one. The goal is to identify the first failing test. You can use binary search in git bisect fashion. The follow up is if you are given a function compute(M), which allows you to run M tests in parallel -- how would you optimize