Adobe Interview Question Software Engineer in Tests


Country: United States


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

Assume Head node of the circular list contains minimum value

1. Compare circular.Head.Data to linear.Head.Data, if liniar's Data is smaller, replace circular Head, and move linear's pointer to next.
2. Do 1 until linear.Node.Data > circular.Head.Data
3. Do normal merge sort for those 2 under condition of

while (circular.Node.Next != circular.Node.Head) // If it equals to Head, it means it gets back to Head pointer

4. After the while loop, if still linear pointer is in the middle, insert Nodes at the last of cirsular list.

- nsdxnsk on August 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

When we merge two lists , we compare the smallest not inserted element of the the two list two decide which will be the new element of the new list. This is done till one gets empty. In this case empty for circular list would mean when iterator becomes equal to head again.

- words&lyrics on July 31, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

it is same as normal merging of two sorted lists...

- amnesiac on August 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

it is same as normal merging of two sorted lists...

- amnesiac on August 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

exactly the program is nothing but the merge function in merge sort algorithm..

- sam on August 04, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

a simple merge sort

- pramod on August 25, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

code for inserting a node in sorted cylic list.

void insert(struct node* aNode, int x) {
if (!aNode) {
aNode = (struct node*) malloc(sizeof(struct node));
aNode->data = x;
aNode->next = aNode;
return;
}

struct node* p = aNode;
struct node* prev = NULL;
do {
prev = p;
p = p->next;
if (x <= p->data && x >= prev->data) break;
if ((prev->data > p->data) && (x < p->data || x > prev->data)) break;
} while (p != aNode);

struct node* newNode = (struct node*) malloc(sizeof(struct node));
newNode->data = x;
newNode->next = p;
prev->next = newNode;
}

- Nishant Pandey on June 01, 2013 | Flag Reply


Add a Comment
Name:

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

Books

is a comprehensive book walking you through 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