Adobe Interview

The test predominantly consists of algorithm questions and a lot of questions on trees.

Some questions are:

C test:

Q1) linked list using recursion.

Q2) Find if a number is divisible my 3, without using %,/ or *. You can use atoi().

Q3) 2 integers A and B are given, find the no of bits that need to be flipped in A to get B. ( xor a and b and count the number of bits)

Q4) Write a Rotate function for rotating elements in an array, using a reverse function.

Q5) Given 2 sorted arrays A and B with duplicate elements, get C= A -B and does not have duplicates(use a variation of merging 2 arrays and then remove the duplicates.)

Q6) Some routines to swap int pointers.

Q7) Subtraction of 2 base 13 numbers.

Q8) Min and max nodes of a quad tree.

Q9) Prove that in a tree no of internal nodes is one less than leaves.

Q10) A couple of boolean logic proofs

Q11) Code to see if a binary tree is a BST or not.

Q12) Switch case program out put

Engineering test:

Most of it had algorithms( no code)

Q1) Given an array with some repeating numbers. Like 12,6,5,12,6

output: 12,12,6,6,5
12 shud come before 6 since it is earlier in list. So cant use a dictionary.

Q2) Implement a dictionary manually with a lil overhead.

Q3)finding nth element from end in a list

Q4)inserting an element into a sorted linked list.


In the anal part many questions were based on the rule that square root of 25 is +5/-5. Not just 5. Similarly for 1.

Geometry the questions were a lil bit tricky, but they are few that u can ignore them.

6 comments:

  1. Engg test: solu-Q1:

    #include

    using namespace std;

    void display(int iarr[], int size){
    for(int i=0;i=a){
    iarr[idx+1] = iarr[idx];
    idx--;
    }
    iarr[a] = tmp;
    }

    void sametogether(int iarr[], int size){
    for(int i =0; i>input)
    iarr[i++] = input;

    cout<<"\n\nInputted array is : ";
    display(iarr, i);

    sametogether(iarr, i);

    cout<<"\n\nOutput array is : ";
    display(iarr, i);

    cout<<endl<<endl;
    system("pause");
    return 0;
    }

    ReplyDelete
  2. 2 integers A and B are given, find the no of bits that need to be flipped in A to get B. ( xor a and b and count the number of bits)
    Anser xor A and B and find number of bits sets in the final result.
    http://anandtechblog.blogspot.com/2010/06/how-to-find-number-of-bits-set-in-given.html

    Find if the number is divisible by 3.
    http://anandtechblog.blogspot.com/2010/06/check-for-divisibility-by-3.html

    ReplyDelete
  3. Rotation of an array.
    http://anandtechblog.blogspot.com/2010/07/rotation-of-array.html

    ReplyDelete
  4. Q11) Code to see if a binary tree is a BST or not.
    http://anandtechblog.blogspot.com/2010/12/validate-binary-search-tree-google.html

    ReplyDelete