Showing posts with label MCA 05-08. Show all posts
Showing posts with label MCA 05-08. Show all posts

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

Amazon Interview of Varun Maini


Telephonic Interview :

1) Explain ur current company project.He wanted to know in depth, at each step he said , can we go into more details of implementation.
2) You are given a very huge string ,u have to beautify it.
beautify means that wherever there are multiple spaces / tabs repace it with single space.Whenever there is a full stop make the next char in Upper case,
no characters except the start of new line should be in upper case except when they are enclosed in single/double quotes,
U have to do this all in a single traversal and const space.
3) Implement a stack so that push,pop and max would take O(1) time.(gave 4-5 approaches)
4) Given a date as 2001/10/02 its a palendrom , find the palendrom date that occured just before this.


Round 1: (focused just on coding)

1) given an array find three numbers whose product is maximum.

(NOTE : looks easy but dont be fooled , there could be -ve nos too !!!!
gave 3-4 approaches , finally gave code for the approach taking O(n) time and const space)

2) Given a binary tree , convert it into a doubly linked list where the elements in DLL will be in same order as inorder traversal of the tree.

3) Given a sorted array , rotate it from a given Kth index in best possible manner

4) given a sorted array that is rotated find the index from which rotation happened ( O(logn) soln )


Round 2 : (focused on coding and DS )

1) given an i/p string AAABBCCCAA , o/p = A3B2C3A2 etc .. requirements : single traversal of string and const memory

2) give me a data structure such that if there could be values between 1-1000 then u could do the following operation in o(1) time :

insert(x) , delete(x), giveAnyElement()

where 'giveAnyElement()' will return any element present in the Data Structure.

U can assume that memory is no issue .. just concentrate on O(1) time .

(My soln : take a array[3][1000] array wherein
for each of the 'i' index :
array [0][i] = a int having value 0 or 1 , where 0 means element not present , 1 = element is present
array [1][i] = index of next value in the list
array [2][i] = index of previous value in the list

Basically u need to implement a doubly linked list on in an array and u are done :)

3) given a linkedList where each node has two pointer fields next and Random
where next points to the next node of linklist , while random could point to any node in LL
so create a copy of the linkList.


Round 3 : (focused on Algo,DS and coding)

1) given a NxM matrix , where each array entry is a character, write a code that will find all the words that can be formed using elements in a row, oolumn and diagonal

2) given a binary tree , each node apart from left and right has a tail pointer attached to it , where each tail should point to a node which would
come to the right of the current node , if a inorder traversal of tree is done.
So u have to devise a O(n) algo to find out which all nodes have their tail pointers set incorrectly.

3) given a huge string of size n (where n = about one billion ), there are m strings each k characters long u have to find out all the occurences of these m strings
in a single traversal of the big string.

(soln started from naive string matching, then kmp,then sorting the m strings and using buckets,then using binary trees, tries, hashing etc .. )


Round 4 : (focused on my ability to Design )

1) u have a function where there is an infinite loop thats running and in that loop , getRandomNumber() is called, at any point of time i should be able to track
the maximum, minimum, second max , sum , mean ,median etc of the nos.

Also i should have the flexibility that i can add more features , ex i can also add feature to find mode of the nos found so far

more importantly :a) i should have the flexibility to 'Remove' any feature as and when i want
b) i should be able to change the implementation of any of max, minimum methods without needing any change in my class


(My soln : after a good long discussion , i used Observer Design Pattern)

2) what is the diff between interface and abstract classes
give real world examples for them.

3) What do u know about JDBC , what is the purpose of the driver, when u do a preparedStatement.execute() then what all happens

4) Discuss the Collections API , what all interfaces and concrete classes does it provide , if u had to create ur own Varun-collections API then what all interface
and abstract classes would u provide

5) U have to design a database schema denoting the entire recruitment process , wherein storing info about candidates , interviewers , the interview results etc ..

Round 5 : (foucussed on Algo and how efficiently can i convert my algo to code)

1) given a NxM matrix where each row has elements in sorted order , and each column has element in sorted order , u have to find a given no in O(n) time and no extra space
ex :
1 4 10
3 6 11
4 7 15
find if 7 is present or not .

2) Given n sorted arrays merge them into a single sorted array

3) If i give u an N then ur code should give me the no of distinct binary trees possible with N nodes
ex i/p = 3 o/p = 5

4) once again went back to first question , now its given that all the arrays are increasing continously
ie
1 4 10
12 16 20
24 30 35 now find if a given x is present of not



Round 6 : (Focussed on HR,Data Strcuture , Algo)

1) whats the best thing about trilogy
2) if u have to change something in trilogy what would that be
3) biggest challenge u faced there
4) biggest accomplishment
5) Why amazon , there are 100 of companies out there ???

6) if u have to design the algo for searching that would be used for google , then what algo are u going to use.

7) extension of 6th : u have a huge file and u enter some key words , now u need to find the closest set of characters that enclose the entire set of keywords.

ex : let String Be "ABAACAAABXYABX....BXAC.." where these A,B,C... are words (not a single characters)
suppose user enters the keywords A,B,C then ur answer should be "BXAC"


Round 7 : (DS, Algo , OS, Puzzles)

1) what all have u read in OS. Can u describe features of any OS.

(I told lot of things that i had read in Galvin , then i started to describe UNIX , giving details about inode, the kind of scheduling algo it uses, singal
mechanism it uses ,system call mechanism , the dual mode operations , the access control of files, talked about (datablock,superblock,inodeblock,bootblock)
talked about its shell and how can its functionality be easily extended etc ... )

2) in amazon we have millions of customers daily , if we wanted to give some gift to the customer who buy 3 or more items during the last 7 days , what DS and Algo
are u going to use to store and retrive this info

3) There is a file that has N lines
where 'i' th line says : "There are exactly i lines in the file which are false"

ie .. There are exactly 1 line in the file which is false
There are exactly 2 lines in the file which are false
..
..
There are exactly n lines in the file which are false

now u have to find out which of these n lines are true.

4) given a village with demons and a sleeping man, The man is always sleeping ,never wakes up. Now a demon can eat the sleeping man , but after that
he will fall asleep , any demon can eat another sleeping demon.
If demons are very smart and would always choose to stay alive than to eat the man and risk their lives.
so if initially there are 65 demons and 1 sleeping man ,, what would happen in the village ???

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.

Tuesday, August 7, 2007

Nagarro Interview of Neha Arora

First round was tech wriiten

1. to find in a given string letter which has maximum occurance
2. To implement 8 queen problem
3. To check the status of sudoku,at any stage during the game
4. Permutation of a word

Second round was apti wriiten
bahaut sare trigo aur geomety ke ques the, aur data analysis ke ques the

Third round was interview
first ques was tell about yourself
phir he asked abt object oriented concepts
inheritance, encapsulation, polymorphism, abstraction, data hiding
phir came to virtual functions, friend functions, friend classes, which operators cant be overloaded...
order in which constructors are called, order in which destructors are called...
then some ques related to c++
then came to ds
1. what are BST
2. code to merge 2 bst,
3. then to find the position where two linked list merge,
4. to delete a node having two children from bst,
5. then what is graph
6. kruskal algo
7. prim
8. safe edges
9. dfs and bfs
then he came to dbms
concurrent queries, nested queries, he gave a query to write, outer join....
then os, context switch..
main thing is that u must answer everything with confidance ang dont get nervous... try to give ur best....
All the best...

Saturday, June 30, 2007

Aricent Interview of Sanyam Jain

Hi everyone,


1. Tell me something about yourself
2. U have opted for C++, do u kno C also. If yes, tell me the differences
3. Gave one application to solve. The details of the application are:There is a book bank in ur college. There are two set of users one is administrator and the other are students. Administrator can add user accounts, n add new books. Students can issue/return the book and some similar operations.

How will you proceed using CPP?????

4. Merge sort algorithm along with its tracing for a sample input?
5. Hashing, Rehashing, Chaining
6. Caching and the principle on which it works.
7. Multiprogramming, Multitasking, Multiprocessing
8. Meaning of ur name.. Are you patient????
9. Real Time operating system and name some existing real time OS
10. Diff between Win 95 and Win NT
11. ARP,RARP,ICMP
12. Do you want to something about aricent?

I guess that was all, n in case there will be some more then I will let you know.

Best of luck for your future.

Aricent Interview of Shikha Malik


Hi,

Aricent Interview Qs:
My interviewer asked me my favorite subjects and i said m prepared for all but she insisted me to tell so i said OS and Networks.
She asked me u know about any OS.. I said Unix n then she asked me to explain all the DS used by Unix.
What is an inode?
What is a real time OS?
What is a semaphore? For what it is used?
Which scheduling algo is used in Unix OS?
What is memory management?
What kind of memory management is used in Windows?

Then she started asking me about Networks

What is ARP?
Whats the need of 2 addresses ( IP and MAC)?Can one suffice?
Which one is configurable and which one is not?
How is the LAN connected in ur Lab?How do u access internet?
How to configure ur IP address?

Then she started asking me about my projects..
Which DS u have used in FAT ?
How did u implemented shell? Whcih commands hace u handled? Which
system calls u've used?
Which system calls u've used in FTP?
Whats the use of bind system call?

Finally she gave me a Q to code in C.It goes like take input of 2
numbers that can contain any no. of digits. Firstly i was supposed to
tell which DS i will use?
Then i she asked me to code it , take input and then add these 2
no.s ( notice they can contain diff no. of digits)

Then she asked me any question i would like to ask her..i simply
asked about hows the work environment in aricent!!

And she said all the best for HR interview!!!

In my HR interview-
Tell me about urself?
What r ur hobbies, extra curricular activities?
How many cricket balls u can fill into a maruti car?
I suggested the volume method but then he asked is there any
alternate way u can think of?
Since u were into electronics in ur graduation y didnt u opted for
core electronics and y MCA?
If i remove my hard disk will i be able to boot my system?
Still i can see the screen if i remove the hard disk? Why so?
Why would u like to join aricent?


Thats it!!!
All the best..!!
Take care :)

Aricent Interview of Neha Arora

hiii
yaar sabse pehle written tha, it was ok.. Aptitude , data analysis, os, data structures, c/c++ , reading comprehension, and e-mail writing....
c/c++ ke ques to kaafi "test your c skills" and "test ur c++ skills" mein se the.
Reading passage thoda tough tha par ho jayega, apti was fine, thoda set etc aana chahiye.....
Now cuming to tech interview...
enter karte hi, first of all he asked me tell about myself, I started with telling about my schooling, grad and then mca, hobbies, strenghths.......
then he asked whether i am comfortable with c/c++ , pointers...
i said i am ok with them..
he asked me to allocate some memory and then assign some value to it and then free it.
I wrote:
int *i ;
i = (int*) malloc(4) ;
*i = 10 ;
free(i) ;
he said it is fine now optimize it, I then used calloc but it was no better.
He asked me why i used free, i said because it allocated from heap...
Then he asked about data structures, delete last node from linked list...
phir came to networks, layers of Tcp/ip, why transport layer is above network layer.
phir asked whether i have mobile phone, i said yes, then he asked about mobile communication , i.e. its working..
then operating systems, he asked me to tell everyting i know about os, i started with its definition , then its main functions, he then asked in detail about process management... i told swapping, schedulars, jo bhi mujhe aata tha, sab bol diya, various stages of process...
phir he asked whether i am comfortable with software eng, i said i like the sub, then he asked about software development life cycle...
he asked me to implement free, on which i said that i dont know this, on which he repleied that i have to answer something, work cant go like this, so i answered something, which i thing was ok , because he appreciated my answer, even though i knew nothing about it.
in sub ques ke beech mein wo mujhse hr ke bhi ques pooch raha tha, which was the last movie u saw, when was the last table tennis match u played...
finally he askeed me to implement queue using two stacks....

Aricent Interview of Pranav Gupta

1. why OOP??
2. write advantages of OOP.
1. Then he asked me to explain each one of them
2. There were follow up questions from answers all were based on C
3. what is operator overloading??
4. how u do operator overloading??
5. how u use operator overloading??
6. what are virtual functions??
7. why use virtual functions??
8. how u declare virtual functions??
9. write a code insert a data in doubly linked list?
1. I asked where??
2. He said its sorted list??

after that he moved towards OS

10. what does OS provide
11. what are real time operating systems
12. what is a zombie process
13. what are various states of a process draw the diagram
14. what is kernel mode
15. difference between multiprogramming and multiprocessing



there were some other questions which I was unable to answer I don’t remember them then something about algorithms and networks mix

16. what is complexity of merge sort
17. leaky bucket algorithm
18. tcp and udp they were related to project but he asked disadvantage of tcp
19. what is a socket
20. there were some other question which I didn’t remember..



interview was total crap..

written test seemed to be easy

all English related.

Os ds and algo much had pointer type concept

C++ was more like one word quesn answer. Do test ur c++ skills by yashwant kanetkar.

Aricent Interview of Vikalp Gupta

Hello friends,

So, now I am going to share my experience wih you guys, so jhelo ab mera email.....


Lets start with the written test.

There were 7 sections. Each section was of some specified duration and you had to complete that section within that duration only because they took back the question paper after specified duration and handed over the next section. There was just a single answer sheet and the best part was that there was no negative marking. That meant that you can make wild guesses (but don't do that, please) . Also there was some cut-off for each section and you had to clear each individual sectional cut-off.

First section was of English of total 15 queastions and we had 15 minutes for these questions. There were 10, fill in the blanks type, questions in which we had to fill the most appropriate word (quite easy questions). And 5 more questions were there, I don't remember what type of questions...

Second section was of logical reasoning with15 questions and 15 minutes for that. Quite easy one as during the interview, my interviewer said that I scored quite good in this section.

Third section was of ......oops, sorry, I forgot

Fourth section was of comprehension, in which there was a passage which we had to read in 15 minutes and then they were supposed to take it back and give us a set of 10 questions which we had to complete in 10 minutes. But by mistake, they gave us the questions first and when they came to know about it, they gave us the passage and hence we got complete 25 minutes to complete those questions but the questions were quite 'ajeeb se' as in some questions more than 1 option seemed correct to me.

Fifth section was of Algo and OS, with 20 questions and 20 minutes to complete those questions. Quite tricky one and again, in some questions the correct answer was not given in the options.

Sixth section was of C/C++. I chose C and there were 20 questions and we had 20 minutes for that section. Questions were average (neither too hard nor too easy), but some were definitely tricky.

Seventh section was of e-mail writing, with 5 minutes to complete that. e-mail had to be of between 50-125 words. e-mail ka topic likhne ka mann nahin kar raha....
It was all regarding the written test.


Now let me share my interview with you guys.

As you all know that I was quite happy after the interview, so you can say that it was quite simple one for me, although some people had quite straineous session with the interviewers.
The first quest was as usual 'tell me something about yourself'. As it was a tech interview, so don't go into too much of details. Don't forget to mention your areas of interest. Then I was asked to write a code to find whether a number is a power of 2 or not. I thought for about 1-2 minutes as I couldn't decide whether to write a good code or to do some time pass by writing an inefficient code

Then finally I wrote a good one, which is given in K&R. Then he asked me to explain the code, which I did. Then he asked me to write another code to find the number of 1s in binary representation of the number. Then he asked me to write a code to pack an integer of 4 bytes into a char array of 4 characters. Then he asked me the difference between char *p="hello" and char p[]="hello". Then he asked me to write a code to find the height of a binary tree and to trace it, but then he started tracing himself. Then he asked me to implement linked list as arrays, implementing linked list as array of objects of some structure and using pointers too. He asked me how to delete a node in strcuture's case. I told him a solution but he wasn't impressed and told me his own solution but there was a big flaw in his solution which I immediately pointed out and he had to say that my code was right. Then same question on linked list using pointers. Then he came to OS and asked me what are preemptive scheduling algorithms, what is priority based scheduling and a little bit about inodes. Then he asked me to ask him any question, if I have one. I asked him one or two questions. Then just before leaving, he asked my the stages in SDLC in which I forgot to mention the design phase. He immediately pointed it out and I corrected my answer. And then I finaaly came out of the room.


Now let me tell you about my HR interview.

Manish asked me my academic background, then, what I know about aricent and which is my dream company. For me, it was just like formality..
So, hope you enjoyed my mail very much. No need to say 'thank you' guys....