## Adobe Interview Question for Software Engineer in Tests

• 0

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.

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.

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

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

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

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

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..

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

a simple merge sort

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;
}

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.

### 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.