I interviewed here earlier this year. Snap didn't seem to have any exact LeetCode-original questions, so I'm writing this mostly from memory.
Round 1:
You're given a list of timestamp events (unordered, can repeat), something like [12:00:01, 01:02:02, 03:03:03]. Implement a query function: given a start time and end time, compute how many events fall in that window. For example, [01:02:01, 01:02:03] would only contain one event, while [01:00:00, 04:00:00] would contain two. I used a hash table plus prefix sums plus binary search.
Round 2:
You're given a set of cards, each with a letter on the front and a letter on the back, like [['a', 'b'], ['c', 'd']]. Each card can only be used once, and on each use you can only take the front or the back. Determine whether you can spell out a given string using these cards. For example, "ac" is possible, but "ab" is not. I did this one with a trie plus backtracking. The second question in this round was: given N already-sorted lists, merge them into a single sorted list. A heap does the job.
Round 3, I honestly don't remember this one well anymore, and this is probably also the round I got rejected on. Just agreeing with the interviewer on what the problem actually was took over 10 minutes, and the follow-ups took another 7 or 8 minutes. In the end I only managed to hack together a brute-force solution.
System design: something like a news aggregator system, except the news sources don't support RSS, so you have to call an API to pull the content instead.
Discussion
Loading comments…