SDE 2 @ Innovaccer
Summary
I interviewed for an SDE 2 role at Innovaccer and faced a non‑standard Trie problem to store and fetch API endpoints with permissions. I could not finish it during the interview and was likely rejected.
Full Experience
I was recently interviewed at Innovaccer for SDE 2 role, and I was astonished (because in previously asked question the max difficulty i saw was Trees not even graphs) to see the non standard problem that would be solved with Trie data structure.
R1 (Technical):
- Python Basic, Multithreading, async FastAPI etc.
- The problem was which they faced when they built an internal tool. Implement as DS to store and fetch the api endpoints and its http method and their permission.
Something like:
Store these:
/api/v1/user GET -> P0
/api/v1/user POST -> P1
/api/v1/user/{id} POST -> P2
/api/v1/user/{id}/profile GET -> P3
Fetch these:
/api/v1/user GET
/api/v1/user POST
/api/v1/user/123 POST
/api/v1/user/123/profile GET
Simply return the permission.
I could not solve it completely in given time but submitted the solution later on, in the doc. Most probably I am rejected but if not will update the R2 here.
Interview Questions (1)
API Endpoint Permission Trie
Implement a data structure (using a Trie) that can store API endpoints with HTTP methods and associated permission levels, and fetch the permission for a given request. Example storage:
- /api/v1/user GET → P0
- /api/v1/user POST → P1
- /api/v1/user/{id} POST → P2
- /api/v1/user/{id}/profile GET → P3
The fetch operation should accept a request such as:
- /api/v1/user GET
- /api/v1/user POST
- /api/v1/user/123 POST
- /api/v1/user/123/profile GET
and return the corresponding permission (e.g., P0, P1, P2, P3). The implementation must handle path parameters (e.g., {id}) appropriately.