gravatar

Blog # 25 : Adobe placement questions 2009


---Written---
 
    1) aptitude
    2) Engineering: easy questions test of speed
        2a) complexity of a given algorithm?
        2b) given grammar draw automata
        2c) draw binary tree from preorder and in-order etc.
       
    3) programming: easy questions test of accuracy/corner cases
        3a) check overflow of sum of two numbers

int a,b;//two nums 
int c=0; 
int count=0; 
while((a>0)&&(b>0)) 
{ 
    count++; 
    c=c|(a&1)&(b&1); 
    a>>1; 
    b>>1; 
    if((count==32)&&(c==1))    
    printf("overflow"); 
}
        3b) sorting array of 0 and 1

Counting sort will be helpful or just count the number of 0's in one pass and in next pass put as many 0's as the count in the array and rest of the element be 1.
The sort is O(2n)=O(n)
 
        3c) anagram of given string
        3d) simple question on pointer to pointer...etc

    P.S search google for adobe written paper questions. Questions remains almost same generally.
 

---Interview---- 
1)HR
        1a)Tell me about yourself
        1b)Extra-curricular activities from CV, what you did in school
        1c)How many lamp-posts are in India? Tell how to solve?
        1d)Anything else you want to share

    P.S In questions of type 1c whatever logic you give try to avoid backing out of what you stated earlier. Try to give reasoning for whatever you say. Eg . I would google this and that . And infer this. He will ask you supporting reasons.     
 

2) Tech1
 

        2a) Will ask to explain questions from written paper.
           What is your favorite subject?
        2b) Tell me something about memory mgmt, how virtual memory,
           page faults.

mem management: All process requires resources to be allocated to them which must reside in the main memory for the process to run properly. Memory management is a way to manage the allocation of the process and the resources in and out of the main memory. Once the process is allocated memory, it fights for CPU allocation where CPU management comes into play. Till the process is not in main memory its the job of memory management algorithm to efficiently allocate resources for the process and their resources.

virtual memory: Virtual memory is a way in which the process is allowed to execute although only partial process resides in main memory. The user is able to run the process even if the size of the process exceeds memory size, as the portions of process is brought in memory as and when required,thus excluding the need for complete process to reside in memory.


page faults: As under virtual memory management scheme pages are brought in main memory as and when required, whenever a reference is made by a process to a page that is either invalid or presently not their in main memory, page fault occurs. Exception is thrown to the op sys that handles the exception by bringing that page in main memory and restarting the execution of the process.

 
        2c) TCP half-closed , hand-shaking

TCP half closed: Whenever two process are communicating with each other, whever one process wishes to close the connection it sends a packet(dont remember what it is said) to the other process. The other process replies by sending an ACK so that the first process stops sending data. Although the second process can still communicate by sending its data. Thus the link is half closed and half open. This is TCP half closed.
 
        2d) Given a sorted array (eg 2 5 10 12 34 60 ) rotated about an element (eg 34 60 2 5 10 12 about 12) how to search for an element?(Hint: this problem is known as ROTATED BINARY SEARCH)   

[its just my answer]
Suppose there are n elements, piv be the pivot index,
if(search_ele>Arr[piv])
   bin_search(0,n-piv);
else
   bin_search(n-piv,n);

bin_search is the normal binary search

 
        2e) From the point I enter www.google.com into the browser, till the point page is fetched what all happens?

[This is again what I know at present and may be incorrect]

First domain name is matched to get the ip address, the page is looked up in the browser's cache memory to see if the page exists, if it so exists the page is loaded without referring to the server of google.com, else the request is send to the server from where the page is sent back which is loaded in the browser.

[There may be more details that I am not confident at present]
    3) Tech2
 
        3a) Write atoi()? (Tip: Never forget the corner cases)
        3b) write the code for anagrams, next permutation
        3c) bitwise operators. count ones, check even, etc
        3d) Code the solution to 8 queens problem
        3e) A generic binary search in C that would work with any type and comparison function?(Hint: Use function pointers and void array and size of the type and elmt to find as params)
        3f)What are smart pointers ? Write such a class using templates.
 

    4) Tech3
 

        4a) write function/prototype to overload some operator
        4b) Data structure for a 3D object, a paper weight ?
        4c) How would you detect a collision between 2 3D objects for eg. while programming a game detect a collision b/w a car and a pillar/wall.

P.S This is by no means an exhaustive list. It gives a range of topics that can be asked (algo, programming, networking , os, graphics, ds )
 

Tip 
1)The questions also depend on what the interviewer knows so for preparation try to cover everything (D.S, algo, C++, OS-deadlock , synchro, memory mgmt)
2)Try to write the working code for programming questions mentioned above




p.s. - Thanks Mr. Pankaj Kanchandani for providing this document.