Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Preparation Strategy
-P.Sandeep Reddy,
(An Alumni of NITW 2010-14 batch).
PREFACE
Hi all,
I would like to share my view on placements-preparation strategy
need to be adopted in this mini-booklet with a hope that it will clarify
the doubts of students of nitw who are about to sit for placements.I
hope this will help the software&management aspirants.I feel if
second years implemented these after 2-2 holidays,they can easily get
a good software intern in 3rd year itself as very few people will be
ready for the war by 3rd year!
P.S:All the things I am going to mention here is my personal
perspective on placements.
Software
Being from ECE, I prepared a lot for software and i personally
feel that cracking Microsoft-(Not all profiles)IT profile,oracle etc.,is
very easy as most of the times(infact all the times) the questions do
repeat-like rotate an array by 90 degrees,print in spiral form etc., And
u need to be smart enough & code well for facebook/directi etc.,(but u
need to be well prepared by the time these companies visit our
campus),wait for next company unless u feel that the company is
good enough for u keeping ur future plans in ur mind,be confident by
the end of the summer that you are about to place in first 2weeks,dont
start preparing once u come to college and keep on revising what u
studied.Make sure that you can comfortably convert ur logic into
code in atleast 1language.
C++
OOPS concepts are very important in interview
Functions
Classes-Objects
Constructors-Destructors
Polymorphism
Inheritance
Virtual Functions
Templates & Exception handling
Study Vectors,Strings,maps,iterators
*BasicC++ by Balaguruswamy
Test ur C++skills-Yashvant Kanetkar
*Advanced (Study these if time permits)
Bjarne Stroustrup-The C++ Programming Language
Advanced-Accelerated C++ by Addison Wesley
Data Structures&Algorithms
Bible of Datastructures&algorithms:
Karumanchi narasimha swamy,
seriously this book covers almost all the general&familiar
questions,95%questions are covered in this book,
also study cracking interview by gayle lakman,
Linked lists
Stacks
Queues
Trees
Graphs
Selection Algos
Sorting Algos
String Algos
Dynamic Programming
Divide & Conquer
Greedy Algos
Operating Systems
Basic-Process Concepts,Threads
CPU Scheduling
Synchronization
Deadlocks
Memory Management
Virtual Memory
Refer Galvin
If time permits,have a look on DBMS (easy) for
Oracle&Networking for Cisco.
Resume preparation
*Make it structured&keep only valid-in-context points
*divide it as academic/projects vs extracurricular
*No 1 will check your certis &make sure that you can justify
everything you wrote in resume
Management
There is no rule that people with low c.g.p.a should go for
management.It completely depends on ur personal interest.
Trust me-Nitw gives a lot of opportunities to explore ourselves via
Tz,Spree,Clubs,Technical associations etc., Do involve in them
instead of wasting time in room as they act like an interface to the
future practical world-they give you lot of memories&experiences
which count&matter a lot!
Lets go step by step
Apti
You need to be very good in aptis as you need to show difference
between u and remaining candidates.
Quant: Time material/arun sharma
even Rs aggarwal is ok,but if u go with a higher level book you can
solve even if the paper comes little bit tough
Logical reasoning:Time material
go for tips-questions lyk all dogs are cats etc.,seating
arrangements,logical sequences etc.,
G.D
Initiate the topic with a valid point,it will add you extra points,
Dont shout,
dont point out ur fingers,
keep urselves cool,
make sure that u speak 3-4 times with 5-6 valid points,
u should appear like a critic-Use few good english words,sentences-"I
do agree with ur point,but we need to consider our basic objective/we
need to look at both sides of the coin etc., support ur arguement and
dont make out of context statements
Puzzles
One of the important area where the interviewer will assess your
logical thinking skills,try the question,it mainly depends on ur way of
approach,to be frank- even if u know the answer for a question,dont
answer immediately,act like that you are facing the question for first
time and rotate ur pen,hammer your brain and then give them the
answer
Suggestions:
wuriddles.com
How to ace brain teaser interview by john kador
if you cover these,u can be confident enough as when some of my
friend who comes out of an interview room with a sad face that he is
unable to answer some puzzle,i am in a position to tell the
approach/answer as soon as he starts the question.No question will be
new!It may be just something which u never heard,covering the
models from above books/sites will give u the skills to answer a new
puzzle even!
Most important parameter for placements is how well you,REVISE
what you read regularly!
Interview
The key stage of the complete procedure,Sell urself,Express to
impress!It's ur day&no one is gonna stop u,utilize each&every
chance you were given to speak.Manage eye-to-eye contact,wish
them,be cool & the most important:keep smiling!
Be prepared!dont just go and give random answers,analyse ur profile
and think of-what questions he may ask you,what are the counter
questions u may face based on ur answer,Be planned and answer all
based on ur past experience,make sure u should appear like a honest
person to them and dont get into trap by bluffing-answer only if u are
confident enough about a particular area.
#Be prepared-but ur answer should appear very natural
Futures first(Finance):
round1:5mins 30 questions-calculations,speed maths(370 members)
cut.off:20,i did some 28-29
round2:CAT level questions:math&logical reasoning,30 mins-30
questions,negative marking is there(100 members)
cut off:10 i did around 18they called 11membersinterview@hyderabad,each round of 20-30 mins,after 2rounds they
shortlisted 3members and then final round interview:I got selected :-)
stress interviews,they will shout on u,cross questions,countersmanage ur smile
now i am going to present the general interview questions which i
answered for Futures First and many companies ask these ones'
2)Ur strengths
regular answer:
Passion towards work,zeal to do something
better,hardwork,dedication->support ur answer with few instances or
where u have showed the characteristics/how u took risk/how u dealt
with tough situations--If u are there in ur team,the complete team can
have the confidence that Xyz is there,no need to worry,everything
will go on smoothly
3)Ur weakness
Answer Depends on company and tell one of ur minor weakness and
support ur weakness too-> procrastination/giving work to only few
sub.ordinates in team(support this by saying that ur ultimate aim is to
get the work done,doesn't matter what the people think,i will convince
them once the work is done)
ALCATEL-LUCENT
basic C++ programs like string reversing, insertion and deletion in linked lists,
stacks and queues.
OOPs concepts and DS programs like Inheritance, Polymorphism, Virtual
Functions etc..
Printing leaf nodes using recursion, Implementation of Stacks and Queues.
b. java :he wrote some program and asked to explain the difference on threads.
c. what are exceptions?
d. interface
e. multiple inheritance
BROADCOM
1) given a 64 bit register containing 1s and 0s in random fashion. I was asked
to find no of 1s in
minimum time.
2) started with CN. Then, he moved to boot loading program over which we had
20 mins discussion. At each
step, he was asking me to relate OS and Microprocessor
COMPUTER ASSOCIATES
what is a function pointer? where it is used? explain scheduling in process
management? is the
maximum amount of RAM dependent on the CPU? and a some programming
tasks like overload '+' operator for
a class of points in 2-D space? implement stack using a singly linked list?
FACTSET
based on the concept that a const string cannot be
returned to non const string
2) aasssstttttppppppp....... output should be a2s4t5p6.....
3) code to find shortest path between two nodes in a binary search tree,
your output should display all nodes in the path.
4) write the code to print square matrix helically
5) reverse singly linked list two at a time eg input 2->4->8->6->9->1 , output is
4-
>2->6->8->1->9
6) question was based on stack overflow, it that main function was calling itself
again and again resulting in
stack overflow
7) In a array of size n, there are numbers whose values are between 1 and n. In
that one number is repeated,
so obviously one is missing. Find the repeated number and missing number
8) Some C++ oops concept was asked like default constructor and concept of
globle variable
In the second round, it is completely logic based questions and presence of mind
is a must. He asked on linked lists and their manipulations like detect a loop in
the list,find the middle node without counting the number of nodes,find 1/3rd
node in a list by traversing only once( i mean if there are 9 nodes, our function
should return 3rd node) and questions on operating systems like what is a
thread,virtual memory,their advantages,process synchronization,about
semaphores and other stuff.
a)Dividing a singly linked list into 3 equal parts if no of nodes is a multiple of 3
otherwise 1st two should be same and greater than the third(for 22 nodes:8,8,6).
b)In an array all numbers are repeated except one.find it.
c)Recursive sorting of a singly linked list in 1 pass.
d)code for the mirror of a tree.
e)code to remove the comments from a C Program and some more.
we had to write code/psuedo for problems like dividing a linked list into 3
parts,mirror tree,sorting a linked list (recursion single pass) and a matrix
problem..
and there was one database question which i dont remember(we had to design
database and then also had to write a query)
and a question where we had to draw the circuit diagram of staircase switches(1
bulb, 2 switches)...
and a puzzle-a person sees the time in mirror and goes to office (travel 20 min)
and then sees that time is 2 1/2 hours more than what he had seen at home..what
was the time he actually started(4 different answers)....
the questions were logical like where can we use the value returned by main
function(by calling it again in main fucntion recursive)....what are the problems
when we use goto statements in our code....design a database for some student
details...implement a stack using 2 arrays....and a puzzle-a rectangular piece was
has been removed from a rectangular portion divide the remaining portion in 2
halves using only one line...then he asked me tell about race condition(i told i
dont know)..then about deadlocks(some practical questions like the deadlock
occurs or not when the printer is switched off and we give a print command...
in the second interview he asked me tell an algo for ..we will be given string
which contains characters and numbers... we have to separate characters and
numbers into two different strings..I first told him an algo he then asked me to
optimize it ..i optimized it(he was impressed with this)...and some questions
from os like what is bios,boot strapping...and OOPS concepts were asked(be
well prepared for these question they will be asked for sure.. and they will be in
depth like run-time polymorphism,copy constructor,operator overloading,virtual
destructor,overloading etc)...i attended 7 interviews and in all interviews
questions on oops concepts were asked so be well prepared for those questions
GOLDMAN SACHS
there's a gold bar with 6 markings dividing it into 7 equal parts. You are
allowed to make 2 cuts anywhere on those markings (dividing bar into 3 parts)
and you have to pay a servant an
equal amount of gold for 7 days. Solution: You cut at the 1st and 3rd markings,
diving it into 3 parts of size-1,
size-2 and size-4 (totally 7). First day you give him 1 part, next day give him the
size-2 part and take back the 1st
part (binary scheme: 001 010 011 etc).
ii) A creeper is wrapped around a cylindrical tree spirally from the bottom to the
top. Given dimensions of cylinder,
find the length of creeper. Soln: unroll the cylinder to a rectangle with sides as
height and circumference of cylinder.
creeper is diagonal.
programming questions were pretty straightforward like code to find the no. of
instances of a word in a file etc.
He asked me about Polymorphism Function Overloading Virtual Functions etc.
Then I was asked
to write a code for a "movie " class
NVIDIA
1) write the prototype
for the function which will count the number of zeros in a given integer. It was
unsign char count(int);
2) the average time complexity for the array with 5 spaces and 20
elements in separate chaining fashion and the array with 20 elements and which
is faster to search the
element.He asked advantages of paging and what is binary semaphore and how
it works.He asked me to write
the function to swap two numbers without temp variable.After that he asked
what is virtual functions,abstract
class,virtual destructors , why virtual constructors are not present and pure
virtual functions and to explain
them with real time examples. He asked about binary search tree and how it
works and what is the time
complexity to search a given element and how that time complexity came.
ORACLE
1) advanced coding in which all the questions are
from avl tree.he gave one code regarding to avl tree operations
2) write a code for binary tree sort
questions on os like what is trap,process etc..
write a code to reverse a word in a string if the word contains a vowel,again
explain oops concepts,constructor,destructor,explain about threads.explain
polymorphysm with
example.difference between structure and class and multi dimentional array. difference between arrays and linked lists,where do you use each of
them,explain with examples
-program to print even numbers from 0 to 100,he asked more about what are the
errors that might occur,how to
-given a bottle full of water and an empty vessel,how will you pour exactly half
of the water in to the vessel in
one attempt,without any trail and error(pour till water level is diagonal to the
bottle,like the water level is a
line joining one end of the mouth of bottle to other end of bottom)
2.Swapping of 2 numbers without using a third variable,
3.A rope burns in 1hr,how to measure 30 n 45 mins
Basic programs like
reversal of a string,finding depth of a tree using recursion.
DIRECTI
merging two sorted arrays, finding the kth element in two sorted arrays,
permutations of merging two series such that their relative order is maintained
A={400365471012}
You start at the first element. From here, you can jump as many places ahead as
the value of the cell you are at. E.g. from the initial 4, you can jump to 0, 0, 3
and 6. You are stuck if you end up at a 0. Give an efficient algorithm to find the
path with minimum jumps from start of the array to the end.
+ is string concatenation operator
a1 = ()
a2 = ( + a1 + )
a3 = ( + a1 + a2 + )
a4 = ( + a1 + a2 + a3 + )
.
.
an = ( + a1 + a2 + a3 + ........ + an-1 + )
Given n and p, find which bracket would come at pth position in an.
1. Maximum Sum Sub-Array Problem.
2. You are given a n*n matrix having 1's an 0's in them an given an integer k.
You have to find a rectangular region
such that it has k 1's in it.
3. Non-Consecutive Maximum Sum problem.
4. Given an array. Find indices i and j such that A[i]>a[j] and i>j such that i-j is
minimum.
5. Finding majority element in an array.
6. Find any duplicate number in an array of very big size.
1. Algo+Tech 1 :- this round was in college itself just after the written
examhe asked me the following questions
in an array there is a number which is guaranteed to be repeated more than n/2
times. find the number in o(n)
time and o(1) space complexity.
We r given 3 arrays of equal size.a number k.we have to find 3 number
one from each array which add up to
kgive the best solutionI first gave n3and n2 solution.
What r your favorite subjects and how do you rate yourself in then out of 10
and why.
Why do we prefer oops?
What r all complex data structures you have implemented?
What did you do in ipc.tell all programs..asked me to explain coordinate
server.
What do we use for ipc if processes run on different systems?
2. Algo+Tech 2 :- this round was just after the first round..
We are given a number of balloons with different sizes and only one parameter
to indicate size.we can fit smaller
balloon in largerwe hav to make minimum number of sets such that in a such
after fitting into each other they
reduce to one balloon .
8. Final round :- this was taken by CEO of company itself.he asked a few
thingsbut all in depth
Given an array having +ve as well as ve numbers .find the maximum
subsequence sumif there are two
subsequence such that both sum up to maximum.print the smaller one.only
one scan allowed..asked to write
the code after listening to algo.then said to optimize code.
Asked about multithreading..how is it helpful.then saidif we have only
one processor and there is no read
write.we have just computations.why would we use threading..then said
we have 100 computations.and 2
processors.which one will do faster one thread/two thread/three thread
and why.
Compare bst and hashingasked me to give 7 differences ..how to improve
hashing if we have many
collisions.i said linear chaining/linear probing/quadratic probing.he was
not happy.then I said to use bst in
place of linear chainand then I said multiple hashingand he was happy.
ADOBE
Given an array and a Number N find all sets of 2 numbers that add up to N.
Started
with O(n^2) then went onto O(N) solution using i) hashing ii) O(N) using sorted
array. 2) Given a dictionary (Can be
traversed linearly from the first) and a word, find all legal permutations of the
word. 3) I have a clock at the bottom of a
hill giving me correct time, and one on top of the hill which is not working, how
can I synchronize the 2 clocks, time taken
to go up is more than it takes to come down. 4) What are heaps, threads,
Pthreads, have you done Pthread programming,
what programs ? 5) Write a class for Stack considering all loop-holes and error
conditions? 6) Give a program to print a
string in reverse using simplest solution possible. 7) Divide an L-shaped area
into 2, 3, 4 equal parts. Divide a square into 7
equal parts. A few more were asked that I do not remember, which were on the
same lines as above.
Coding for finding no
of times a character repeated in astring, Coding for finding a substring in a
given string,
C DOT
1. name the layers of ISO OSI refrence model. 2. function of
{
while(*src)
{
*dest = *src;
*src++;
*dest++;
}
}
int main()
{
char p[100]="hello";
char *q;
q = &p[1];
mystrcpy(p,q);
printf("%s %s",p,q);
}
What will be the output for this code.
5) It was something about searching the first occurence of string2 in
string1.(Can't remember it exactly)
1) You are given 2 sorted linked lists. Write a function to merge these 2 linked
lists into a single sorted linked list
It was told to give the most optimal solution. I did it in O(n) time complexity
2) Write a function to find out the Inorder Successor of a given node in a Binary
Tree
This question was already asked in the Technical Aptitude Test to find out the
errors in the function provided. So I was able to recall that function and I could
rectify the errors and write the code.
1) Write an atoi(alpha to integer) function. I was asked to take care about the
MAXINT and also any kind of input the user gives, this function should return
proper ERRORCODES.
2) How will you test a temporary marker? Give all possible test cases in order
of priority.
3) Given an integer array, you need to find out digit with the first occurence of
the duplicate. (Only Algorithm was asked)
2nd Round
--------1) Write a function which takes a string 'st1', a character 'ch', a set of characters
'str2', total memory allocated to 'str1' as arguments and that replaces all the
Answer: whenever test cases are asked, the most important tests are the ones
which involve the obvious working of the website. ie first it should be able to do
its intended job.
So the first few test cases were like: create a new user, log in using the correct
username and password, check if the listings correspond to the actual listings
etc
Then comes improper use tests like wrong password etc
Then comes ambiguous cases like two logins to the same account from different
systems, two bookings for the same ticket at the same time etc.
Second round
First question: Delete a binary tree. ie free the memory used by the tree
I wrote a recursive function for it.
Second question: Delete a binary tree using iterative function
Third question: A file contains numbers from 1 to 4 billion, no duplicates. But
one of the numbers is missing. Find the missing number
Basic logic: add all the numbers in the file. Subtract it from n(n+1)/2 where
n=4billion. The problem is n(n+1)/2 does not fit in 4 bytes. So I had to do large
number addition and subtraction using arrays to store large numbers.
Third round:
There was only one question: There are two linked lists. Each linked list
represents a number with each node containing one digit. Add the two linked
lists.
First I thought of reversing the linked lists and then adding them, but the
interviewer didn't like the idea though it is O(n).
The correct solution is to add it from the begining. Whenever you are adding
two digits, always check the digits to the right of the ones you are adding. If
their sum is less than 9, there is no problem. If their sum is more than 9, add one
to the current sum. If their sum is exactly 9, use two other pointers and go
forward till you find two digits that either add up to greater than 9 or lesser than
9.
Fourth round:
This was a testing round.
First question: You are working in Nokia. You are given the profile of a person
as follows:
The person is very careless and puts his phone through very rough use.
Sometimes he drops it. Sometimes he puts it in his back pocket and then sits on
it... you get the idea.
The person doesn't like many applications. All he wants is his calls and his sms.
There is however, one game which is there in his phone. He plays it whenever
he gets free time.
The person travels extensively. Assume that in this universe, there is signal all
over the world.
Also the game company assured that their game will perform well for the given
software.
What are the tests which should be run on the phone?
Here again, the basic tests should run first. Does it switch on and off? Do all the
buttons work properly? Can it recieve incoming calls and sms? Can you send
incoming calls and sms? etc
The next important thing is the rough usage of the phone. Put it through various
stress tests like drop test, water resistance, load tolerance, bending,
compression, pulling, shear, abrasion, whatever you can thihnk of.
Then is the international usage. Test for call rates, charging/plug points, climatic
extremes etc
Last, test the game if it interracts well with the other applications etc
The next question was in two parts . You are given two singly linked lists.
i) do they merge at some (any) point?
Ans: go to the last node of both the linked lists. If the last nodes are same, they
merge at some point.
ii) find the node where they merge.
Ans: Find the lengths of both the linked lists. Let the lengths be m and n with
m>n (say) Now skip m-n nodes in the first linked list so that they are of the
same length. Now check the first element of the first linked list with the first
element of the second linked list, then the 2nd nodes and so on.
NETAPP
1.write a c function for strstr? 2.what are the phases of compilation? 3.what
happens when we read from a
NULL pointer? 4.some stuff on segmentation 5.explain system stack? 6.he gave
me a recursive function and asked the
output Second round: 1.write the nonrecursive version of inorder traversal of a
binary tree?what are the pros and cons?
2.what is an ISR 3.explain CSMA/CD protocol? 4.how would you program for
memory fragmentation?and improvements
on it in terms of time & space 5.how do u find a cycle in a singly linked
list?what are the best & worst case complexities in
terms of the lengths of linear and the circular portion & when do they occur(this
is the difficult portion of it) 6.write c code
for counting the number of bits set in a number & improvements on its time
complexity? 7.what is TCP/UDP ? explain the
differences & their aplications? 8.a 5*5 square is divided into 25 equal squares
and are shuffled.write a c program to
rearrange them to get the original square? 9.6 men on one side of a river how to
transfer them to the other side in minimum
possible time? 10.how many tries r required to find the floor in a 100 storied
building with 2 eggs
ORACLE
efficient way of finding duplicate no. in an array without using sorting...(use
hashing), design a spinning wheel game(just approach) few questions on stack
implementation.....
2nd round : few question from computer architecture n microprocessor, then
array reversal with all its element also getting reverse, remove special character
from a paragraph.....n finding 3 students with maximum marks in 2 different
subjects( given in an array like student[100].marks_1[100],marks_2[100]) n 2
simple puzzles (apple,orange n mixed jars with each labelled incorrectly n 36
horse n 9 poles prob.)
3rd round: 1 puzzle on 100 doors.....given a string print words in alphabetical
order n find the no. of repetitive words...
In first round I was asked to write full code for 2 questions, first one was to find
a loop in a single linked list and second was to find the farthest distance in an
array of numbers. Both are easy questions and I wrote the full code with proper
syntax.
In second round I was asked about dynamic memory allocation in C,C++. Few
questions on Classes in C++. How to implement K Maps in data structures, I
said about bi-dimensional arrays and wrote some code. After that I was asked
questions on Networking and OSI model. Few questions on HTML &
Javascript.
He then gave me a structure with an int, float and a char. He asked me to tell the
size of the structure on a 16-bit and a 32-bit machine. I first explained him the
concepts of Byte Alignment and then calculated the size in front of him. He
then rearranged the order of int,float and char and again asked me the size of
structure.
He then asked me some puzzles.
1. There are 4 people who can cross a bridge at different speeds. There is only
one torch and at a time only two can cross a bridge. What is the minimum time
in which they cross the bridge.
2. There are 3 people. One always says the truth, the other always says lies,
while the third may sometimes say the truth or sometimes lies. In how many
questions can u find out the identity of each person.
Second Round:
I was relieved to get through to 2nd round. I think 17 people were shortlisted
from 40 odd people after 1st round.
After some general introductions he gave me some codes to write.
1. There are 2 strings str1, str2. return the starting position of str2 in str1 if str2
is a substring of str1 else return NULL.
2. The user is taking (say X) inputs. I had to print all the numbers that the user
did not input b/w 1 and X with minimum time complexity and space
complexity.X could be a very large no. in millions.
3. The user is taking integer inputs. Whenever he inputs '0' then print all the nos.
up until then in sorted order. Keep on doing so until he inputs '-1'. Give the best
optimization, data structure for this.
He seemed satisfied with the solutions and codes that i gave.
He then shifted to OS. Asked several questions on Processes, Shell, Kernel.
Memory and stuff.
I was not able to answer many questions on OS but it is very important to stay
positive. I explained to him that i haven't done much of OS programming and
can definitely improve much on it.
In first round , The first question was tell me about yourself . Other normal
questions from almost all major Computer Science subjects were asked( C ,
C++ , DS , OS , DBMS) . Some Java concepts were also asked . Some of the
problems were OOPS concepts , virtual functions ,deadlocks ,its prevention and
avoidance , Bankers algorithm ....which I could explain to her only partially ,
types of joins which I explained in detail ( Inner , left outer , full outer , right
outer).
Then she asked to write 2 DBMS queries for the following - there are 2 tables
student(stuID,score,deptID) and
department(deptID,deptname) .I needed to retrieve deptname of the student
having maximum score and other query was to find name of the department
having maximum students .
Then she asked various sorting algorithms and discussed upon the average and
worst case time complexities of each of them . She asked me to explain heapsort
for a given set of values .
In the second round ,the Interviewer asked me a lot of puzzles which are
available on the Internet like The coconut puzzle for 5 sailors, the 13 15 17
chameleon puzzle . I could not get the final answer of the puzzles but I told him
the approach .I think he got impressed by that . If a solution was too long , he
said "OK fine " and moved on to the next puzzle . Then he asked another puzzle
like there are N horses and N jockeys in a race . But the last horse is declared he
winner . How would
you manage this condition such that the race should be fair (If the jockeys know
that last horse is going to win ,they may ride very slowly so the race may never
end) . After that another puzzle - There are a certain number of Apples . If we
pack 10-10 in each bag ,we are left with 9 apples ...If we pack 9-9 ,we are left
with 8 ...likewise until we pack 2-2 in each bag and we are left with one ,what is
minimum number of Apples required ? (the answer is 2519) .
In the end he asked me some general C++ questions regarding virtual functions ,
inheritance .The subject related questions in this round were normal ,I answered
them all but 1 question that I couldn't answer was that whether threads of the
same process share the same stack space.
1st Round (Technical)
*What are the subjects u r comfortable with?
DS nd OS
*Explain abt thread nd process
I told everythin I know like def, diff, wat nd wat not they share
*What is stack overflow?
I explained him wat it is it?
*Asked to write a program for same
Done with a staic variable nd rec fun cal
*What are storage class specifiers?
Answered all types like static,extern,register,auto wer their significance nd wer
they r stored
*He screwed me with extern, asked should we hav to use extern for same file
I said no,
*Den how ll u use it?
Didnt leave me until I said dat I ll link 2 obj files into an exe file
*Then asked to explain abt preprocessin?
*Then at wat point header files get loaded?
*Another panel member started with diff bet c nd c++
Told abt all oops concept
*Then he asked to write a program for diff kinds of polymorphism
Explained abt static (overloading) and dynamic(overriding i.e. virtual function)
*Asked if Im comfortable with unix commands
I said no, its an elective nd didnt opt for it(unix ppl ll not hav dis choice :))
*But he asked me to xplain redirection of i/p and o/p
*Did dat so asked one more like to display only 4th column of output
I said dont know, so he didnt go further.
*Asked abt joins
Told all types (left, right, outer nd inner)
2.write graphs using sql 3.Print an alphanumeric string which has its length
printed at the end
a) to find out the second largest word in a paragraph - without using sorting
methods. In event of occurence of two
words of the same length or repetition of words, all the words must be printed.
b)to count the no. of unique elements in an array of nos.
Puzzles-If there is an offer to exchange 3 butts for 1 cigarette and I go with 10
butts, how many cigarettes can I
smoke (ans=5.. think how !)
There are different jars having different no. of pills but each pill is of 10 grams
except for 1 jar which has all pills of
9 grams. In a single weighing find out this jar
Round 2:- How different is the implementation of oops concept in c from that in
c++ ?
What is polymorphism, abstractism ? Can we implement one without the other ?
Does Polymorphism always have to mean classes ? If classes dont have
memeber functions, does that still mean
polymorphism ?
Write a program to display the no. of 1,2,3,4,5...... lettered words in a paragraph
Can you implement strcpy without using strcpy command or without using a
3rd variable (hint: use pointers)
If i enter a single or double digit no. print it in words(dont use switch case)
What is a copy constructor ?
Some basic questions in SQL
Quick sorting, binary search.
Round 3:- What do u know about OS
What is the difference between dbms and rdbms ?
Have u ever developed a user interface program in c++ ?
sorted order with space and time contraints. 2. given any two dates, write a
program to find number of days
between them.
1. Given a long string, arrange the words in alphabetical order, delete the
duplicates and output the words with
their frequency.
2. write string copy function using pointers
3. find the sum of digits of a given long number till a single digit is obtained.
4. swap 2 intergers without using temporary variable and witout using + 5. give algo for generating random number
6. find the number of squares on a chess board
7. 2 stacks are given, one is full of numbers and other in empty, one integer
variable is given, fill the 2nd stack with
numbers in ascending order with space and time constraints.
1. 3 ants are located at three ends of a triangle, they start moving towards each
other, what is the probability that
they will collide
2. a class of ten students is given, their marks in physics chem and maths are
given, rank them. complete working
code for this was asked
1. There is an array having 1 to 100 numbers randomly placed. But two
numbers are missing from the list. What
are those two numbers?(no hashing,no sorting)
2. There is a paragraph of words find out the second largest word.
I was asked questions on Data structures like What kind of Data structure linked
list is and tree is? What is a data
structure? What kind of language C++ is? Explain OOP concepts with
examples.
Puzzles.
1. There is a room having 3 bulbs inside and 3 switches outside, you are outside
the room and cant see anything in
the room. You can go inside just once. You have to find out which switch
corresponds to which bulb?(hint: you can
touch the bulbs)
2. There are 5 jars with regular pills weighing 10 gms in 4 jars and
contaminated pills weighing 11 gms in one jar.
You have a balance and weights and you can weigh just once, how will you find
out which jar contains
contaminated pills? You cannot mix pills.All look alike.
7.Given a list(array) of positive numbers. Write a prog to find out the nearest
pair(least diff) with 3 different
time complexities.
1. explain all the OOPS concepts which u know.(this fetched me a lot, i
explained all the topics with good
examples, i took around 20 mins only for this question)
2.write a prog which takes time(HH:MM)as input and gives the angle between
the hands as ouptut.
3.one puzzle
if you are given a task to represent all the days of a month (01,02,03...31) using
two dice.
What numbers do u paint on faces of each die.
- Code for Quicksort
- There's an array of unsorted numbers, we have to find the pair of numbers with
least difference. Eg:
3,12,7,18,11. The answer should be 12,11 since the difference is least(1)
My first technical was about 1 and half hour.I was asked about data structures
and c concepts.He asked me to do
some
coding.He asked me about Mergesort algorithm,write some code to find
whether the machine is bigendian or little
endian.
Find Least common ancestor for a binary tree in efficient manner,String
reversals,and etc...They asked to write
code and
2. pattern finding and matching in a string.
3. common ancestor of a node in a binary tree.
CISCO
1st round-(questions were based on resumes).he saw a project in my profile(My
project was on a programming tool
called 'splint'-used for statically checking C programs for security
vulnerabilities and coding mistakes).I was asked
to explain..I went on why we need to check,how the tool is used...
Then he askd my favrite subjets...networking and OS.,.,.(this was the part which
got me placed).
I was asked to explain the osi model.,... Next 15-20 min i explained the
first three layers.,i gave him.,.,what are the functions of each layer,what are the
protocols used
(ARP,RARP,BOOTP,DHCP).,.y a particular protocol is advatageous in some
cases...signifiacance of mac and ip..
how the routing is done,.,what are routing algos used(DVR,OSPF)..when i
started the fourth layer he said me "its fine" .,.,!!
he said me to about quick sort,,i explained good,,.
he asked me about traversals in tree.,.i explained about inorder.,,.used for infix
notations and its use in language
processors.,so i needed not to explain the preorder and postorer,.,!! :P
how to insert an element in sorted array,small code for dat(its primary for cse
guys ofcors.!!).
2nd round-The first question was-why u need to use the IP when we have
mac..(basic need)...every one figure this out !!
next he asked how an interupt works,.,
he gave me one interupt code asked me to find the fault-(u neither pass
arguments to interupts nor dey return
something..the code had both faults).,even i explained cases for how an interupt
is never carried out.,
y virtual memory ??.,.,paging.,??
shifting operators.,.,.
how to set a particular bit in a byte..,(dont shift any thing)
3rd round-this was by the main person:
1.multiprocessing....?? He asked me the basic element for this.,.Like many
think,its not the context switching,queue in memory,
process control table .,.,its the 'timer' required.,!!
2.code for deleting a node in double linked list.,., ?
3.what are the advantageous of a sorted linked list.,?
4.volatile,static and global variables in c??
5.pointer to function,array of pointers to a function.,??
6.Best way for swapping....??.,.,.,y??.,.,., type of function call used..,?
In the first round,the interviewer asked me to write some code on functions
pointers,basics of C,passing variable number of arguments to a function,string
operations,different operations on AVL trees,different stages of compiling a
program,different layers of OSI model,socket programming and a few more.The
first round ended up with a few puzzles.
The second round was the coolest round I had.Questions based on Object
oriented characteristics,basics of C such as a few codes based on bitwise
operators,keywords like volatile,OS concepts such as semaphores,IPCs,a
problem of real time operating systems based on scheduling algorithms,code
conversion from java to C,endianness of architecture and a few questions on
CAO and a few more questions.
The third round doesn't seem to be completely technical.Questions from
concepts of OS,Networking such as router,switch,3-way hand shaking etc were
asked.This interviewer asked me some general things such as background,future
plans and finally asked if a had any questions to ask.
Round 1: This round was fully on operating systems and networks only. He
started looking at my resume and strted with a subject called Systems
Programming. He asked me wat is it and i explained him about the subject in
detail. Then he asked me about interrupts what happens when an interrupt is
called. I explained him everything in detailed fashion and he seemed to be
satisfied with my answer. Then he switched to Operating systems and asked me
about the role of scheduler during the interrupt. After that he asked me abt
various scheduling algorithms, their advantages and disadvantages. Next he
went for critical section and asked me about IPCs. After my answer he gave me
a case of a low priority process executing a critical section using a semaphore
and a high priority process coming for it in case of a priority based scheduling
and asked me how i resolve this problem. I told him the different ways of
resolving this conflict (pre-emption of the low priority process by storing the
contents in the stack etc.) and he seemed to be happy. He asked me about
networks and asked me about the various steps involved when an email is sent. I
explained him about the osi layers and the job of each layer in the process. He
then asked me about RIP and ARP protocols and i explained everything in
detail about them and the various types of routing (Distance vector routing and
Link state routing) and the extentions of ARP (RARP, BOOTP, DHCP) the
advantages of one over the other (Good that i have read their RFCs for my end
semester exam last semester). This ended my first round of interview, and i felt
that i did well...
Round 2: This was more focussed on algorithms and a little HR
He started with questions like Why Cisco, What are your interests etc. Then he
asked me about how i much i will be rating me in my C knowledge out of 10
(Be careful in answering questions of this sort).
Then he started with simple coding questions like how will you identify the first
bit in an integer that is 1 etc. I was able to answer it very easily... Then he asked
me a few probability questions questions. A few questions on OOPS included
concepts like Virtual classes, and he asked me to give a real life example of
each OOPS concept.I find that he was more interested in our approach to solve
the problem rather than the actual solution.He asked me about the advanced
data structures (B trees, B+ trees and Tries) , their advantages and disadvantages
, and the differences between each. This ended my 2nd round of interviews.
Round 3:
This round started with HR again! He asked me about my interests, what made
me interested in Cisco, my career plans and why i am not interested in going for
higher studies etc. He seemed to be satisfied with my answer and went for
technical stuff. He started with C++ and OOPS, and asked me the questions on
types like Static, Volatile etc and asked me to explain the difference betn a
static variable and global variable. These continued with few coding questions
(mainly Data Structures), questions on Operating Systems and networks. He
asked me about the programmes i have done in my 3-2 in Computer Networks
(I told him frm the basic TCP Chat server to Raw socket header capturing etc..).
1) if sorted array is given and one integer n is given as an input we have to
return all pairs in array having there sum equal to n.
this is very common question.
i gave answer with O(n) time compexity.(take two pointers one at the starting of
the array and one at the end , if sum of the numbers is n then return those two
pointers, if some is less then increment the first pointer , else decrement the
second pointer )
2) he modified the previous problem. this time array is not sorted.
this question is also very common.