Snapchat Uber | Minimum time to complete all tasks

Anonymous User
8062
Oct 06, 2020
Oct 06, 2020

I was asked the same question in Snapchat phone screen as well as uber onsite. The question goes as follows.

There are some tasks/microservices n1, n2, n3, n4 etc. You will be given a dependency list for eg
[(n1, n2), (n2, n3)] signifying n1 depends on n2 and n2 depends on n3 and so on.

Every task/microservice needs time to execute. The time for task/microservice is t1, t2, t3, t3 for n1, n2, n3 and n4 respectively.

The task is to find the minimum time to complete all tasks.

I used topological sort to solve it but apparently it was not the best possible answer.

Comments (11)