Intern Interview Questions |

Intern Interview Questions


intern interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

How to implement a queue simply using two stacks and how to implement a highly efficient queue using two stacks.

7 Answers

Declare two stacks called in and out. queue.insert() calls in.push() queue.remove() if (out.notEmpty) out.pop() else { while(in.notEmpty) out.push(in.pop) } Don't get how this would be two questions.

Because that is the simple implementation, pretty much the exact same answer I gave them, there apparently is a more efficient way of modelling it.

Queue should implement FIFO. Let's have a group of task 1 -10 to be performed //declare two stacks Stack S1, S2; //feed stack S1 with the tasks 1 - 10 for(int i=1; i<=10;i++) { S1.push(i); } //Now S1 contains {10,9,8,7,6,5,4,3,2,1} where the top is 10 //Transfer all from S1 to S2 while(!S1.isEmpty()) { S2.push(S1.pop()); } //Now S2 contains {1,2,3,4,5,6,7,8,9,10} where the top is 1 You can now pop tasks from S2. Task 1 will be the first to pop and so on... Therefore, you just simulated FIFO using two stacks

One or more comments have been removed.
Please see our Community Guidelines or Terms of Service for more information.

The first three questions are mental math. I still remember the hardest one is calculating the 39% of 569 without any pen or paper. The next question is a simple probability: pick 2 cards from a set of poker without 2 Jokers, what is the probability that both cards are Ks. The last one is brain teaser: what is the angle between the minute hand and hour hand on a clock when 9:30.

2 Answers

Calculating the max execution time of a program that had to fit into a certain size of memory on an embedded device.

2 Answers

given a list of pairs (parent, child) navigate the list of pairs and fill the supplied data structure: class Entry{ String data; Set Children } EG: { (A,B), (A,C), (A,D), (B,E), (E,F) }

2 Answers

what kind of projects have you worked on

1 Answer

How much experience do you have with pre-production research?

1 Answer

Behavioural questions about failures and challenges etc

1 Answer

Why did you apply for ibm.

1 Answer

Why do you want to work for IBM?

1 Answer

Overall experience and Excel abilities.

1 Answer
110 of 288 Interview Questions