Microsoft Interview Question
Software Engineer / Developers1. Sort the lists
Pseudocode:
RemoveIntersection(*list 1, *list 2, **list3)
{
continue this loop till either of the list becomes NULL and after that simply append the nodes of the remaining list (non-empty list) to the new list (list3)
if(list1->value == list2->value)
{
newNode = list1->value
list1 = lis1->next
list2 = list2->next
}
else if(list1->value < list2->value)
{
newNode = list1->value
list1 = list1->next
}
else
{
newNode = list2->value
list2 = list2->next
}
if(*list3 == NULL)
*list3 = newNode;
else
*list3->next = newNode
}
MS IDC makes fool of people.
People have to come to office on weekends due to workload and do night outs, no work life balance. They pay 10-20% more make people labour.
Do take the feedback from employees before joining MS.
And work is junk, all junk wor from Redmond is transferred to IDC. Ask any team, whether they design, implement products or just do porting or maintenance or make tools.
This is not entirely true. I agree work life balance is screwed. Its more because the IDC managers want to show their US counterparts that they can chew more than they can bite. The other comment about shady work I donot agree completely. I agree most groups do useless work but some groups do cool work. So figure it out before joining.
intersections?? there can be at max one intersection
- nutcraker May 28, 2010first task is to remove the intersection, this should be non-recursive part(count nodes in both the list, move by the difference in the longer list and move parallel an check if pNode->next is same for both the lists. The moment it is found, make the next of shorter list NULL. Now there are two lists that need to be merged recursively.