taskList: Each row contains [task_id, duration]
dependencyList: Each row contains [task_a, task_b], meaning task_a must be completed before task_b can start
Return the total duration to complete all tasks and the order in which tasks will be completed.
Problem: Employee Access Management System
Design an Employee Access Management System with the following requirements:
Entities:
Multiple employees(E1 , E2 , E3 , ....,En)
Multiple resources (R1 , R2 , R3...Rn)
Three types of access: READ, WRITE, ADMIN
Methods to Implement:
grant_access(employee_id, resource_id, access_type)
Grant specific access to an employee for a resource
An employee can have multiple access types for the same resource
revoke_access(employee_id, resource_id, access_type)
Revoke specific access from an employee for a resource
If access_type is None/null, revoke all access
retrieve_access(employee_id, resource_id)
Return all access types an employee has for a specific resource
Return empty list if no access
retrieve_resources(employee_id)
Return all resources an employee can access .