Showing posts with label Adobe. Show all posts
Showing posts with label Adobe. Show all posts

Friday, June 14, 2013

Adobe Interview of Samarth Gupta

Written:
It consisted of 3 sections viz Apti and Quant, C and Engineering.
C paper consisted of 10 questions that were based on pointers and functions.
Check if an expression has valid parenthesis

Engineering Paper:
  1. Each instruction on JVM is in byte code. How many such instructions are possible?
  2. Some Memory and Process Scheduling based scenario was given along with 4 options.
  3. Synchronization of two processes using the following code:
     boolean lock;  
     while(lock) ;  
     lock = true;  
     /* critical section code */  
     lock = false;  
    
    Is it feasible?
  4. Reverse a Singly linked list
  5. Check if a number is palindrome without converting it to string
  6. Implement multiplication recursively
  7. A number has 3 on it's unit place if one of it's multiples has 1 on all it's places. e.g. 111 is a multiple of 3, 111111 is a multiple of 13. You need to find such multiple of a given number. The multiple may be very large and exceed the limits. Don't use any complex data structures.
  8. A matrix having 0s and 1s is there. Each row can not have a 1 followed by a 0. You need to find the row having maximum 1's.

Interview 1:
It started off with compilers. Explain Parsing, different types of parsing, LR(1), LALR(1). 
Steps of compilation, explain lexical analysis, linker, loader.
Examples of syntax error, semantic error, linker error, relocatable addressing.

OS:
Process management, memory management, process v/s thread, file descriptor, synchronization techniques etc.

C/C++:
Some questions for output, overloading v/s overriding, structures v/s classes, inheritance, virtual functions, can constructors and destructors be virtual? why or why not? diamond inheritance problem, and a lots of questions on pointers. Some statements were there and I had to read them properly i.e. 
 int *p;  
 P is a pointer to integer  
Complex ones were there.
In C, functions are evaluated right to left. Why, any benefit?

Data Structures and algorithms:
Convert an expression from infix to postfix and vice versa (code)
Merge two sorted linked lists removing duplicates.
Reverse a Linked List (any other method than the one I had written in the engineering paper)
Height of a tree (he asked me more than one method. I was able to give 3 solutions)
2 sorted lists, you have to find the element of rank k in their merger without actually merging them

Assembly code to generate factorial of a number (I assumed some basic instructions like ADD, SUB, JMP etc)


Interview 2:
Design a base 64 encoder for an infinite stream of data.
Implement cin and cout using printf and scanf
Implement LRU Cache
Design a class to give following 3 functions in O(1):
  • void insert(int data)
  • void delete(int data)
  • int getRandom()

Serialization and de-serialization of a binary tree.
What are smart pointers?
How garbage collection works in java?
Malloc and Free
Maps (Hash maps) and how they work?
Average of 4 unsigned integers (simple addition might result in overflow)


Interview 3:
It was with the director of the acrobat team. Started off with my intro, what I do in leisure time, and it continued for next 20 minutes on Online Gaming. Next 20 minutes were on my project in snapdeal and next 20 mins were on what Acrobat Team does and how acrobat helps adobe earn profit.
Then he moved to DS and Algo:
Reverse a Doubly Linked List (proper code)
You are given an infinite sequence of words. what you need to do is when a new word is there, store it. whenever a word is repeated, throw an exception. Make sure you do not spend too much time in searching. Give a solution using some DS and design an algo for the same. Then this moved to phrases, then he asked me to store the sequence as well.
That's it..

Interview 4 (HR Round):
This was a casual round where we discussed about adobe, job profile, facilities etc. 

Hope it helps!
All the best.. :)

Wednesday, June 17, 2009

Adobe Interview of Sandeep Jain

Hi all,

Here it goes... :)

Written

I am not putting down the written questions as they were same to almost everyone else. But I would sincerely request that you practice all the written questions that are already available to you.


Interviews

I went through four rounds of technical interview. In all these they mostly asked about my internship at Trilogy, my current work in Decho. (So if you are going off campus make sure you are clear about your past experience)
Secondly since my interview was in Bangalore (arranged separately), The Bangalore interviewers were not aware of me being an on-campus, and they treated me more as an off-campus/experienced candidate. Probably thats why they asked a lot about my current and past work-ex.


Round 1

- Tell me something about yourself (and all those regular questions)
- Write the basic structure of linklist node?
- Now using this structure waf for reversing a link list? (I wrote iterative one)
- Show me the stack trace on this function for atleast three nodes.
- Write a similar recursive code, he again asked me to show the stack trace?
- How will you find whether a link list has loop in it? (and the stack trace of my code)
- How will you find kth node from the end? (again with stack trace of my code)
- How will you write a zip command? (basically file compression)
I gave him two ans: One replace char with char and frequency (but then I pointed out the -ves of this approach myself). Second was using Huffman code
- What are function pointers, how to use them, why to use them?

75% interview was bout, Trilogy's project, so Java, JavaScript, etc etc. BUT strictly project specific, which will never be asked to you people.

Note: I had to write these questions on white board, and he wanted me to teach him.


Round 2

- Started with puzzle, that 4 people, 17 minute river crossing question. Which we all did in the starting of our preparation. I said I already know this.
- Virtual functions, why we need them?
- Why or Why cant Constructors & Destructors be virtual?
- What happens when we make a Destructor virtual?
- Can we call virtual functions in constructor?
I said yes we can, BUT the there is no point of using the word virtual here, because polymorphism doesn't come into picture during construction.
- He gave a list of integers, asked me to make a heap out of it, then usage of heap, complexity of heap, complexity of binary search, why is it the fastest.
- Now came the big question. Write a Generalize Link List program. I didn't know what it was. So he explained: Its a list that can store any kind of data, int, char, float or double.
I gave him 3 solutions using unions, void*, and a mix of both.
- Then he asked about Templates, I said, I only know basics, not much.
- STL... I said (an assertive one) NO, never used, jst heard of it. :P
- Then he moved to pointers :D :D \:D/
- Function pointers, asked me to write 2-4 complex declarations using function pointers.
- Give a practical e.g. where you have used function pointers, where in windows do you think we use function pointers. (Thanks to windows programming & VC++)
- What happens when we throw an exception?
- How will you check if a link list is corrupted?
- Data Break points their usage (this had to do with checking of corruption)


Round 3

This guy looked scary, serious, intelligent and I was damn nervous just after looking at him (wat lag gayi thi).

- Began in the usual manner, about yourself, about the projects in Trilogy & Decho. Since both were on web apps, so he asked about EJB, how do Apache or JBoss servers work. Thn lots of things about Trilogy's project. (I answered to the best of my knowledge, thou I don't think that was sufficient)
- One puzzle, rope of uneven thickness burns in 1 hr, measure half hr. (bacho wala tha ye :P)
- Another Puzzle, two robots are designed to move either right or left, if they collide with anything they will stop, otherwise they will keep moving. Write a module such that, if I put the two robots on an infinte line, nd run Your module on both of them, in an infite loop, they shud have a high probability of collision.
- Waf that takes root of a tree and a sum. & returns if the tree has a path(root to leaf) such that sum of the nodes on this path is same as the input sum.
- Templates again, I gave the same ans.. that I know very little... (but is baar main nai bacha) he said tell me how much do u know, rather whatever you know.
- STL again, I said no.
- Benefits of using templates and STL, followed by a discussion on Java vs C/C++
- This guy also moved to function pointers, I gave my prev e.g only. but he asked for code, nd advantage of my code.
- I am developing a project that I want to work across different platforms, what would you suggest I should do? I said strictly use language standards, and no compiler dependent features.
Then he said but I need to use certain libraries of different platforms. Like we have certain ones on linux. I said you can use conditional compilation using #if & #elif etc... cuz we have certain inbuilt symbols like ___win somethin something___ whenver we need to use such code. We can keep them in such blocks (while giving this answer one more variation clicked so) I said OR you can put all dependent code in individual modules. and make an independent module that uses these. (wrapper kind of thing) in this wrapper you can use the ususal #if #elif


Round 4

This was from noida, video conference with some engg. head in Noida

- WAF which takes an integer input i (i can be 1 or 2) and returns 2 or 1 (alternates) respectively.
- Then a lot about project in Trilogy, and Decho
- Difference between GET nd POST, which is better?
- He almost exhausted me bout Decho projects. Everything and anything that I had learned in past 1 month was covered. XML, XPath whatever I knew.
- Last question, I want a sort function that can sort anything, ints, doubles, structures, even arrays, anything you can imagine. Write the prototype. Then he asked me to explain the parameters I had taken, and why I had taken them.


HR Round

This was more of a formality.
General questions on family background, brothers n sisters, what I do for leisure, why I wanted to go to Noida and all those stuff.

I hope I was of some help...
All the Best... :)

Saturday, May 9, 2009

Adobe Interview of Preeti Singh

Written:

1) declaration of sprintf.
2) is dere difference in typedef(encoded pointer correctly) and #define(just replacement).
3) write generic function for swap(), which works for every data type e.g int,float,char.........
4) find out depth of tree.
5) how many times a swap function would be called if given array is ascending and we have to sort in descending order.
for(i=0;i<n;i++)
for(j=0;j<n-1;j++)
if(a[j]<a[j+1])

6) rectangle intersecting or not, given left upper and right lower vertax;
7) WAP to print all path from node to leaf
8) getbits(x,p,n)
9) one question from OS about producer/consumer, how to update queue in critical section.
10) int arr[] = {1,2,3,4};
int *ptr;
ptr = arr;

for(i=0;i<4;i++)
{
printf("%d ",*ptr);
ptr +=sizeof(int); i
}

11) how void free(void *) work?

Aur yad ni aa rahe :(


Interview Round 1

1) Asked me about my current project and development work i m doing.
2) How to keep record of number of packets comin from some computer passing through router if
IP Address is dynamically changing(Related to my 5 month project on SNMP protocol).
3) Code to reverse a string word by word.
4)Puzzle 1: five containers having same number of balls. out of 5 one container having all defective balls.
We are given one weighing machine on which we can check weight only once. We hav to find which container have
defective ball, using weighing machine only once.

5) Puzzle 2: you are given a rectangular sheet of paper. Cutting one rectangle from that paper from anywhere.
Draw one line such that it divides the remaining area of rectangle in two equal parts.
6)
char c = 5;
void foo(int *b)
{
b = &c;
}

int main()
{
int i;
foo(&i);
printf(i);
printf(&i);
}

what ll be output??


Interview Round 2

1) About Project currently i m working on.
2) Write a code to traverse a binary tree label by label.
3) Find nth node from end in a link list.
4) given two time stamp(starting and end), find out all possibility when the two time stamp overlap.
5) Puzzle: 100 door puzzle.
6) Given 2 container of 3ltr and 5ltr and unlimited quantity of water. Measure 4ltr of water.


Interview Round 3:

1) About Project.
2) Some question related to telecom domain on which my project based on.
3) Write a code of ternary search means dividing given sorted array in to 3 parts every time and search the element.
Find out the complexity. Hw is it bettr than binary?
4) Given k sorted array of n element each. Sort them into a single sorted array.

jitna yad tha utna likh diya :)....some basic questions of c/c++ was dere. like storage class and some questions of structure

Friday, April 17, 2009

Adobe Interview of Varum Maini

Written Exam :

C/C++ :-

Ques 1.
Write setnum(x,p,y,n)
Dennis Ritchie question : set the n bits starting from position p in x with rightmost n bits of y.

Ques 2.
Write a program to find the depth of Binary Tree

Ques 3.
In Binary Search code, reduce the number of comparisons in while loop from two to one. Write the code.

Ques 4.
Difference between char arr[] = "string" and char *arr = "string".

Ques 5.
Implement int **my2DAllocate(int rows, int columns); to allocate memory for 2D array and return the int ** pointer.

Ques 6.
What are bit fields. Give example, when they are used.

Ques 7.
What are data break points. When do we use them.

Ques 8.
Write code to evaluate ReversePolish.
Input : 123+*
Output : 6

Ques 9.
Hex no. is given in string for (0x or 0X optional). Write code to get the integer value.



Engineering Paper :

Ques1:
For a String s
Head(s)= first char of s
Tail(s) = all the chars of s except head

I.e. is s=”abcd” , head(s)=”a” , tail(s)=”bcd”

So given concat(Head(s),Head(tail(tail(s))) = “ac” , which of the following could be s

abcd , aabc,acac , aaac


Ques 2.
Binary Search tree is given. Print all the possible routes from root to leaf.

Ques 3.
Give a Data Structure to denote a polynomial when :
a) polynomial is dense
b) polynomial is sparse

Ques 4.
U have a file that is much bigger than RAM , give an algo to sort the file.

Ques 5.

Int power(int base,int n)
{
if(n==0)
return 1;
else
{
int x = power(base,n/2);
if(n%2==0)
{
return x*x;
}
else{
return x*x*base;
}
}
}

if I call power(5,12) then how many multiplications will take place ?


Ques 6.
P1 : read the file
P2 : modify the file

Show how will u synchronize the process so that modify can happen only when no one is reading the file. Using constructs

Enter Critical Section :
Exit Critical Section :
Wait Event :
Signal Event

Ques 7.
Given code that did bubble sort and sorted an array in decreasing order. An array is given in sorted order, u have to find out that if the above algo is run on it .. then how many times would two array values be swapped.


Ques 8.
Given two binary tree, how will u find that they are isomorphic (that is at each level they are equal or are mirror image of each other)

Ques 9.
A rectangle is represented by two points P1(x1,y1) and P2(x2,y2) representing lower left and upper right corner.

So given two rectangles , find if they intersect.



Interview 1 :

1) A date is represented as yyyy/mm/dd ex : 2001/10/02 .
Now observe that the above date is a palendrom, so find out the palendrom date which came just before the above date.
(Hint : September dosn’t have 31 days !!!! )

2) given two stings s1 and s2 , s1 has some characters at the end which are same as some of s2’s starting characters ..
so u have to concatenate the strings so that the repeated portion occurs only once.

Ex : S1 = “ ABCDEFGHIJK”;
S2 = “GHIJKXYZ”;

O/p = “ABCDEFGHIJKXYZ”

3) given a big string , u enable a person to underline some characters , for example some body had underlined characters 3-6 and 10-14 and so on ..
suggest a Data structure which can record this info effeciently and can accomodate new underlines .
NOTE : a new underline could lead to updation of records for ex consider a underline that starts from 5-8 .. then above set would become 3-8 and 10-14
NOTE : a new underline could lead to MERGING of records for ex consider a underline 4-13 .. this would lead to 3-14 in above set.

4) arr[2][3][2]={1,2,3,4,5,6,7,8,9,10,11,12};
what is value of arr,*arr,**arr,***arr, arr+1 ,*arr+1 ,**arr+1,***a+1

5) Given a no N, find all prime nos from 1 to N. using the fastest approach possible.

Now the answer i gave for this question left him speechless ..
He was basically just looking for the soln where i store all the previously encountered primes in an array and just keep dividing my no with them to find if its prime or not
But because of my maths background i gave a answer which uses Fermat's Theorm and proved much faster than above approach and no extra memory reqd.

After that soln he kind of felt overwhelmed and the interview was over :D



Interview 2 :

1) Given M sorted arrays , each having K elements , merge them into a big sorted array of size MK in most efficient manner possible.
(Hint :- Coreman Question : Use a Heap)

2) If u have to desing ur own Operating System , what mechanism are u going to use for ur file system .

(I started with using continous blocks to store file , this lead to external fragmentation ..
so next i told of using linked approach , where in each block i also keep address of next data block
next moved to FAT system...
Finally came up with an indexed approach , where first datablock just stored pointers to rest of data blocks)

3) Implement a stack such that push,pop and max and min are obtained in O(1)

4) given an array[1...N] which have elements from range 1-N they have elements that are repeated any no of times.
So give all the approaches u can come up for to find the nos that are repeated.

(first O(n^2) approach : brute force
then sort and find out
then use and extra array of size n
then use a bit vector of size n
no extra memory , whenever u encounter a no go to that index and make the value -ve ....
and another couple of really fundoo algos were given )

5) How will u create ur own C++ library.

(told that i will create my classes and place all my implementations in it. and provide a header file which having the class , macro and typedef declarations.
He then asked that what approach would u use to avoid mentioning all private and protected functions from the '.h' file
After about 5 - 10 mins of discussion .. i gave the correct answer .. that i will create a class which has all my private and protected funtions .. and in my
original class i will just add a POINTER to that class (Note : Pointer and not object as if i use an object then i have to give my second class's declaration too
and so will land up at square 1 )

6) Create a singleton class in C++


Interview 3 :

1) given a link list , find if its a palendrom or not.
(I gave one soln , then he asked me to code a recursive one )

2) There is a rectangular table , u and ur friends have identical coins , so u place a coin on table,then ur friend places one (no overlap allowed) , in the end
there would be no space left on the table and the person who is not able to place his coin on the table looses.
So device an algo such that if u place the first coin , u will always win .

(Basically place the coin at the center (point of intersection of diagonals), then wherever the friends places a coin, place a coin at its mirror image across the diagonal,
so for all his coins u are able to place a coin, hence cancelling his every move, but u have a coin extra at the center and hence in the end u will win)

3) In a party there is X, X's wife Y along with A,B,C,D,E and F (where b is a's wife , d is c's wife and f is e's wife). So ppl meet and handshakes take place , its given
a husband dosnt shake hands with his wife. In the End X asks every1 else the no of handshakes that they had .. and all give different Answers !!!!!!
IF its given that X shook hands with A. Then u have to find if Y shook hand with A / B / either of them / none of them

4) Applications of Heap, implement heapsort

5) function to generate permutations of a string ( he told me to assume that all characters in string are different)

6) being in line with prev question , he told me to come up with a Data structure that given a string , find all anagrams of string.


Interview 4:

1) given a no x , convert it to binary and store it into a char array and return.

(Looks simple, but is not .. basically u need to take care how much memory u need to allocate the array , then if u are returning , should u create a array
or use malloc , then how should the calling function accept it as char * p = fun() or char p[] = fun()

He then changed some lines of code and said now what will happen and so on ..)

2) given two very big files , each having around 1 billion lines , u have to print all the lines that are common to both files

(gave nearly 10 different approaches :
brute force , create a binary tree of one file and then keep searching elements of other file in it,sort one file and do binary search , sort both and compare top two and proceed ,
sort and place the strings in buckets , buckets then gave way to B trees , then hashing , break file into small mangagable chunks and then proceed etc etc ..)

3) what is virtual memory and how would u use it in the previous question

4) given a N X M matrix , find out the total nos of rectangles that can be there.


5)
int p = 0x6000;
int *q = &p;

fun(int *r)
{
*r = *q;
}
int main()
{
int a = 0x5000;
fun(&a);
printf(a);
}

here he asked the o/p. then he made the following change

he replaced the int * r with char ** r , then asked me what would be the o/p. This really confused me, but i figured out the ans in about 2 mins .
then he replaced the char ** r with char *r, this looks simpler than pervious case , but believe me .. this is the toughest ,

here when we do *r = *q this would then lead to storage of 0x6000 % 255 to be stored in *r
also there is now the case of Endianess, if machine is little Endian then r has changed the Least Significant Byte of a else the Most Significant Byte.


HR round :

1) ur marks in 10,12,grad and mca
2) ur ranks in all the above
3) what all companies did u sit in during campus placements , out of them in how many did u get selected
4) what was ur rank in DU's MCA enterance
5) what would ur boss say about u
6) What is the best thing about Trilogy and whats the worst
7) Package , how much expected
8) Whats ur worst habbit
9) How is ur rapport with ur team in trilogy
10) Give me 5 reasons that seperates u from others so that i should select u
11) How do u rate ur performance in trilogy on a scale of 1-10

Thursday, January 22, 2009

Adobe Interview of Vikalp Gupta

Hello All,

Below are the questions that were asked to me in the interviews for the development profile in Adobe Systems. Hope you will find these questions helpful while preparing for Adobe (or any other company).


First Tech Interview: -
--> Tell me about yourself.
--> Why you want to switch so early (as I have just 7 months experience in Aricent).
--> Why Adobe.
--> What is your rank in the batch. Bade saare fadde maarke maine is question ko answer kiya tha as, rankwise, I told him that I will be in the bottom 10 in my class. Then he asked why shouldn't we hire toppers. To kuch na kuch fadde maarke maine use chup karvaya.
--> There is a matrix of N*N order. You are given two values, i and j. Find out whether the pair (i, j) represents any of the 4 corner elements in single 'if' condition.
--> 100 doors puzzle. There are 100 doors. Initially they are all closed. In ith pass, the state of all the doors that are divisible by 'i' is flipped, where i continues from 1 to 100. After 100th pass, which all doors will be in open state.
--> There is an input string such that there is only single blank space between each word. There is no other whitespace character except for space. No trailing and leading spaces either. You have to take out the tokens from the string with minimum memory requirements. I gave many solutions but after each solution, he added one or more constraints. Actually what he wanted was that the signature of the function should be like:
char** Tokenize(char *input_string)
He wanted that the memory for each token should be allotted only inside the function. You cannot count the number of words. You have to do this only in single traversal of characters of the input string. He wanted that after calling this function, user should be able to print any token in order(1). Yes, you can modify the input string.
--> What all data structures you have heard of. What is the best data structure to implement dictionary. How will you do it.
--> What is malloc. What is calloc. What is the difference between the two. If they perform the same type of function, then why to use calloc. What was the need for creating and standardizing calloc when we can use malloc.


Second Tech Interview: -
--> Tell me about yourself.
--> Tell me about your project that you are currently working upon in Aricent.
--> Then he asked some project specific things like what are the different protocols, their position in the network, their usage, my contribution in the project etc.
--> What is an XML file. You are given an XML file. You want to store it in memory. What data structure will you use for the same, so that different queries based on that XML file can be answered most efficiently.
--> What is the best data structure to implement dictionary. How will you do it (not complete code but just the data structure and the algo).
--> Then he drew a graph and asked me to do the Depth First Traversal of the vertices of the graph.
--> Then he asked me to write the code for the same (Depth First Traversal).
--> Different ways of inter process communications.
--> What are unnamed pipes.
--> What is the corresponding IPC mechanism in windows. (Actually he wanted to get sockets as the answer as We have used sockets in the simulation of FTP in fourth semester).
--> What is fsck in unix. What were some of the inconsistencies you handled in it and how.
--> One or two more questions were there which I dont remember.


Third Tech Interview: -
Is bande ne meri bahut buri tarah se maari thi, kya nahin poochha tha isne, dimaag kharab ho gaya tha is interview ke waqt to. Us din saare interviews hone ke baad mujhe lag raha tha ki agar nahin hua to isi interview ki wajah se nahin hoga kyunki jisne yeh interview liya tha, he was the hiring manager.
--> Why you want to switch so early (is question par hi usne kam se kam 10-15 min argue kiya hoga and literally bahut sunaya tha)
--> Diference between C and C++ (apart from OOPS and Generic programming).
--> Difference between malloc and calloc.
--> Difference between malloc and new and free and delete.
--> Which is better, malloc or new. And why.
--> Different mechanisms for IPC.
--> What are pipes. What are sockets.
--> What are events in Windows applications. Is question par maine kaha ki mujhe kuch nahin aata windows application ka, humne bahut basic kiya hai is subject mein, to usne kaha ki kitna basic, just the hello world program.
--> What is the unix file system.
--> What is FAT. What is the first block in FAT.
--> What is webmail (our oracle project in fourth semester). Explain it.
--> Draw the OSI model in networking.
--> Draw the corresponding TCP/IP model and map the diferent layers withOSI model.
--> Whats the use of MAC address.
--> What are IP addresses.
--> What is TCP and What is UDP.
--> FTP works over what. TCP or UDP. And why.
--> What is ping command.
--> ping works over what. TCP or UDP. And why.
--> Shayad usne kuch class hierarchies par poochha tha.
--> Explain your project.
--> What is dll.
--> What is the difference between dynamic linking and static linking.
--> How do you do static linking.
--> How do you do dynamic linking in windows (There are 2 methods, mujhe ek pata tha, but he asked the second method too).
--> 2-3 questions aur the but woh yaad nahin. Actually main jo bhi bol raha tha, koi bhi ek word pakad kar woh shuru ho jaata tha.


Fourth Tech Interview: -
--> Why do you want to apply for Adobe.
--> In classes, how do you declare and define const and static data members.
--> What do you mean by initializer lists.
--> What all type of data members can be initialized by using initializer lists.
--> Order of calling of constructors in class hierarchy.
--> Order of calling of destructors in class hierarchy.
--> What do you mean by virtual function.
--> Can a destructor be virtual. Why or why not. Give example to show the usage of virtual destructors.
--> What are inline functions.
--> Is it possible to have a virtual inline function. Why or why not.
--> What will happen if you do 'delete this ;' inside the destructor of the class.
--> What is upcasting.
--> Suppose there is a Base class and a class Derived from the Base class. Suppose you do:
Base* ptr = new Derived;
and then you do delete ptr ;
Then which class' destructor will be called.
--> You are given a BST. Find the least common ancestor. Give the algo.
--> Two linked lists are merged at some point. Find that point of merging. Write complete code for that.
--> Again IPC mechanisms.
--> Again pipes and sockets.
--> One puzzle: There is a bag containing 50 Red and 50 Blue balls. A coin is tossed. If head then do nothing and if tail, a ball is taken out from the bag without looking into the bag. You do this tossing of coins three times. What is the probability that after tossing the coin three times, you get three red balls.


HR Interview: -
--> Tell me about yourself.
--> Why Adobe.
--> Why should we hire you.
--> Three things your manager will say about you.
--> Where do you see yourself three years down the lane.
--> The areas in you which needs improvement.
--> What is the relation between degree fahrenheit and degree celsius.
--> At what temperature is degree fahrenheit same as dgeree celsius.
--> Multiply 125 with 125 in the fastest way you can.
--> One puzzle:
6 6 6 = 6
7 7 7 = 6
8 8 8 = 6
9 9 9 = 6
Use any mathematical operator or any thing you have learnt in maths to make the LHS and RHS equal.


Fifth Tech Interview: -
--> What is OMA (Open Mobile Alliance). What do they do. (Actually it was related to our training time project in Aricent).
--> Explain the webmail.
--> Your role in webmail.
--> How you communicated with the Database.
--> Explain what you did in the simulation of FAT (Explain each and everything in that). He asked me to give an example of how different data structures were used.
--> Explain ther file system of Unix.
--> What are inodes.
--> What is super block.
--> Is there any pointers involved in the inodes.
--> Explain FTP.
--> What are sockets.
--> What are the actual APIs you used in sockets (like listen, connect, open etc).
--> Is 'listen' function is used on the client too.
--> How did you handled multiple client requests.
--> Did you use same port number for both receiving requests and sending responses on the server (in FTP).
--> He asked me to explain our project, in detail, that we did in training period in Aricent.
--> Explain your current project.
--> 2-3 questions on pointers.
--> Usage of unions (yeh mujhe nahin aata tha).
--> My family background.

All the Best... :)

Adobe Interview of Sanyam Jain

Written exam

First paper consisted of a Quantitative and Logical Aptitude for duration of 45 minutes.
Second was of Engineering – 45 minutes
Third was C programming – 45 minutes

Ques 1.
Write setnum(x,p,y,n)
The LSD bits starting p from left in x are replaced with rightmost n bits in p.
Rest bits in x are unchanged.

Ques 2.
Write a program to find the depth of Binary Tree

Ques 3.
In Binary Search code, reduce the number of comparisons in while loop from two to one. Write the code.

Ques 4.
Difference between char arr[] = "string" and char *arr = "string".

Ques 5.
Points P1(x1,y1) and P2(x2,y2) are given. drawPoint(x,y) API is given. Write drawLine API taking P! and P2 as input and draw a line from P1 to P2.

Ques 6.
What are bit fields. Give example, when they are used.

Ques 7.
What are data break points. When do we use them.

Ques 8.
Write code to evaluate ReversePolish.
Input : 123+*
Output : 1*(2+3)

Ques 9.
Hex no. is given in string for (0x or 0X optional). Write code to get the integer value.

Ques 10.
Binary Search tree is given. Find the 4th smallest value node.

Ques 11.
Infix expression is given. Draw binary tree. Find postfix expression.

Ques 12.
Memory is maintained as stack type
Assembly Instructions are given :
Load : value
Store : value
Swap : top two values are swapped in memory
Add : top two values are added and replaced by sum
Diff : top value is subtracted from second top and replaced by difference
Label : define label
JMP : jump to label if true condition else give the top value

Write Instruction code for :

A = 300
for(i = 10; i> 0;i++)
A=A +200;

Ques 13.
Given computers C1 - Cn. Given k (L1 - Lk)direct links between computers. Links are transitive. Find whether all computers are connected.

Ques 14.
T1 : write to memory queue
T2 : read from memory queue and print

Create Event : event name
Enter Critical Section :
Exit Critical Section :
Wait Event :
Use instructions to wite code for two events with semaphore.

Ques 15.
Condition for stack are given in wrong order.
PUSH Stach[i] = A i = i - 1
POP i = i + 1 A = Stack[i]

Arrange in proper order

Ques 16
Implement int **my2DAllocate(int rows, int columns); to allocate memory for 2D array and return the int ** pointer.

Ques 17
Given a code in assembly language.. Find the output.



Interview Round 1

1. Introduce yourself. Discussion about the current project.
2. Allocate the memory to a 2D array. Free the allocated memory.
3. Puzzle : There are 100 floors and you have 3 eggs. You need to find the minimum floor from where the egg will break.
4. Puzzle 2 : Given 1000 bottles of wine. Out of these one is poisoned. You have n number of prisoners. Find the poisoned bottle by testing on the prisoners so that there is minimum death of prisoners.
5. Form mirror of a binary search tree.



Interview Round 2

1. Introduce yourself. Why do you want to join Adobe?
2. Static Linking and Dynamic Linking
3. Command to link a .so object.
4. Make file of your project
5. Process Vs Threads
6. Memory map of a process in execution
7. Java Script Vs C/C++
8. Implement strtok
9. String matching problem pseudo code
10. Difference between debugging mode binary and release mode binary.
11. What are stored procedures in Oracle?



Interview Round 3

1. Introduce yourself
2. Implement realloc. Please take care of the hypothetical situation that the memory allocated in realloc may overlap with the existing memory.
3. Puzzle : Given n numbers from1to n. One number is removed from these and a number is added. This leads to a duplicate in the list. You need to find out the duplicate and the original number
4. Puzzle : Given three boxes labeled Oranges, Mangoes and Oranges/Mangoes ,with the fruit they contain.. Now the labels are jumbled so that the if box is labeled Mango then it doesn’t contain mango. Correctly place the labels.
5. Question on object slicing and run time polymorphism in C++
6. Why do we pass the argument in copy constructor by reference?
7. Where do we require Copy constructor?
8. If we give only the parameterized constructor of a class. What will happen?
9. Difference between reference and pointer? In which scenarios we prefer pointers instead of reference.


Interview Round 4

1. Introduce yourself
2. Why do you want to leave Aricent?
3. Write the program to find that the two linked lists merge at a point or not
4. Write a program to print the given number in words. For example, print 1234 as one thousand two hundred thirty four.
5. Write a code to find reverse a stack without using a stack
6. What data structure will you use to store dictionary words. Implement is efficiently so that you can find the anagrams of a word easily.



Interview Round 5

1. Introduce yourself
2. Discussion about the current project.
3. What are exceptions in C++?
4. Implement a Date class. Provide an API to the user/some module so that they can call the get the current time ands date. The API should be such that the user cannot access/modify the date class.



Interview Round 6

1. Introduce yourself.
2. Why you want to leave Aricent and join Adobe?
3. Discussion of the current project.
4. What are the default functions provided for a class?
5. Implement an employee class. Store only the name and the employee id. Write the set of basic functions.
6. Discussion about the college project on website. How did you design the database? Discussion over the normalization.
7. Implement a Student class. Each student can issue a fixed number of books. Extend it so that information for a Phd student can also be stored. Phd student can have any number of books.
8. Under what scenarios we need to define a copy construtor?
9. Implement ftoi function. How does a program execution takes place? How will you specify some precondition for a function?



Interview Round 7

1. Introduce yourself.
2. Why do you want to leave Aricent.
3. You are given a sheet and a set of shapes. You have give a layout which will yield the maximum number of pieces (containing all shapes) that can be cut from the sheet.
4. How will you find out that a point lies outside / inside a polygon.
5. Write the prototype of the function sort.



Interview Round 8

1. Introduction
2. Why you want to leave Aricent?
3. Why Adobe should hire you?
4. 3 qualities.
5. Prove Pythagoras theorem
6. 75*85 = ?? without using any calculations on the board.

Monday, September 15, 2008

Adobe Interview of Rinky Gupta

Q: Given length and precision(ex: 1/8) draw scale. each unit shd have different height. Draw same as the scale we generally use.

Q: a)Implement stack.(write constructor, destructor,push,pop).
b)Implement Quesue using stack. Optimise the enqueue and dequeue operations.

Q: Difference b/w program and process. How a process executes(Interviewer was expecting program counter etc etc)


Q: There are 3 string S1, S2 and S3. Replace all occurances of S2 in S1 with S3. S3 and S2 can be of any length. Length of S2 can be greater equal or less than that of S3. Result is new string.

Q: There are n guests in a party. A guest can make any numbr of handshakes(0 to n-1) . Prove that there are atleast 2 guest having same number of handshakes.(Can be proved using induction as well as Contradiction)

Q: Difference b/w reference and pointer and where do we use each. What is advantage of 1 over other. When is the memory allocated for each.

Q: Two trains are moving towards each other with different speeds on same track. A bird is moving to and fro. Find the distance travlled by bird till the trains meet.

Q: 100 floors. 2 eggs. find the lowest floor from which the egg breaks in min number of throws.

Q: 50 Red balls and 50 blue balls. 2 empty baskets. A person has to choose 1 basket at random and then pick 1 ball out of it at random. Distribute the balls to maximise the probability of picking up red ball.

Q: Find the subsequence of max sum from array of +ve and -ve numbers.

Q: There is an array of N elements having values in range 0 to N-1. a value can be repeated any number of times. Do some preprocessing so that the count of a particular value can be determined in O(1) after preprocessing. Do not use any extra array to store the counts. Same array can be modified to strore counts for each value.

Q: A float f is given and digits d. return the string having the value with d sigits after decimal.

Q: a)Find the maximum and the min value an integer can store.
b)Implementation of sizeof.
c)Used number of bits to find the max and min value
d)Use complement to find the max value of integer(complement 0 and reset the signed bit to get max value) All these questions were linked from 1 to other.

Q: Rotate integer n bits right.

Q: Two linked lists having a common node. Find the node.

Q: 1,2,4,6 and operators + - * / . Operators can be used any number of times. Write expressions to make 24 and 25

Q: 5,5,5,5,5 and any operators. Make 37.

Q: 2 cans of 10L each full with water. An empty can of 4L and another of 5L. move 2L to each of 4and 5 can.

Q: Reverse linked list.

Q: Few questions on output of C++ codes.

Q: A chess board 8X8 given(area 64 units). 31 slabs of 2X1 each(area 62 units). Arrange slabs on chessboard such that top-left and bottom-right corners are left empty.

Q: There are 100 prisoners. The jailor will make them stand in a row 1 after other, so that each person can see the people in front of him. The he will put caps of red and black color at random on head of each prisoner. There can be any number of red and black caps. The person telling the right color of his hat would survive, others dead. One person can speak one word i.e. the color of his hat.Before the activity the prisoners can think of some protocol to be followed so that max number can survive. No one would cheat. Decide the protocol that shd be followed.


Adobe Interview of Manmohan

Written test for DS and C paper has changed but Quantitative and Analytical are still the same.

DS Paper:
1) Nodes are given in order, make the BST for these nodes
2) Hash function was given had to find which numbers map to the same key
3) Using Boolean operators solve a boolean expression
4) LCA for a BST write code.
5) Base conversion from a 14-base to 7-base
6) Paranthesis matching problem which DS would be best and why
stack was the answer. (tree, stack, queue, linklist were choices)
7) Prefix expression was given had to find the value for given A and B
8) Dont remember
9) Dont remember
10)Some assembly lang program was given need to find whats the behaviour of the program
It was some recursive routine.

C paper:
1) Difference between 2 statments actually they were some pointer to function
2) int *i,*j;
i = (int*) 60;
j = (int*) 20;
printf("%d",i-j);
3) Middle node of link list
4) Missing number find in array in o(n) time number in the range 1-n-1
5) Gcd or 2 numbers
6) Reverse a doubly link list
7) Call statements for a function named crazy(int n, int a, int b)
void Crazy(int n, int a, int b)
{
if(n==0)
return;
Crazy(n-1, b+n, a);
printf("%d %d %d\n", n,a,b);
Crazy(n-1, b, a+n);
}
8) Find 2's compliment of a number which is given in string form
9) MACRO were defined for SUM(a, b) and MULT(a, b)
then printf the result of some expression formed by using these MACROs
10)
file1.c
int myarray[10];

file2.c
extern int* myarray;
void foo()
{
myarray[0] = 0;
}
What problems this program might have and under what conditions?


Technical Interviews

Round1:
1) char* ftoa(float f, int d);
d: number of digits after decimal place that needs to be printed
2) Minesweeper game discussed logic and strategies
3) Tower of Hanoi for N discs, What if the disks are not sorted
4) Max subarray sum problem

Round2:
1) Levelwise traversal
2) Virtual Destructor
3) Nth node from the end of the list
4) Mirror image
5) Power of 2
6) Puzzle a rectangle is given u take out a smaller rectangle from it.
Now divide the rectangle bigger one into 2 equal parts using a single straight line.
7) A mooon shape was given and using 2 lines needed to divide it into 6 parts.
8) Question on polymorphism and other basic question on c++.
9) Container class interfaces and all what all will u have.
10) Permutation and given an API that checks if the word is valid or not.

Round3:
1) 5 5 5 5 5 = 37 puzzle
2) Reverse a link list
3) Power of 2 or not
4) Count number of 1's set bit in an integer
5) Apple, Orange and Mix Puzzle
6) C++ questions tell the output of the program
7) Find repeated number in an array of size n, numbers in the range 1-n-1
8) 8 balls one of them is lighter than others find in 2 weighings
9) What is reference and pointer

Round4:
It was an HR round very long and interesting

Round5:
1) Stack implementation, implement a queue using stack this interface
2) Spiral printing of a matrix m*n
3) Some memory manager kind of thing discussion. Memory allocator and deallocator for efficiently using the memory.

Adobe Interview of Ruchi Sharma

****ROUND 1****

1) Reverse a linklist.

2) Find whether two given linklists of any length merge at a point or not.

3) Print binary representation of a given integer.

4) Code to find all permutations of a given string.

5) puzzle : 5 5 5 5 5 = 37 use any arithmetic operators on LHS to make 37 .

6) puzzle:
given : -20 = -20
to prove : -4=-5.
4-5 steps were given to prove this. I had to find which step was wrong.

7) puzzle : 5 bags each having balls of same weight except one bag. find the bag having the odd ball.

8) Two C++ questions..find output.


****ROUND 2****

1) Given an integer, write code to find max and minimum value it can store.The number of bytes of the integer
is also unknown and no lib func is to be used.

2) An array has numbers in unsorted order n no fix range.any number can be repeated any number of times.
Extract unique elements from the array.

3) 4 tumblers A, B , C , and D of max capacity 10ml,10ml,4ml and 5 ml milk respectively.
make 2ml each in C and D without losing milk.

4) Discussion regarding project.


****ROUND 3****

1) Given a number N.Write a code to Print all primes in the range 2 to N.Optimise it also.

2) Given an array having positive and negative numbers. Find a contiguous sequence having max sum.

3) HAT puzzle : A team of N players, where N is at least three, are randomly assigned hats that
are equally likely to be white or black, under conditions such that:

- Each team player can see the hats of the other team members, but cannot see their own hat.
- Team members cannot communicate in any way.
- The jailor will ask each prisoner the color of his hat.
- If he got wrong ans the prisoner would be killed.

Find the strategy followed by prisoners to minize no of deaths.


4) Discussion regarding project.

Sunday, February 18, 2007

Adobe Interview of Varun Aggarwal

Written

Section 1 : Algorithm 10 Ques Time : 40 mins
Section 2 : C 10 Ques Time : 40 mins

I can recall only 16 ques out of 20. These may help you.
I solved 8/10 in Section one and 9/10 in Section two.
You have to solve them very fast else u'll miss some of them.

Ques 1.
Write setnum(x,p,y,n)
The LSD bits starting p from left in x are replaced with rightmost n bits in p.
Rest bits in x are unchanged.

Ques 2.
Write a program to find the depth of Binary Tree

Ques 3.
In Binary Search code, reduce the number of comparisons in while loop from two to one. Write the code.

Ques 4.
Difference between char arr[] = "string" and char *arr = "string".

Ques 5.
Points P1(x1,y1) and P2(x2,y2) are given. drawPoint(x,y) API is given. Write drawLine API taking P! and P2 as input and draw a line from P1 to P2.

Ques 6.
What are bit fields. Give example, when they are used.

Ques 7.
What are data break points. When do we use them.

Ques 8.
Write code to evaluate ReversePolish.
Input : 123+*
Output : 1*(2+3)

Ques 9.
Hex no. is given in string for (0x or 0X optional). Write code to get the integer value.

Ques 10.
Binary Search tree is given. Find the 4th smallest value node.

Ques 11.
Infix expression is given. Draw binary tree. Find postfix expression.

Ques 12.
Memory is maintained as stack type
Assembly Instructions are given :
Load : value
Store : value
Swap : top two values are swapped in memory
Add : top two values are added and replaced by sum
Diff : top value is subtracted from second top and replaced by difference
Label : define label
JMP : jump to label if true condition else give the top value

Write Instruction code for :
A = 300
for(i = 10; i> 0;i++)
A=A +200;

Ques 13.
Given computers C1 - Cn. Given k (L1 - Lk)direct links between computers. Links are transitive. Find whether all computers are connected.

Ques 14.
T1 : write to memory queue
T2 : read from memory queue and print

Create Event : event name
Enter Critical Section :
Exit Critical Section :
Wait Event :

Use instructions to wite code for two events with semaphore.

Ques 15.
Condition for stack are given in wrong order.
PUSH Stach[i] = A i = i - 1
POP i = i + 1 A = Stack[i]
Arrange in proper order

Ques 16.
Implement int **my2DAllocate(int rows, int columns); to allocate memory for 2D array and return the int ** pointer.


Round 1
1. Write a class Student with just one private member, char* name. Also write the copy constructor, overload the "=" operator and write destructor.
2. Write code to find if a Binary Tree is BST or not.
3. U have a server which is getting many requests. More then the number of threads it can spawn. What will u do with the requests for which u don't have threads.
4. Write prototype for printf. If u have to write your own printf and u don't have va_arg how would you get the arguments in the variable list?

Round 2
1. What is your project about? Why did u choose the DS for your project? Write the definition of the structure used in it.
2. How would you maintain a variable size array. The size can increase at the run time. Optimize it to make iterator operation quick.
3. Write solid secure code to getElemAtIndex(int i) for the above DS.
4. What are your interests?

Round 3
1. Least Common Ancestor.
2. Array with n+1 elements. Only one elem is repeated, how would u find the elem?
3. Write a generic Swap function. It may be called for any structure. Also the number of bytes in the structure is given.
4. Write the code similar to malloc. void* myMalloc(int n). n is the num of bytes to allocate. You are given a void* f pointer that points to the location free in the memory.
5. Tell me something about yourself.

Round 4
1. Write the function my2DAlloc.
2. The function makes numOfRows+1 calls to malloc. Reduce it further. Finally we reduced it to just 1 call.
3. Write a function to add two numbers, without using any arithmetic operator. Even the ++ in for statement is not allowed.
4. There are two processes P1 and P2. Both have int* ptr in them. Now p1 assigns ptr = 0xffff1234, *ptr = 10 and the process goes in wait state. P2 gets scheduled and it does ptr = 0xffff1234, *ptr = 100. When p1 is invoked again, what would be the value of *ptr?
5. Write code to print a binary tree in breadth first manner. Now print it in bottom up breadth first manner.
6. How will u find the size of a pointer, without using sizeof operator.



HR
1. Package - Current and Expected
2. What if offer less?
3. Notice period?
4. What if your company extends your onsite?
5. Fav subject at grad?(i said algos and HR guys don't know it)
6. Fav subject at 10th? Isaid maths and he asked me to prove Pythagoras Theorem.
7. He gave me a puzzle and said that if i do it in 5 mins i'll get the marks for Pythagoras theorem too.
8. Why do u wanna leave present Company?