- Published on
Meta E5 US - Rejected
- Author
- Shared Anonymously
Screener (passed):
- https://leetcode.com/problems/k-closest-points-to-origin/description/
This was simplified version where you could assume "Dist" function implemented. Basically I think interviewer was looking to see if I knew what a heap was and how to utilize it correctly (e.g. min vs max. heap)
- https://leetcode.com/problems/binary-tree-vertical-order-traversal
Exact same as leetcode description. Use offsets, BFS, and track min/max offsets (rather than sort) to most efficiently iterate through keys and construct result.
Onsite:
- https://leetcode.com/problems/can-place-flowers/description/ - I spent too much time on this one, got nervous
- https://leetcode.com/problems/simplify-path/description/ - They modified this question so you're given two arrays:
a. pwd
b. cd
Basically starting from pwd and given a cd string (e.g. pwd: /home/melder/goonfolder/ and cd: ././tobesorted) return the result path (/home/melder/goonfolder/tobesorted)
only "..", "." and lowercase letters between the slashes (for example no double slashes //), so slightly easier conditions than the leetcode question, but it came with a twist which I missed: need to be aware of leading "/" to differentiate absolute vs relative pathing.
Since I spent too much time on 1 I tried to blaze through this one. I forgot to pay attention to "/" as first element of cd string. I think I got it mostly right but did not have time to really test
- https://leetcode.com/problems/random-pick-with-weight/description/
They complicated this once by using a tuple as array elements, e.g: (1, "blue"), (5, "red"), etc... the random function they want you to return "red", "blue", whatever instead of the index. Again got nervous and forgot about prefixing so spent too much time here + doing the mechanical part of separating the tuple into the indexes and doing binary search on those.
- https://leetcode.com/problems/powx-n/description/ - Exact same. I unfortunately never did this one so obviously could not solve it in 20 minutes. I have some friends with PHDs in math / physics and asked them if they could solve it in 30 minutes and even they couldn't figure out the optimal solution in that time frame. So kinda bullshit that this is being asked during interviews at all IMO.
System design:
Design a system that takes user ad impressions and returns aggregated time series to ad creators. Basically a time series design question similar to monitoring systems, stock market, etc. I wasn't super prepared + interviewer was distracted and didn't make an effort to discuss / cooperate in finding an acceptable design. Kinda like coding question #4 they kinda seem to expect you to know the general solution beforehand, which is kinda silly.
Anyway, hope you all have better luck than I did. My honest impression is you better know the answer beforehand, pretend you don't, and do the necessary theatrics where you pretend not knowing but demonstrate what a genius you are by optimally figuring out these tough questions in 15 minutes.