Just finish Meta onsite, share questions here to give back to the community that gives me so many help along this journey.
phone screen
- Subarray Sum Equals K (only positive numbers could use sliding window)
- Clone graph (need to specify input and output yourself)
virtual onsite
- minimum departure and return cost (2 arrays, one for departure and the other for return)
- merge 3 sorted arrays
- given an array, randomly output index of the maximum value in array
- given an expression such as ( + 3 2 ( * 4 6 ) ), return its output value
Overall, pretty good experience with coding. They are not using exact questions from LC but similar enough. Keep fighting guys! It is not that hard.
Update:
Thanks for all the replies. I would try to answer all follow-up questions here.
- For clone graph problem, yes you need to come up with your design for the node class, so there is some ambiguity here. No function is needed for the node class, just definition and attributes.
- For the randomly return index problem, you don't need to do it in one pass. Actually I just coded out the hashmap method with O(n) time and O(n) space. Then when he asked if we could have better space complexity, I briefly explained reservoir sampling (but didn't need to code it out).
- For the expression question, yeah I think it is definitely a hard level question. At first I couldn't figure out it is a Polish notation lol. But the interviewer explained it. It has the parenthesis so need to use stack. I coded out an O(n) method and validate with one test case. Not sure if there is some minor bugs there but overall he seems to be satisfied. For coding part I think you need to be very very familiar with the most recent questions. You only got around 15-20 mins to code out basic calculators lol. Honestly I was so relieved when I finished it.
- For MLSD it is similar to harmful content detection.