Showing posts with label Placement Papers. Show all posts
Showing posts with label Placement Papers. Show all posts

Tuesday, March 13, 2012

NIIT Sample Paper At Kolkata (Interview Pattern)



It consists of 36 Questions : 30 Minutes
It consisted of 5 sub-parts :
i) Coding-Decoding (6 questions)
ii) An English seen passage (5 questions)
iii) English verbal : Grammar (5 questions)
iv) Maths : Quantitative aptitude (10 questions)
v) Technical : C, C++, Java, DBMS, OS, Networking (10 questions)

My interview lasted over 40 minutes. It was a mixed one of Technical+HR. As I am a guy from E.C.E. my technical questions were from C. But some E.C.E guys were also asked from Microprocessor, Digital Electronics & Data Structure. C.S.E were asked questions from C++, Java, DBMS, OS and Networking. There were two interviewer in my panel. The whole thing was like this -

Me : May I come in sir ?
NIIT : Yes, come in. Sit down please. Give me your C.V ........ What is the meaning of your name ?
Me : I said.
NIIT : Give your self-introduction with your family background and hobbies.
Me : I mentioned that I am a guy from a simple middle class family.
NIIT : Why are u describing yourself as a guy from SIMPLE MIDDLE CLASS family ?
Me : I said that my dad,s earning is within that range.
NIIT : So will you consider your family as rich when your earning adds to your dad,s one ?
Me : No. I will like to call myself a guy from an upper middle class family.
NIIT : So earning is the only indicator to decide the class of the family ?
Me : In this case I am considering so .
NIIT: Ok.
Me : In my self-introduction I mentioned Chatting and Magic Item Collection as my hobbies.
NIIT : What are the kinds of magic you have collected so far ?
Me : Lots, from coin tricks to card magic. May I show you one sir ?
NIIT : Sure.
Me : I showed them a coin trick.
NIIT : hmm. You are a guy from E.C.E. But you are switching to software industry. Why ? Tell me from the core of your heart.
Me : I like C more than Analog Communication.
NIIT : You like C ? Why so ?
Me : I am fascinated about it. I try to think of every problem in C. I had Computer Science in +2. I wrote the KBC program for fun.
NIIT : So I can ask you questions from C ?
Me : Up to File and Structure.
NIIT : That,s enough. What is the difference between Structure and Array ?
Me : I explained it with diagram.
NIIT : Ok. Suppose I have put your name in a character array. Now you have to reverse it within it without using any other array. How will you do it ? Write the whole program.
Me : Can I use the string reverse function.
NIIT : No.
Me : I wrote the program.
NIIT : Try to reduce the complexity of the program.
Me : Can I say the logic only ?
NIIT : Sure.
Me : I described.
NIIT : Ok. Now tell me the difference between ,value passing, and ,address passing, of a variable as the argument of a function. What will be the effect if we do it at the time of ,swapping, ?
Me : I said.
NIIT : hmm. In your career objective you have described yourself as ,a computer lover with an electronics & communication background,. Why you are demanding that you are a COMPUTER LOVER ?
Me : I spend most of my spare time with my machine.
NIIT : What do you do then ?
Me : Mainly chatting and C programming.

Tuesday, March 6, 2012

IBM Fresher Placement Paper: 27-Feb-2012 | IBM Fresher Interview Paper 27-Feb-2012



Job Interview, Questions Paper
Company Name: IBM
Hi friends,
IBM was a dream come true, golden opportunity for me
Job Profile: System Engineer
The Procedure was Divided into Two Days.
  • Day 1: Aptitude, Written Communication, GD
  • Day2: Logical puzzles reasoning, Technical, HR

Aptitude: Divided into Second Sections.

Day 1:

Section 1: Number Series

I have few questions with me which I had scribbled on my rough paper.
  • 9,3,24,4,9,3,36,6,9,3,30,?
  • 52,62,42,78,89,68,49,61,39,63,76,?
  • -16,-8,4,24,12,-6,-40,?
  •  49,6,25,4,36,5,81,5,?
  •  9,3,6,21,9,12,33,15,18,?
  • 12,3,15,14,6,19,9,23,18,12,?
  • -15,-14,34,32,-42,-39,58,54,-61,?
  •  38,36,76,35,114,34,?
  • 30.5,31,30,0,67.2,67,70,100,183.9,?
  • 11,8,17,14,23,24,31,32,?
  • 10,12,-36,-7,-5,15,19,21,?
  • 44,4.4,0.88,0.264,0.1056,?
  • 11.5,17.5,35.5,89.5,?
  • 2,3,10,15,26,35,50,?
  • 1/3,1/2,1/4,2 1/3,3 1/2, 4 1/4, 4 1/3, 6 1/2,?
  • 1.25,3,7.1,1.5,1,8.1,1.75,-1,9.1,0.75,2. 00
  • 5,1,2,8,1,0,9,2,3,14,1.3,2,?

Section 2: General Quantitative Questions on Avg., Time and Distance, Speed, Simple Interest.

This section also had 17 questions
Note: Only one question was displayed at a time for 2mins 14sec for both Sections. We cant go to or fro to any other question. Nor we can we transfer one questions time to another. So utilize your time sensibly. So logically Aptitude part was for 34 questions each for 2mins 14 sec was for 75mins approx. (No sectional cut-off)
Result was declared after Two hours.
2) Written Communication: It was 15mins test. In this a passage was given and we have to brief it into 6sentences exactly in our own words. Use vocab , concentrate on tenses, grammar and correct spellings.
Result was declared after 3hours.
3)GD: Most interesting part for me, cos my group had 15girls including me, so messy. This sections was for 15mins to discus among the group members.
Topics were : 1) Does management should be included into engineering
2)Credit cards: Its uses and abuses.
We choose topic 1, good thing about this was at the end of 15mins, each 1 is given a minute to conclude. That was the time I spoke. This saved me.
Result after half an hour; and good thing my entire group was selected. Day ended at 2100hrs

Day2:

Logical Puzzles reasoning:
This section contained Four questions without options and we had to write the answers with step by step explanation. Students whose answers are correct and explanation was satisfactory were directly send to

HR (Technical Skipped).

I remember all questions.
  • 3,12,24,33,66,?
  • One train is leaving from Delhi to Mumbai at a speed of 85km/hr. At the same time, another train from Mumbai is heading towards Delhi at 100km/hr. A bird is sitting on top of one train before it commutes. When both train starts their journey,fly flies at 125km/hr. And when it meets opposite it reverts its position and flies until it meets first train. This process is continued until it gets crushed between two trains. How much distance the bird travels in whole journey ? (Refer R.S.Agarwal)
  • There is an opening into a firm for one position and there are two applicants for this position. The recruiter finds both applicants useful so he hires both of them on a salary of Rs.2000/yr. He offers both applicants an raise in salary after they pay Rs. 1000 half year. He puts an option for both of them of Rs.100 raise half year and Rs. 300 yearly. 1st person chooses Rs. 300 and 2nd chooses Rs. 100. Who will the gainer and by how much?
  • There are 10 friends, each individual has some message. How many minimum telephone calls will be needed, so that evry1 has all messages?
Result was declared after 4 hours.

5)Technical:

  • Tell me About Yourself?
  • Project?
  • Uniqueness of Project?
  • Explanation of Answers of Fourth round i.e Logical reasoning. So don’t bluff answers in 4th round?
  • Concepts of C? e.g Can we have nested structures and functions? Technical person had lappi wit net connection, he showed one C program and told me to find errors if the program has any, and predict the output and explain the program
  • My friends were asked for DBMS, OOPs, Networking,etc.
I was last in my group so I got my result within 10mins

HR

  • Tell Me About Yourself?
  • You are elder in Your family so due you find any advantage of being elder?
  • Asked me to rate myself for logical, analytical and programming skills?
  • Gave program to solve, If you have to choose a no. from 1 to 1000, what logic will you apply?
  • Ready to relocate (Mainly asked to gals)?
  • Any questions
Out of all six rounds my HR was best and he was impressed by me. Result immediately declared as “SELECTED” yeah .
Out of total 800 students, near about 70-80 students were selected, and I was lucky to be in selected students.  Lastly gave a form to fill. The day ended at 2200 hrs.
That day had nice sleep.

Monday, March 5, 2012

Samsung India Latest Placement Paper: 03 March 2012 | Samsung India Latest Interview Paper : 03 March 2012



Company Name : Samsung India Software Operations
Type : Experienced
Hi ,
I have appeared for samsung drive which was for experienced.
It consisted of a GSAT (Global samsung aptitude test) followed by C written test.
GSAT was of 60 mins and there were two sections:-
  • Quantitative ability :- It consisted of 25 data interpretation questions of barchart , piechart . These were very simple ,including some percentage related calculations.
  • General Reasoning :- It consisted 25 questions like
There were nine persons F,G , J,K,L,R,S,T,U and there were only three cars out of which one can hold atleast upto 5 persons and other two can hold upto 3 persons atleast. F and G lives in plainfield which is farthest , J ,K ,L lives in whitefield which is second farthest along the same route.R,S,T,U lives in quince which is the nearest. One of the commuter among them has to be the driver. Driver must be from the farthest place from where car will start.
Then there were six set question related to above situations like, out of these who can be driver , who all can sit together.
Second they gave immediate C written test , which consisted 25 questions.
1) 11^ 2 is equal to :
2) What does left shift operation do:
a) Substraction of number.
b) Addition of number.
c) Multiplication.
d) Division
Ans : Division.

3) Consider following programmain(){
int z , x=5 , y=10 , a=4 , b=2;
z= x++ + --y*b/a;
prinf("%d" , z);
}
Predict output ??
4) main()
{
char * c[] = "I am following you , who are you?";
printf("%c %c" , *(c[0]+4) , *(*(c+0)+9));
}
5) void increment(int i){i++;
}
main(){
int i=0;
for(i=0;i<10;increment(i))
printf("%d",i);
}
Ans : infinite loop.

5) main(){
int *ptr[] = {1,2,3,4,5,6,7,8,9};
int *a; 
a= ptr;
ptr+=3;
printf("%d" , ptr-a);
}
6) void main(){
int b=0 , a= 10;
b=a++ + ++a;
printf("%d ,%d ,%d" , b,a++,++a);
}
Predict output??

9) What is difference between definition and declaration?
10) There were 4 questions realated to malloc and calloc.
11)If there are five variables A, B ,C ,D, E , these pushed into stack and then four were popped out and entered into queue. Then two were deleted and then remaining are again pushed into stack.
Then pop operation is performed once , which variable will pop out?? 10)
main(){
char *s[]= "hello";
char *ptr ;
ptr = malloc(sizeof(int));
s=ptr;
}
What is wrong in above program
a) memory leak;
b) memory overwrite.
c) Error.

WIPRO: Fresher Placement Paper : 03 March-2012 | WIPRO: Fresher Job Interview Paper : 03 March-2012



Company Name: Wipro

Test has Three Rounds

  • 1. Written Test
  • 2. Tech-Interview
  • 3. HR Round.

Written Test Contains Three Sections

  • Verbal
  • Quant
  • Technical

Verbal

  • It was little bit tough.
  • It Contains a passage and 5 Questions Based on that Passage.
  • Some synonyms and antonyms are also there.

Quant

It was easy test out of 20,15 are easily attempting
Some Questions
1. Diff. Between ages of son and father is 30 and their squares is 1560 find their ages.
2. What is probability of choosing a leap year with probability of 7 Fridays.
3. 1 question is on relations
N is brother of X and A . Y is mother of N. Z is wife of Y.

which of the following is not def. true

ans is X is brother of N.



4. 0 is coded as *,
  • 1 is coded as #, numbers more then 1 is coded by using of *
    and # like
  • 2 is coded as #*
  • 3 is coded as ##
  • 4 is coded as #**
find the lcm of 10 15 30
5. p+q means p is brother of q and p*q means p is mother of q and p/q means p is father of q and p%q means p is sister of q
now make a relation that p is mother in law of q
One question on trains,clock,share.

Technical

It was also very easy.
1. One Questions on order of OSI Layers
2. Apache Company Provides_________
3. int count =10,sum =0,*temp;
temp=&count;

*temp=20;

temp=∑

*temp=20;

printf("%D%d%d",sum,count,*temp);
4.

char letter ='a';

if(letter='a')

{

}

else if(letter='b')

{

}

else if(letter='c')

{}

else

{

}

convert it into switch.
5. struct a

{

int a;

int b;

}

void main()

{

struct a b={110,10};

print(b);

}

print(struct b)

{

printf("%d %d",b.a,b.b);

}

Saturday, February 25, 2012

3i Infotech Placement Paper Pattern



The paper was prepared by INSTITUTE OF BANKING PERSONNEL SELECTIONS-MUMBAI.
Aptitude Written Test (Total time: 90 Min, 150 questions)
Section-1 English Language Ability (50 questions)
Section-2 Quantitative Aptitude (50 questions)
Section-3 Logical Reasoning (50 questions)
All 150 questions are given in the beginning, and you can attempt any section at any time. There is individual cut-off in each section. Negative marking 0.25 marks for each wrong answer.
Section- 1:
Q1-15: Comprehension, Antonyms, Synonyms There is a big paragraph (one full page) about regularization of banking acts, etc.
Q1-9 are based on the content of the paragraph.
Q10-12 are Antonyms for some words appeared in the paragraph.
Q13-15 are Synonyms for some words appeared in the paragraph.
Q16-20 (Incomplete Paragraph about Development and Education in Punjab and U.P. was given) In these questions, we need to insert the appropriate word from the options given.
Q21-25: (Ordering sentences in a paragraph) There are 5 Sentences given. They have asked for the correct sequence of those sentences. For example the asked question is which sentence is 2nd? 3rd? etc.
Q26-35: (Sentence improvement) There are 10 sentences. A part of the sentence is in bold part. From the options, we need to improve the meaning of the sentence.
Q36-45: (Identifying error in the sentence) Each Sentence was broken in to 5 parts. We need to find out which portion is having error. Sorry I forgot the other 5 questions.
Except the questions 1-9, I answered all confidently.
Conclusion: Practice Comprehension more, because reading the paragraph itself will take10-15 min. Then answering questions is too difficult.
So, go for other questions which are relatively simple and you feel comfortable.
Section- 2:
Quantitative Aptitude: ( R.S.Agrawal level, but time is very crucial) I am giving you, the topics covered.
1.Compound interest (1q)
2.Simplification (10q)
3.Data Interpretation(15q)
There are 3 Tables and each table comprises of 5 questions.
4.Series Completion (5q)
5.Squre root (1q)
6. Trains (1q)
7.Probability (5q)
Actually I overlooked the other 7 questions, because I have answered only 25 in 30 min. Then I moved to other section. There is no time to see any question 2nd time. So, do it right first confidently. Some questions are (none of these) options type. So doing confidently first time is important.
Do not check your calculation if u get none as your answer. Because they will test confidence by putting none option.
Conclusion: Do all questions in R.S.Agrawal atleast once to get confidence. Emphasize more on DI, Probability. Questions are simple but managing time is imp.
Section- 3:
Logical Reasoning :
Two puzzles on seating arrangement of students- 10q. These puzzles are simple.
example: There are 10 students, five will sit in Row A, and others in Row B. K will sit in between D and E. M is not interested to sit at the end in a row……. like that conditions will be given, Accordingly we can arrange.
Statements and Conclusions- 5q.
There are 4 statements, All cats are dogs, some dogs are squirrels. No Squirrel is Dove. Some doves are cats. etc . Then 3 conclusions were given. and we need to identify which are following. This question is not correct. DO not try to solve it. Just to have an idea I have mentioned.
Blood relations (5q)
The model is like this: A+B means A is brother of B
A-B means A is mother of
AxB means A is father of B
A/B means A is sister of B
Then what will be p+q-r? etc. Please refer R.S.Agrawal Blood Relations Type 3 Coded Relations. (P.NO.237)
Coding & Decoding (7q)
For the numbers 0-9, They have given some letters as their codes. And if a word starts with vowel then code should start with $ symbol, if a word ends with vowel then code should end with # symbol. etc . Now 5 words were given we need to find out their codes.
Odd man out (1q)
A.27 B.64 C.125 D.512 E.216.
ans b
64 is cube as well as square but the others are only cubes.
Data sufficiency (5q):
Three statements were given and one question was given. To answer this question, we need to find out which data is required from the above 3 statements?
Like this total 5 q were given
New model questions (7q)
Five three digits numbers were given. 1 is added to the first digit of all numbers and 1 is subtracted from the middle digit.
Then QUESTIONS are which is lowest, highest? ect.
Example: 546, 687, 456, 274, 487
After modifying according to the given conditions, 636, 777, 546, 364, 577. Now you can arrange these numbers either ascending or descending order to answer the questions.

Accenture Placement Paper | Accenture Interview Questions



Hi all,
     ACCENTURE came to CUSAT campus.
     total :- 450
     written clear :- 80
     HR clear :-  45
     tech (final) clear :- 28
     pattern of written paper and whatever the questions r remember....i m giving to u.
it was a objective paper without negative marking.there was 5 sets common for all and 1 extra(DBMS) set only for M.C.A.'s.
All set conatined 15 question each only and the time given for dbms set (for m.c.a.'s) was 15 minutes and then 75 min common for all.
set were
1-  english
2-  maths
3- reasining
4- C
5- c++
all were bunch together,time management was upto u.

SET DBMS.

1- data model is
a) entity    b) constriants c) entity relationship   d) all the above
ans:- c

2- choise the correct one
         select emp.name ,emp.age from emp1,emp2 where emp.sno = 456;
a) cluster b) non-cluster c) index d) none of these

3- what is index?
a) atrendum selectio of colum
ans) a

4- match the following
 1- one to one           a) manager to employ
 2- one to many        b) employ to employ
 3- many to one        c) unique object
 4- many to many      d) employ to manager
 a) 1-a ,2-b ,3-c,4-d  b) 1-c,2-d,3-a,4-b    c) 1-c,2-a,3-d,4-b   d) 1-d,2-b,3-a,4-c
ans)   c


1          max                 222


             allen              333
2


  3           rony              444                                   
 
5-








 







Select first.name from first where first.age = (select first.age from first where first.sno = 3);
a) max   b) allen   c) rony d) noneof these

THERE were 3 question on same type of queries(u should be good in foreign key relationship and relationship with in a single table).
One question was based on INDEX.
Also one more mapping relationship given based upon the figure.

SET ENGLISH

5 question based upon SIMPLE preposition (dam easy)
3 question from article.
5 questions from a single passage.
4-5 questions of synonyms.(from a given line..one word was bold….for that).

SET MATHS


VERY –VERY EASY question from R.S. aggarwal…..(logical based maths).

SET REASONING

3 questions based upon equality of number’s …means
three no’s given ……
a)     if all equal
b)    if 1,2 same
c)     if 2,3 same
d)    none…..
 DAM –easy

3 questions based upon equality of symbols  …means

if + means * and * means / and – means + and + means –
then mean of 28*40/4+2-6

8 question upon set theory means
if 100 r selecting in maths
and 90 in physics
      120 in chemistry
& 22 in phy& maths both ,33 in maths & chemisty both
44 in ches & phy…11 in all
then
1)     how many only in maths…….
2)     Only in physics……
3)     Only in chemistry…….
       4)   how many in atleast 2……
likewise……all were DAM –EASY ,if u r easy with VAN-DIAGRAM…..first make the van-diagram and then use the formula.

SET C

4 QUESTION on pointers…
3 on file handling….
2 on functions….
3 structurs and unions
2 from bitwise
1 from memory & space(how much memory this will take)

dear ,if I will say it was DAM-TUFF…I THINK I WILL BE INSULTING of the level of the questions….the syntax of the questions were ununderstandable…some questions were taking more then 1 page….forget abt the solving..noone could read them in 15 mins….
It was total LUCK…try to solve 4-5 …which u can and then put a intelligent guess( or same opt on all) on other……
U can use test ur C skills and explore in C…but paper level was too much from them also.only application part’s were there.

SET C++ 

Inheritance
Scope of protected
Virtual function
Static member function
File handling
Question) If error is not catch by first catch statement then what will happen….4 scenario were given…choose 1 among them.

Copy constructor

And other’s were ununderstandable that from which topic they were and which concept we have to folloe????????????????
Really I cann’t inselt this part too by saying DAM-TOUGH……….
Ur luck was really very needed……

Hr – interview

1- IF U HAVE ANY QUESTION THEN ASK ME…..( IT WAS ASKED AS A FIRST QUESTION IN INTERVIEW FROM MANY….)
2- UR FAMILY BACKGROUND…
3-  UR EDUCATION  BACKGROUND…
4 – IF I WILL NOT SELECT U THEN WHAT U WILL DO ????
5- TELL ME ABT URSELF..
6 – WHAT U THINK…U SHOULD DEVOLP IN URSELF..
7- WHY U WANT TO JOIN ACCENTURE…


TECHNICAL INTERVIEW

1-     WHAT IS THE NEED OF NORMALISATION IN DATA BASE.
2-     1-5 ALL NORMALISE FORMS( FROM MANY THEY DIRECTLY ASKED 4TH AND 5TH NORMANILISE..(MOSTLY FROM M.C.A.’S)
3-     WHAT IS SEMAFORE IN O.S. .
4-     WHAT IS PAGING AND DEMAND PAGING.
5-     HOW MEMEORY WORKS IN a computer system.
6-     How recursion works in C.
7-     WHICH DATASTRUCTURE USED IN RECURSION.
8-     Deference between structure N union.
9-     What is ERP…..(ACCENTURE having work in ERP…as we m.c.a’s having ERP in 3rd sem so…the person highlighted or wrote sth in resume ,THEY asked abt ERP from them only).
10-   What is reengineering in ERP.
11-  IF U HAVE TOO much cash in ur hand, then what u will do in behalf of the company…..
12-  Why u want to join accenture….
13-  Tell me abt urself.
14-  What abt ur strength & weakness.
15-  Why I should hire u ??????
16-  Why ur area of interest is “OOPS”.....(MOSTLY USED TO ASKED OOPS AND THEY ASK SAME QUESTION FROM MANY).
17-  If u have any question, ask me…..

INTERVIWER SCROLD A LOT TO PEOPLE IN TECH. INTERVIEW…the person who was cool and confident…only they could get in….person who got irrited….they couldn’t select…..infact it was a stress interview and ur temper was check here.

Hope this will help u………..
I m highly thankfull to my friend “ASWINI KUMAR” (GOOTA GOT IN ACCENTURE)…he gave his high efforts in making this paper.

Nitin Garg
Dca,cusat
Kochi.

Friday, February 24, 2012

Amazon Placement paper | Amazon Interview Questions | Amazon Placement Paper With Answers 2012




Amazon Placement paper | Amazon Interview Questions | Amazon Placement Paper With Answers
Amazon OOPS Interview Questions:-
What are the major differences between C and C++?
What are the differences between new and malloc?
What is the difference between delete and delete[?
What are the differences between a struct in C and in C++?
What are the advantages/disadvantages of using #define?
What are the advantages/disadvantages of using inline and const?
What is the difference between a pointer and a reference?
When would you use a pointer? A reference?
What does it mean to take the address of a reference?
What does it mean to declare a function or variable as static?
What is the order of initialization for data?
What is name mangling/name decoration?
What kind of problems does name mangling cause?
How do you work around them?
What is a class?
What are the differences between a struct and a class in C++?
What is the difference between public, private, protected, and friend access?
For class CFoo { }; what default methods will the compiler generate for you>?
How can you force the compiler to not generate them?
What is the purpose of a constructor? Destructor?
What is a constructor initializer list?
When must you use a constructor initializer list?
What is a:
* Constructor?
* Destructor?
* Default constructor?
* Copy constructor?
* Conversion constructor?
What does it mean to declare a...
* member function as virtual?
* member function as static?
* member variable as static?
* destructor as static?
Explain the term "resource acquisition is initialization?"
What is a "pure virtual" member function?
What is the difference between public, private, and protected inheritance?
What is virtual inheritance?
What is placement new?
What is the difference between operator new and the new operator?
What is exception handling?
Explain what happens when an exception is thrown in C++.
What happens if an exception is not caught?
What happens if an exception is throws from an object's constructor?
What happens if an exception is throws from an object's destructor?
What are the costs and benefits of using exceptions?
When would you choose to return an error code rather than throw an exception?
What is a template?
What is partial specialization or template specialization?
How can you force instantiation of a template?
What is an iterator?
What is an algorithm (in terms of the STL/C++ standard library)?
What is std::auto_ptr?
What is wrong with this statement?
std::auto_ptr ptr(new char[10]);
It is possible to build a C++ compiler on top of a C compiler. How would you do this?
Basic Questions 
* What is a friend, and why do you need it?
* If this doesn't compile, why didn't it (or will it compile?) Don't show comments, which explain the problem.
template void HashTable <>::dummy()
{
K* k = NULL;
Hashable* h = k; // If this fails to compile, it's because
// K is not derived from Hashable.
}
* This will loop forever. Why? Will it really loop forever? (Answer: Base:func() does not call Base::func(). Base: is just a label, so the line always will call Derived::func() until it runs out of stack space)
class Base {
public:
Base() {}
virtual void func() { /* do something */ }
};
class Derived : public Base {
public:
Derived() {}
virtual void func()
{
Base:func();
/* do something else */
}
};
main()
{
Derived d;
d.func(); // Never returns!
}

More advanced questions:
* What is a vtbl ?
* What is RTTI and why do you need it?
* How do I specialize a template? Give an example.
To separate sheep from goats (for those claiming C++ Guru status):
* What is a partial template? Why would you use one?
* How to I create a binary functor in the STL?
Given the following code:
class A;
class B;
class C {
A* a_;
B* b_;
public:
};

Implement a copy constructor and assignment operator for C. A sample solution is something like:
class C {
A* a_;
B* b_;
void swap(C& rhs) { rhs.a_ = a_; rhs.b_ = b_; }
public:
C(const C& rhs) {
auto_ptr<> a(new A(rhs.a_));
auto_ptr<> b(new B(rhs.b_)):
delete a_;
delete b_;
a_ = a.release();
b_ = b.release();
}
C& operator=(const C& rhs) {
C temp(rhs);
temp.swap(*this);
return *this;
}
};
What is wrong with this class, assuming that this is its complete interface?
class C {
char *p;
public:
C() { p = new char[64]; strcpy(p, "Hello world"); }
~C() { delete p; }
void foo() { cout << "My ptr is: '" << p << "'" << endl; }
};

Since this has an overtly programmed destructor, the member wise semantics for destruction are not good enough; therefore, they are not good enough for copy and assignment either. But, the copy ctor and op= are not programmed, so we will have some serious trouble.
Gradual hinting: what happens when we make a copy? [correct answer: pointer is copied]. Now, the original goes out of scope, what happens to the copy? [pointer dangles]. How would you fix it?
[also, that delete p should be delete[ p since p was allocated with the array new]
Assuming that swap() and copy construction are part of your interface for class C, what's the cookie-cutter pattern for operator= that uses them?
answer:
C& C:perator=(const C &rhs;) {
if (this != &rhs;) {
C tmp(rhs);
this->swap(tmp);
}
return *this;
}
]]
Amazon->written test. 
They concentrate on every field of computer science. They asked c,data structure,TOC(context free and context sensitive grammar,regular languages). DBMS unix was not there.
There were two subjective questions.
1. The first one was "given two lists write a function which returns a list which is the intersection of the two lists.the original lists should remain same. (Intersection - if first list is say,1,20 3,45 and second list is 3,24 ,45,90,68 then intersection should be 3,45 )
2. The second was given two nodes of a binary tree find the closest ancestor of the two nodes.
Note:consider binary tree and binary search tree also.
In short answer type questions, the questions were - 

1.There was an aptitude's question in which P(A) and P(B) were given and we had to find P(B/A) and P(A/B) when A and B are independent events.
2.What is the probability that the the 4 digit's no. which is formed by using the digits 1,2,3,4,5,6 is divisible by 4.
3.What tree traversal gives the no. in sorted order. Inorder, preorder or postorder ?
4.Preorder and inorder traversal was given and we had to find the tree.
5. Which sorting algorithm takes best and worst time complexity as O(nlogn)?
6.A dbms query was asked to find the second largest no. of book sold.(i don't remember the question exactly)

ShareThis

 
View My Stats