Google Interview Experience
Anonymous User
3268

Google : First Attempt : CPU Scheduling Alborithims

needs to check can we complete all of the process in given start and arrival time with allocated CPU numbers;

if time is running out they can take one a cpu from their bucket and else they can take from outside of bucket
[10,20,2]
Here 10 is start time
20 is end time
2 is CPU Number

[[10,20,2], [40,20,3], 5] --- still i don't know how to solve this

Google Second Attempt: Needs to calculate the file sizes of directory .

[{id : 286, is_dir: true, files: [2,3,4], size: 10}, {id : 2, is_dir: false, size: 220}]

Above one i gave the solution with O(n ^ 2) with recursion and memo .

But interviewer was looking for more optimal solutions

Comments (10)
No comments yet.