Intern Interview Questions
- 0of 0 votes
AnswersProblem of concurrent transactions done by two persons of a joint account at two different ATM Machines. How is it managed without introducing any inconsistency in balance of the account holders?
- coder July 29, 2013 in India| Report Duplicate | Flag | PURGE
Microsoft Intern - 0of 0 votes
AnswersTwo airline companies, Kingfisher and Jet airways want to do a merger. Design a database migration scheme, so that no inconsistencies and redundancy occur. Assume suitable data and brief on the problems you might face.
- coder July 29, 2013 in India| Report Duplicate | Flag | PURGE
Microsoft Intern - 0of 0 votes
AnswersGiven notes of different denominations ( 1,2,5,10) , WAP to find in how many ways can you make an amount ‘x’ ?
- coder July 27, 2013 in India| Report Duplicate | Flag | PURGE
Microsoft Intern Algorithm - 0of 0 votes
AnswersName a data structure that can replicate a cache and why do you think so
- 3139a1m July 07, 2013 in United States| Report Duplicate | Flag | PURGE
Adobe Intern - 0of 4 votes
AnswersGiven - a number (n) and a sorted array
- LAP July 07, 2013 in United States
Find a number in the array having least difference with the given number (n).| Report Duplicate | Flag | PURGE
Facebook Intern Algorithm - 1of 1 vote
Answers"Write test cases for reversing words of string ". For eg. "This is nice" is input string and output is "nice is This".
- LAP June 19, 2013 in India
I gave him -
" "
"Hello"
"bye! Mr. X Y. Kumar"
But he didn't seem satisfied.
Can u plz tell what general guidelines should I follow for writing efficient test cases.
What more test cases should I have written for this question ?| Report Duplicate | Flag | PURGE
Microsoft Intern - 0of 0 votes
AnswersDesign class structure for a building, floors and space. The space can be an apartment, a store or an office. Include any properties, fields and methods you think would be interesting to have.
- Purushotham Kumar June 18, 2013 in Ireland for Microsoft Ireland intern recruitment team| Report Duplicate | Flag | PURGE
Microsoft Intern - 0of 0 votes
Answershow to solve this ((3000000!)/(30!)^100000)%(any prime no.) in C++
- 3139a1m June 14, 2013 in India| Report Duplicate | Flag | PURGE
Adobe Intern C++ - -2of 2 votes
AnswersIn a 5*4 matrix what is the most optimal way of traversal and compare the time complexity for different solution ?
- ctrlV April 13, 2013 in United States| Report Duplicate | Flag | PURGE
Sears Holding Intern Java - 8of 8 votes
AnswersWrite a function which returns kth element from the tail in a linked list.
- hasan.tanpinar April 04, 2013 in United States| Report Duplicate | Flag | PURGE
Google Intern Linked Lists - 0of 0 votes
AnswersImplement Iterator class with peek() functionality in Java.
- hasan.tanpinar April 04, 2013 in United States| Report Duplicate | Flag | PURGE
Google Intern Software Engineer / Developer Java - 0of 0 votes
Answersthere is a log file which contains info in below format:
- Anonymous March 28, 2013 in United States
timestamp : customer-id : page-id
repeat customers are customers who return to the amazon site(any page) after at least a day.
write a code to print all the repeat customers| Report Duplicate | Flag | PURGE
Amazon Intern - 2of 2 votes
AnswersWrite a function that finds out if any two numbers within that array add up to a target.
- Bheesham March 27, 2013 in United Statesbool addsUp(Array<int> input, int target);
| Report Duplicate | Flag | PURGE
Amazon Intern Algorithm Problem Solving - 0of 0 votes
Answerswap to find the longest arithmetic sequence in given array... return number of element in seriese...
- pintuguptajuit(PINTU GUPTA) March 24, 2013 in India
simple test case..
sizeofarray=4
array element
3 4 5 8
output
3
sample test case
size of array =10
array element..
-1 1 3 7 11 15 19 20 21 22
output
5| Report Duplicate | Flag | PURGE
Amazon Intern Algorithm - 0of 0 votes
Answerswaf for a linked listed ..
- pintuguptajuit(PINTU GUPTA) March 24, 2013 in India
shift all digit to first then consonant then vowel ..
such that list contain only one time one digit , consonant , vowel ..
List *(List *head);
input :
2->a->5->a->2->b->o->n->5->n.
output..
2->5->b->n->a->o..| Report Duplicate | Flag | PURGE
Amazon Intern Algorithm - 0of 0 votes
Answerswap to take one rotate a square matrix anticlock wise by 90 degree and add a particuler number after rotation to each prime column.
- pintuguptajuit(PINTU GUPTA) March 24, 2013 in India
function prototype should be..
void rotate(int a[][],int size, int keytobeadded);...
sample test case....
input
size=3
keytobeadded=5;
square matrix :
1 2 3
4 5 6
7 8 9
output should be
3 11 9
2 10 8
1 9 7...........| Report Duplicate | Flag | PURGE
Amazon Intern Algorithm - -3of 3 votes
Answerswrite a function that print TRUE if (){}[] are balanced in expression .. otherwise return FALSE.
- pintuguptajuit(PINTU GUPTA) March 23, 2013 in India
[{()}] currect.. priority of [ >}>)..........it should be preserved
....................................................................................
void check(char *a)
{
struct s
{
char ch;
s*next;
};
s *st=NULL;
s*node=NULL;
if(a=='\0')
{
cout<<"TRUE";
return ;
}
else
{
while(a[0]!='\0')
{
{
node=(s*)malloc(sizeof(s));
char c=a[0];
switch(c)
{
case '[':
if(st==NULL)
{
node->ch=c;
node->next=NULL;
st=node;
a++;
}
else
{
if(st->ch=='('||st->ch=='{')
{
cout<<"FALSE";
return ;
}
else
{
node->ch=c;
node->next=st;
st=node;
a++;
}
}
break;
case '{':
if(st==NULL)
{
node->ch=c;
node->next=NULL;
st=node;
a++;
}
else
{
if(st->ch=='(')
{
cout<<"FALSE";
return ;
}
else
{
node->ch=c;
node->next=st;
st=node;
a++;
}
}
break;
case '(':
if(st==NULL)
{
node->ch=c;
node->next=NULL;
st=node;
a++;
}
else
{
node->ch=c;
node->next=st;
st=node;
a++;
}
break;
case ')':
if(st==NULL||st->ch=='{'||st->ch=='[')
{
cout<<"FALSE";
return ;
}
else
{
if(st->ch=='(')
{
s *newnode=st;
st=st->next;
free(newnode);
a++;
}
}
break;
case '}':
if(st==NULL||st->ch=='('||st->ch=='[')
{
cout<<"FALSE";
return ;
}
else
{
if(st->ch=='{')
{
s *newnode=st;
st=st->next;
free(newnode);
a++;
}
}
break;
case ']':
if(st==NULL||st->ch=='{'||st->ch=='(')
{
cout<<"FALSE";
return ;
}
else
{
if(st->ch=='[')
{
s *newnode=st;
st=st->next;
free(newnode);
a++;
}
}
break;
default :
a++;
if(a[0]=='\0')
{
cout<<"TRUE";
return ;
}
break;
}
}
}
if(st==NULL&&a[0]=='\0')
{
cout<<"TRUE";
return ;
}
if(st!=NULL)
{
cout<<"\nFALSE";
return ;
}
}
}| Report Duplicate | Flag | PURGE
Amazon Intern - 1of 1 vote
AnswerYou are given the task of creating the address book application for a smart phone. There are some
- PaulDaviesC March 23, 2013 in India
of the top level features you must implement.
1.There will be 1000+ phone book entries and user must get very quick response.
2.On default screen it shows the names of all people in alphabetical ascending order.
3.Using the search option, user can search and it will show only those names starting
with those characters which are typed in the search box.
You are supposed to compare two different data structures and list down the pros and cons of each
and finally recommend the best suited data structure.| Report Duplicate | Flag | PURGE
Xurmo Intern Data Structures - 1of 1 vote
AnswersHighly coupled code is code where the dependencies between classes are dense, lots of things
- PaulDaviesC March 23, 2013 in India
depend on other things. This kind of program is hard to understand, tough to maintain, and tends
to be fragile, breaking easily when things change.
Simplistically, we can say that class A is statically coupled to class B if the compiler needs the
definition of B in order to compile class A. Moreover dependencies among them are transitive.
That is if A depends on B and B depends on C, then A also depends on C
Create a program logic/pseudo code which can print the "expanded dependency tree" given a set
of input per class dependencies. Make sure that there are no duplicates in the output
Input
A -> B,C
B->C,E
C->G
D->A,F
E->F
F->H
Output
A depends on B C E F G H
B depends on C E F G H
C depends on G
D depends on A B C E F G H
E depends on F H
F depends on H| Report Duplicate | Flag | PURGE
Xurmo Intern - 0of 0 votes
AnswersGiven a number, print its corresponding string representation. Example: I/P: 523, O/P: Five hundred and twenty three, I/P: 501, O/P: Five hundred and one, I/P: 11, O/P: eleven
- User1 March 15, 2013 in United States| Report Duplicate | Flag | PURGE
Epsilon Intern - 0of 0 votes
AnswersIf there is a million data in file(assume integers).
- rahul.jain215 March 15, 2013
The memory is enough to hold all the data.
After loading all the data into data structure , we need to insert 500 new integers after the 10000th element.
What Data structure to use and how to use?| Report Duplicate | Flag | PURGE
Yahoo Intern Algorithm - 3of 3 votes
AnswersWrite a program to sort an array of strings so that all anagrams are next to each other
- Neo March 07, 2013 in United States for Web Service
ex
input {god, dog, abc, cab, man}
output {abc, cab, dog, god, man}| Report Duplicate | Flag | PURGE
Amazon Intern C++ Java - 0of 0 votes
AnswersWhat should be the output of the following code.
- Neo March 07, 2013 in United States for Web Service
class Test {
public int i=0;
@Override
public int hashCode() {
return i;
}
}
Class a{
psvm(){
HashMap <Test, String> hm = new HashMap();
Test t1 = new Test();
hm.put(t1,”success”);
sysout(hm.get(t1)); //print success
t1.i = 10;
sysout(hm.get(t1)); //NULL
}
}| Report Duplicate | Flag | PURGE
Amazon Intern Hash Table - -1of 3 votes
AnswersGiven an 2D array of characters. Find words in the array (either vertical or horizontal). a character cannot be part of 2 words. Maximize the number of characters used. Hint: 1D variant can be solved by Dynamic programming in linear time.
- draftse March 06, 2013 in United States| Report Duplicate | Flag | PURGE
Amazon Intern Algorithm - 0of 0 votes
AnswersImplement print function given an integer without using the built-in print function
- J March 01, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Intern Compiler - 0of 0 votes
Answershow to find lowest common ancestor of a binary tree
- xxx February 22, 2013 in United States
??
not BST| Report Duplicate | Flag | PURGE
Amazon Intern Trees and Graphs - 0of 2 votes
AnswersGiven an infinite sequence of integers which are repeated many times. WAP to print "beep" if an integer appears ODDth time else print "no beep".
- learner February 10, 2013 in United States
example: input: a[] = { 1,4,2,4,3,2,4}
output: beep, beep, beep, no beep, beep, no beep, beep
Space complexity - O(1)| Report Duplicate | Flag | PURGE
Microsoft Intern Arrays - 0of 0 votes
AnswersGiven a multidimensional array with only 0s and 1s, reverse the array! I guess what he meant was flip 0s to 1s and vice versa! The array could be of any dimension ex:4X4X4X4....
- xxx February 06, 2013 in United States
(I dint get this q's so asked for another!)| Report Duplicate | Flag | PURGE
Amazon Intern - 0of 0 votes
Answers1. Write a program for returning all pairs that map to a value...Discuss different implementations.
- A February 01, 2013 in United States| Report Duplicate | Flag | PURGE
Intern Algorithm