NetApp Interview Question for Software Engineer / Developers


Team: wafl
Country: India
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
0
of 0 vote

We can use DFS for cycle detection and i don't think there is any better way to represent it apart from what we usually do for lower order trees ( using pointers ) unless you need to address certain special properties.

- Cerberuz December 13, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

You can use a graph to represent it. And then run a DFS on it for cycle detection.

- code4ghana December 14, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

in c this will be your datastructure: node{int val; node* child_nodes; int child_count} and use DFS for cycle detection

- The Artist December 14, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Sorry i dint get the struct.
Can u explain how can one find a particular node using that strucuture??

- jayesh December 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

imagine child_nodes as an array of node and child_counts to be the length of that array so you can refer to the ith child as child_nodes[i-1] something similar to a two dimension array which is nothing but array of arrays

- The Artist December 16, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

You can use DFS with backedge approach. Backedge is, you have pointer from your new node to already visited node.

- keyurpatel80 July 04, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Please some one post the code to traverse in postorder and check for cycle

- sunny346 October 13, 2016 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More