To design algorithm to find dependencies of a specific node. Say for exampe there is an input stream 2d array in which nodes are given as [[7,11], [5,11], [3,8], [11,2], [11,9], [8,9],[3,10]] . Now for a given node say 2, the output should be [7,5,11,2] or [5,7,11,2]. Instead of numbers I was given characters.

I was not able to solve this question in time but interviewer asked me to solve it send it to his official email address. I solved it in next 1 and half hours and sent it.