EMC Interview Question: Find the logical error in the... | Glassdoor

Interview Question

Senior Software Engineer Interview Nashua, NH

Find the logical error in the Linkedlist reversal program

  (the program was given). Need to use the gdb tool to debug and correct the program.
c/c++ programming.

Interview Answer

1 Answer


The linked list should be reversed in one pass. This uses stack datastructure.
As you traverse the linked list from head node to tail node, take the node and put it in the front of the new linked list (i.e. reversed output linked list).

They basically check if you can use debugger tools to find/correct the error in the program.

Interview Candidate on Oct 1, 2010

Add Answers or Comments

To comment on this, Sign In or Sign Up.