Employee Resource Access Management
Updated
Problem statement
Implement an access-control service for employees and resources. One employee may hold several independent access types on the same resource.
Operations
Process rows in order and return one row for every operation.
["GRANT", employeeId, resourceId, accessType]: GrantREAD,WRITE, orADMIN. Return["true"]if a new grant was added and["false"]if it already existed.["REVOKE", employeeId, resourceId, accessType]: Revoke one access type. UseALLto revoke every access type the employee has on that resource. Return whether at least one grant was removed.["GET_ACCESS", employeeId, resourceId]: Return all access types currently held on that resource, sorted asREAD,WRITE,ADMIN. Return an empty row when none exist.["GET_RESOURCES", employeeId]: Return every resource on which the employee currently has any access, sorted lexicographically. Return an empty row when none exist.
Interviewer follow-ups
Interviewers asked candidates to preserve multiple independent grants, make revocation precise, and discuss how the data model and APIs would evolve for larger access systems.
Function
manageEmployeeAccess(operations: String[][]) → String[][]Examples
Example 1
operations = [["GRANT","e1","repo","READ"],["GRANT","e1","repo","WRITE"],["GRANT","e1","db","ADMIN"],["GET_ACCESS","e1","repo"],["GET_RESOURCES","e1"],["REVOKE","e1","repo","READ"],["GET_ACCESS","e1","repo"],["REVOKE","e1","repo","ALL"],["GET_RESOURCES","e1"]]return = [["true"],["true"],["true"],["READ","WRITE"],["db","repo"],["true"],["WRITE"],["true"],["db"]]Revoking READ leaves WRITE intact. Revoking ALL then removes repo from the employee's resource list.
Constraints
1 <= operations.length <= 100000accessTypeisREAD,WRITE,ADMIN, orALLwhere allowed.
More Rippling Onsite Interview questions
- Filter, Sort, and Deduplicate Scheduled TasksPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Stateful Log Transform and SearchPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Camel CardsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Corporate Card Expense RulesOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
- Limit an Organization Tree's HeightPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
- Delivery Cost TrackerPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
- Maximum Currency Conversion Along a Simple PathPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
- Top K Frequent WordsPHONE SCREEN · ONSITE INTERVIEW · Seen Aug 2026
- Future-Effective Employee SalaryONSITE INTERVIEW · Seen Aug 2026
- Filter and Sort Scheduled TasksONSITE INTERVIEW · Seen Jul 2026
Similar questions at other companies
- Random Dasher Set OperationsDoorDash · ONSITE INTERVIEWDoorDash interview questions
- LRU Cache for Query ResultsAmazon · PHONE SCREEN · ONSITE INTERVIEW
- In-Memory Filesystem CommandsPerplexity AI · PHONE SCREEN · ONSITE INTERVIEWPerplexity AI interview questions
- Rectangle Point Coverage CountsOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
- In-Memory Vault File SystemHarvey · ONSITE INTERVIEWHarvey interview questions
- Hash Map with Separate ChainingApplied Intuition · ONSITE INTERVIEWApplied Intuition interview questions
- Design Authentication ManagerOracle · ONSITE INTERVIEWOracle interview questions
- Hash Map with TTLNike, Inc. · ONSITE INTERVIEWNike, Inc. interview questions
- Least Recently Used CacheMicrosoft · OA · PHONE SCREEN · ONSITE INTERVIEWMicrosoft interview questions
- LRU CacheAMD · ONSITE INTERVIEWAMD interview questions
Interview reports that mention this question
- Rippling No-Level Onsite Loops: 24 Experiences (Part 5 of 6)
- Rippling No-Level Design, Screens: 30 Experiences (Part 2 of 6)
- Rippling SWE Interviews, No Level: 156 Experiences (Part 1 of 6)
- Rippling SDE-1 and SDE-2 Onsites: 14 Experiences (Part 9 of 12)
- Rippling Full-Time SWE Interviews: 224 Experiences (Part 1 of 12)