Hi Everyone,
Today I have given interview at google for SDE L4. Recruiter has asked one question, which I was not able to give prooper solution.
I need help of you guys to come up with the solution.
Question was as below,
Given tasks Tasks, we have to schedule it on one core CPU on the basis of minimum execution time and arrival time of task, (i.e. kind of non preemptive Shortest Job First algorithm).
Example: Input: [['id1',0,10],['id2',3,7],['id3',5,3]]
where 'id1' represents Id of the task, 0 represents arrival time and 10 represents execution time.
Output: ['id1','id3','id2']
Hoping for solution.