P. 1
SIT Placement Nbsp Knowledgebase

|Views: 0|Likes:
SIt placement
SIt placement

See more
See less

08/01/2013

pdf

text

original

# Company : Trilogy Source : Ranjith Written test 1 1. Question on computing time complexity of given code segment 2.

Given a string B like 'qqwwett7' u have to write a code which will return a string A whose length is given by the number given at last. Like here u will return qqwwett. 3. 3. Given an array of integers 1 to N-1 where N is the array length. Two of the two ints in the array are set to 0. You have to write code to find these two numbers. 4. 4. Find if there is a loop in a linked list. It should be O(N) Written Test 2 1. Given a matrix of 0's and 1's. You have to find the maximum area of a rectangle containing only 1's. 2. Given a binary tree u have to find the diameter of the tree. i.e maximum distance between two nodes. Interview Questions: Round 1: 1. Given an array of integers which can be -ve, 0 or +ve. U are given a number S. You have to find two such integers x and y such that x+y=S. find the complexity. Code for constant time and another for constant space. 2. Given a min heap. Give an algorithm to find sorted linked list from this Heap. 1) You can destroy the contents of the nodes like rearrange them. 2) You can’t modify the heap. 3) Answer should be time & space efficient. Round 2: 1. Given an array of integers with N number they can be -ve 0 or +ve. Only one of them is repeated. You have to find that number in constant space n time efficient manner. 2. Suppose these numbers in problem 1 are from 0 to N-1 then how you will do. 3. Write a code for binary tree in-order traversal without recursion..

B can see A and A can't see any one. from 0 to 9)...Company : FAIR ISAAC Source : Ranjith Contains 20 quest ----some 1hr duration mostly from Aptitude and algorithms Quetions: 1 related to algo output of 1+F((m&(m-1)) recursive function 2 one is related to --a lady has 2 children.A B C is standing C can see A & B . . 10-->one puzzle in which --. and the one other no comes 3 times fastest algo to find the one no which is coming 3 times 8-->one question ( given 3 equations and asked what these are doing) is having ans---> swapping 9-->some probability questions..9 -------------this is all i remembered hope this will help you enjoy. find the colour of A's cap 11--> a matrix 4*4 and having 16 prime no how many magical matrix can be made from it... P came and put a cap on each of them from 3 black and 2 white caps....95 < P >.....7 ki yeh prime ho --->0 5 a equation is being given find value of P (a const)if roots are identical 6 question on a table which was given ( bahoot easy the you can do them easily) 7-->201 no's are there 99 are identical and come twice.. 12-->one probability qustion is having answer .(any 8 no.one is boy what’s the probability of second ki woh boy ho --1/3 3 sorting on 3's and 9's in an array--O(n) 4 probability of 7....

Every other operator is allowed. no extra space available and the data bus is of 8 bits only(this is hint that u cant use summation) soln -..Xor the numbers !!! exam Questions: .propose DS for a T-9 dictionary(basically in a mobile device). Ans – 7 evaluate a postfix expression.which sorting algo to be used and when ? .straight forward implement a queue using 2 stacks .find the missing number in O(n) time . so an open ended prob .. When u end print the queue . then he asked to check whether the user has given me a correct pattern (in postfix form) . Source: Ranjith Use a queue of length n(each node contains 1 line).some network stuff.. asked me to check wheter it worked in parallel environment .... U have to do in constant space..i did using stack. given a document req to find the names of the docs with almost same words. some equation (i dont even know the name) ....Find max of n numbers without using comparison operator.... - asked me questions on TCP 3 way handshake. some articles/docs match .etc etc . Like abcabc... .... any kind of comparison operator is not allowed.. Round 3.Company : Microsoft Source : Nitin . So the minimum number of races to find top 3 horses among 25 horses .. given 10k docs each having some words (words are not much in number).. There may be any no.etc .. i said no aksed to improve it for such env .. . wat replacement policies .Print last n lines of a file in one pass.. .Define a data struct for the search engine which will represent whether given word is there in the document or not is should be fast...... window etc .. soln i proposed was making a tree with key values the number of the key and maintaining a linked list associated with each node .. thrashing ?? . Round 4 .. wat is paging ? .gave me a puzzle to solve and for a big puzzle write the code .once again an open ended prob ....but can't note their individual timings..Eliminate substrings from a string which are adjacent to each other and are duplicates. 5 horses can run at a time in a race and u can figure out which are the top 3.. abc is a substring which will be eliminated and the resultant will be abc... Soln...... Round1 – - Round 2 – Convert a number to base -2 representation. u cant go back in the file...an array of N-1 numbers from to N-1 . i said using shared memory . couldnt ans much .asked me some os stuff . diff b/w TCP & UDP . . You have one function that returns one line after other. . TCP stack ....

5. ex:2 is 110 -2 square + -2 + 0 time alloted:30 mins first 20 mins of brain storming... which came first.represent a number is base (-2).1.huh!) 3 panels in parellel and interviewing all the 10 at random one by one haphazardly.1) let us assume without any loss of generality.5.1 is overall FASTEST. .I mean among the five.NOW. Ex: abbabcc --> ababc --->abc Time alloted:45 mins Having got the logic within 20 mins or so.2.. 7th and final race: (1. say call .3) 6th race: (1.(Why this particular 5 tuple? Food for thought. take the top 3 of each race.1. no more ansering to Qs like what is ur weakness? what are ur short-term goals?(What does any aam kgpain has other than bhat.1. if(N<0 and odd) N=(1-N)/2 Else N=-N/2 } By the end. design datastructures such that the following scenarios take optimal time: a. print all the the docs having a given word b.isnt that great to hear abt? no HR. find the least no of races to find the top 3 fastest horses?( I sincerely advice to try this one your own before seeing the solution) Ans: 7 minimum 5 races to cover first round.2.1) top 2 among these are the 2nd and 3rd overall FASTEST. print the docs having both of 2 given words Time alloted: 45 mins This seems no tough question.3).them(1.1.4.5.5 can compete at a time..1.yeah.Somehow got it by the end by looking at different examples.2..movies.Each panel took avg 30 mins per person.and so on.3.Used balanced binay search trees with words arranged according to lexicographic order and each node pointing to a list of sorted sequence of document ids..2.1.- remove all possible adjacent duplicates in a string.1..3.25 horses are in a race. sleep and tolerating mess food. My experince with the panels: .(5. you are given N documents(possibly in millions) with words in them.2. one more exam.1.2. i started writing the psuedo-code for it.think urself) 3 panels and technical rounds and no HR.3.There could be others possible answers too.2.1 are the top 3 in the race in that order.3) (2.1. With every guy coming out of a panel room.and we are done now.1.which one second. Ans: while(N!=0) { A[L++]=N%2.1.1.2.2. We only know the order in which the horses win... . There was lot of waiting to do for all of us.2.1 2. we pounced on the poor guy coming out to know what they were asking. 1.I was getting tensed as the time was running out.1 3. array A contains (-2) representaion of N in reverse order.