Software Engineer • Senior-Level
Software Engineer • Senior-Level
High QualityPrep Other Coding Questions Asked by Snap
Continue with targeted prep from Snap's coding question bank.
Interview Summary
The behavioral portion focused on a previous project, while the coding exercise involved implementing an ID assignment and release system. The first part allowed an in-memory solution, but the second part introduced a scalability constraint where the ID space was too large to fit in memory. I ultimately did not pass the interview.
Interview Details
Behavioral — Previous Project Deep Dive
The interview started with some standard behavioral questions. I discussed a project I had worked on previously, and the interviewer asked follow-up questions to explore the project in more detail. The conversation focused on my past experience and some of the technical details behind that work.
Coding Question 1 — Implement an ID Assignment and Release System
The coding problem involved managing a collection of unique integer IDs. I was given an integer N, representing the total number of available IDs. All valid IDs were in the range [0, N - 1]. I needed to implement two functions:
-
Assign()
- Returns an ID that is currently available.
- The returned ID must be between
0andN - 1, inclusive. - Each ID can only be assigned once unless it has been released.
- There is no requirement to assign IDs in any particular order.
- If all IDs are currently assigned, the function must return
-1.
-
Release(id)
- Releases a previously assigned ID.
- Once released,
Unlock Full Details
Create a free account to unlock this interview experience report.