Intern Interview Questions
- -1of 3 votes
AnswersWhat is polymorphism? what does it do?
- barrysingh1108@googlemail.com February 01, 2014 in UK| Report Duplicate | Flag | PURGE
Sage Software Intern Java - 0of 0 votes
AnswerWhat are design patterns?
- barrysingh1108@googlemail.com February 01, 2014 in UK| Report Duplicate | Flag | PURGE
Sage Software Intern System Design - 0of 2 votes
AnswersIn the Amazon Office, Employees are use to sit in cubical offices and all the offices are connected with some other offices, but they are not arranged in any well defined order. Offices are connected means they are sharing their walls with other offices. There are two types of Employees in Amazon i.e. 'Testers' and 'Developers'. Manager of Amazon don't want any 'Tester' and 'Developer' to sit in nearby cubical office, it means there should not be any shared wall between two 'Testers'/'Developers'.
- vinod January 24, 2014 in India
Input:- First line consist of an integer n, which is number of common walls.
Next n lines consist of 2 integers a and b, which represents the Office Number between which the wall is being shared.
Output: - Print 'Yes', if condition of the manager can be satisfied and print 'No' if not.
Example: -
1-2-3
|
4
Office number 2 is sharing its 3 walls with Office 1,3 & 4.....that is why if Office 2 has a 'Developer' than Office 1,3 & 4 cannot have any 'Developer'.
INPUT:-
3
1 2
2 3
2 4
Output: -
Yes
Any better approach then DFS i.e. O(V+E)..??| Report Duplicate | Flag | PURGE
Amazon Intern Trees and Graphs - 2of 4 votes
AnswersSearch in a row wise and column wise sorted matrix
- vinod January 24, 2014 in India| Report Duplicate | Flag | PURGE
Amazon Intern Matrix - 2of 2 votes
Answerplease help me out!!..Its not striking me.
- guptaabhinav206 January 22, 2014 in India
Ramesh and Suresh get a box full of five stars on lottery each. Since both the boxes need not have the same number of chocolates, they decide to play a game. The winner gets to have both the boxes of chocolates. They play alternatively and Suresh starts the game. Given the number of chocolates in both the boxes, let them be c1 and c2, the player takes either c1 or c2 number of chocolates and divide the remaining box of chocolates to two boxes (these two boxes need not have the same number of chocolates). The player who cannot make such a move loses. Input
First line of input contains a number T(1<=T<=1000), the number of test cases. Then follows T lines each containing two space separated integers c1 and c2
(1<=c1<=c2<=10000).
Output For each test case print "Ramesh" or "Suresh" depending on who is the winner.
Input: 2 3 1 4 5
Output: Ramesh Suresh| Report Duplicate | Flag | PURGE
Capgemini Intern Algorithm - 0of 0 votes
AnswersReplace each node with the sum of all greater nodes in a given BST?
- vinod January 21, 2014 in India| Report Duplicate | Flag | PURGE
Amazon Intern Trees and Graphs - 1of 1 vote
AnswersHow will you Serialize and Deserialize the binary tree?
- vinod January 21, 2014 in India| Report Duplicate | Flag | PURGE
Amazon Intern Algorithm - 0of 0 votes
AnswersGiven an array of +ve as well as -ve numbers, find out whether it is possible or not to convert it to 0 by adding/subtracting operations on all the elements.
- prateeksinghal January 17, 2014 in India
e.g arr[]={1,2,3}
YES (1+2-3)
arr[]={3,6,2}
3+6-2 != 0
3-6-2 !=0
-3-6-2 !=0
-3-6+2 !=0
-3+6-2 !=0
-3+6+2 !=0
3-6+2 !=0
3+6+2 !=0
Hence ans= NO| Report Duplicate | Flag | PURGE
Amazon Intern Algorithm - 1of 1 vote
Answerswrite a program to convert a number in indian rupees form such that we input 11200234
- sachinsahu732 January 14, 2014 in India
then output come 1,12,00,234 in c language
pls help| Report Duplicate | Flag | PURGE
Amazon Intern - 5of 5 votes
AnswersGiven an integer, find the next highest and next lowest integers, with equal number of 1s in their binary representation as the original number.
- gulusworld1989 January 13, 2014 in United States for Android| Report Duplicate | Flag | PURGE
Google Intern Algorithm - 1of 1 vote
AnswersSuppose you are given a set of small boxes, numbered 1 to n, identical in every aspect except that each of the first i contains a pearl whereas the remaining n-i are empty. You can have two magic wands that can each test if a box is empty or not in a single touch, except that a wand disappears if you test it on a box that is empty. Show that, without knowing the value of i, you can use the two wands to determine all the boxes containing pearls using at most o(n) wand touches. Express as a function of n, the asymptotic number of wand touches needed.
- amazed07 January 12, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Intern Algorithm - 2of 2 votes
AnswersHow will you implement run-time polymorphism in C? There are two structs. There is a common function receiving only one argument(only one). The function should accept both base struct and derived struct objects and do corresponding actions. i.e if base struct object is passed, do base struct's task and vice versa
- chid1989 January 07, 2014 in United States| Report Duplicate | Flag | PURGE
NVIDIA Intern C++ - 3of 3 votes
AnswersThe interviewer asked the following question.
char *s = "Hello"; printf("%s",s); printf(s)
The second print statement crashes sometimes. Why
- chid1989 January 07, 2014 in United States| Report Duplicate | Flag | PURGE
NVIDIA Intern C - 0of 0 votes
AnswersDesign a Rubik's Cube, including backend database portion.
- asiamgenius December 27, 2013 in United States| Report Duplicate | Flag | PURGE
Google Intern System Design - 0of 0 votes
AnswersTest the unknown code. You can not see the code, and the only way to test it is through this function: (the 3 arguments are inputs of the unknown code)
- ccww December 24, 2013 in United States
void test(string s, int* a, double d){
//black box code
...
...
}
How do you test it to ensure that the code is robust?| Report Duplicate | Flag | PURGE
Microsoft Intern test - 0of 0 votes
AnswersRemove duplicates from a string inplace. The algorithm should be as efficient as possible.
- alex December 19, 2013 in India
I gave two approaches. First, the simple comparison O(n2) and second, sorting O(nlgon). But the interviewer did not seem satisfied.
Can someone please suggest a better algorithm?| Report Duplicate | Flag | PURGE
Microsoft Intern Algorithm - 0of 0 votes
AnswersGiven a unsorted array. Create a balanced B tree. Whether it is possible to solve this problem algorithm in logarithmic complexity ?.
- Neutrino December 18, 2013 in Armenia| Report Duplicate | Flag | PURGE
VMWare Inc Intern Algorithm - 5of 5 votes
AnswersGiven "n", generate all valid parenthesis strings of length "2n".
- anusha136 December 02, 2013 in United States
Example:
Given n=2
Output:
(())
()()| Report Duplicate | Flag | PURGE
Facebook Intern Algorithm - 0of 0 votes
AnswersStarting and ending co-ordinates of one-dimensional line segments are given. Find the co-ordinates of longest line segment that can be formed from these segments. Write two functions addSegment() and findMaxSegment(). He asked to write a perfect C code.
- Rahul Sharma November 24, 2013 in India| Report Duplicate | Flag | PURGE
Adobe Intern Algorithm - 1of 1 vote
AnswersSuppose there were n numbers in an array S1, S2, S3, S4.......SN rearrange them in a such a way that they satisfy bellow property.
- Rahul Sharma November 24, 2013 in United States
S1<S2>S3<S4>......| Report Duplicate | Flag | PURGE
Google Intern - -1of 1 vote
AnswersWrite code for removing alternate duplicate characters (case insensitive) in a string in place. Also give test cases.
- oxymoron November 16, 2013 in India| Report Duplicate | Flag | PURGE
Microsoft Intern Algorithm - 0of 0 votes
AnswersYou have three covered baskets labelled "Apples", "Oranges" and "Mixed." All of them are labelled incorrectly. Choosing only one fruit from one of the baskets (and not peeking inside), how can you determine how to relabel the baskets?
- peaceloveharmony@live.ca November 15, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Intern Problem Solving - 0of 2 votes
AnswersYou have a gold bar with seven segments. For seven days, you must pay an employee with one gold segment each day. Breaking the bar only twice, how can you ensure the employee gets paid appropriately?
- peaceloveharmony@live.ca November 15, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Intern Problem Solving - 4of 4 votes
AnswersSuppose you have to maintain the stock values of various companies during various periods and return minimum stock value of a particular company over a given period of time.what data structure is best for this.
- nishu November 07, 2013 in India| Report Duplicate | Flag | PURGE
Amazon Intern Data Structures - 1of 3 votes
AnswersI was asked this question during campus placement drive :
- Myth October 02, 2013 in United States
You have a Timer which goes to from a certain range ( n to 0), where n is not fixed and we can have it as much as we want.
The timer when goes to 0 an associated callback for the request is done.
We have multiple requests coming into the system, however the Timer is insufficient to deal with them at all at once ( it can deal with a figure less than number of requests).
How do you reuse the timer and handle all asynchronous requests?| Report Duplicate | Flag | PURGE
Microsoft Intern - 0of 2 votes
Answersbinary search in circular array?
- Mahima September 30, 2013 in India| Report Duplicate | Flag | PURGE
Amazon Intern - -2of 2 votes
Answerswrite a code to check whether a filled sudoku is correct or not?
- Mahima September 30, 2013 in India| Report Duplicate | Flag | PURGE
Amazon Intern - -1of 1 vote
AnswersAlgorithm of Level order in tree?
- Mahima September 30, 2013 in India| Report Duplicate | Flag | PURGE
Amazon Intern