Interview Question
- 0of 0 votes
Answersyou have a table of 2 columns , describe task scheduler, tasks can't run unless other tasks it depends
- Dr.H October 14, 2012 in United States for SQL Server / DPG Group
on finished running
Task | Depend
-----------------------
A | B
B | C
C | D
and so on ..
from that table design an algorithm that output the task workflow execution in sequence.
A->B->C->D
it can be repeated , there can be loop cycle .
design an algorithm that output this in O(n) , space is not an issue.
anyway it was very though question you need to ask as many question as you know .
after this hard time , the solution will use a graph to represent the relation first
then you will traverse the graph to output the workflow.
in the final you need to have a knowledge of Topological Sort to be able to solve it.
so if you will not depend on luck try to study graph and graph algorithms very hard before you go .| Report Duplicate | Flag | PURGE
Algorithm
Country: United States
Interview Type: In-Person