Microsoft Interview Question for Software Engineer / Developers






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

traverse the array, and put all next pointer into an hashset. traverse again, see whether current node is in hashset, if no, it is the header

- Anonymous July 18, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

void isHead( struct node *nodeArray[], int n)
{
int i,j;
struct node *curr, *checHead;
Bool ishead = false;
for(i =0; i<n;i++)
{
curr = array[i];
for(j=0;j<n;j++)
{
chekHead = array[j];
if(curr == checkHead->next || checkHead->next == null )
{
break; // exist from inner loop as the address is some nodes next so it cant be head.
}

else
{
isHead = true; // node
}
}

}
if (isHead)
break;
}
}

- Anonymous April 05, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

we can work our way down the index in array and for each index we should traverse in the link list. now trick here is to mark the nodes which we have traversed. we can use a similar size array of int/char. and when we jump to the next pointer in a node we should set int/char array on that index as one. we can calculate indices by using pointer arithmetics. (index of next pointer = index of node + node-.>next - node) we can do it because it is all part of an array

- vishal Sharma May 05, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

can't understand the question

- Anonymous March 01, 2011 | 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