## AMD Interview Questions

- 0of 0 votes
You have a cycled doubly linked list (meaning there is a cycle and each node has prev() and next() method).

You can set/check the value of each node in the list to be 0/1 (method setValue(0/1) getValue())

Find how many elements there are in the list.

You start from the some node and you don’t know the status of the nodes value, could be any combination of 1’s and 0’s)..

- -5of 5 votes
xz<x<x<

- -4of 4 votes
x<x<zx<

- 0of 0 votes
generate and print first N binary palindromes .

ex first 4 are as follow

1

11

101

111

- 0of 0 votes
Given N balloons, if you burst ith balloon you get Ai−1∗Ai+1 coins and then (i-1)th and (i+1)th balloons become adjacent. Find maximum number of coins you can gather.

If you have single balloon then you will get value written on it.

Example

if you have 4 balloons and coins associated for them are....

1 2 3 4 then you will get 20 maximum.

- 0of 0 votes
Given an array of integers, rearrange the array in such a way that the first element is first maximum and second element is first minimum.

Input : {1, 2, 3, 4, 5, 6, 7}

Output : {7, 1, 6, 2, 5, 3, 4}

- 0of 0 votes
Problem Statement

A group of scientists have broken down species DNA into sequences of integers. They determine that two species with the respective DNA sequences A and B are considered to be related if a non-decreasing sequence C of the same length can be found, such that Ci=Ai or Ci=Bi.

Given the DNA sequences for two species, help the scientists determine if they are related.

Input Format

The first line contains an integer, T, the number of test cases.

For each test case:

The first line contains an integer, N, the length of the DNA sequence.

The second line contains a sequence of space-separated integers describing species A.

The third line contains a sequence of space-separated integers describing species B.

Constraints:

1≤T≤5

1≤N≤105

0≤Ai, Bi≤1010

Output Format

On a new line for each test case, print YES if a non-decreasing sequence of the same length can be found (i.e.: species are related) or NO if it cannot.

3

3

1 2 3

4 4 4

3

3 2 1

6 5 4

2

1 0

10 2

Test Case 1: We could have C=1 2 4

Test Case 2: No increasing sequence C is possible.

Test Case 3: We could have C=1 2.

- -2of 2 votes
prim algorithm determine Minimum Spanning Tree java?help code java

- 0of 0 votes
Why manhole make of steel?

Why manhole round?