Placement's Practice

6 views
Skip to first unread message

amey patil

unread,
Mar 24, 2010, 3:31:00 AM3/24/10
to FRBECOMPS2011
I am starting this forum to start discussing apti questions, technical
questions and verbal....
post d ques .. n try to solve d ques posted by others .. but do not
post the list of d questions only 1 ques at a time ... n then once we
get the correct ans and correct way to solve dat ... post d next
ques... lets make this thread d most interesting 1

amey patil

unread,
Mar 24, 2010, 3:39:12 AM3/24/10
to FRBECOMPS2011
infosys interview question 2008

u have only 2 sand clocks .... 1 of 7hrs and another of 11hrs
u have to boil an egg which takes 15 hrs to boil (very rare na!!)
how ll u count 15 hrs??

frbecomps

unread,
Mar 24, 2010, 2:17:41 PM3/24/10
to FRBECOMPS2011
we can see 15 can be 11+(11-7)
but how do u calculate 11-7 using sand clocks...?

namu

unread,
Mar 24, 2010, 3:29:46 PM3/24/10
to FRBECOMPS2011
u'll start both clocks simultaneously & start boiling egg wen clock of
7hrs stops..wen clock of 11hrs wil stop u'll start it again & thus
v'll get (11-7)+11=15

amey patil

unread,
Mar 25, 2010, 9:17:11 AM3/25/10
to FRBECOMPS2011
u r absolutely correct namrata ... but still not the efficient
answer ... as a computer engineer u should always look at the
efficiency....
nw take a look at this 1....this is my approach

I ll start boiling egg n also start both clocks simultaneously ...
when 7hrs clock stops i ll invert it to start it again...
when 11hrs clock stops i ll invert 7hrs clock which has d sand of
4hrs ... after 7hrs clock stops i ll stop boiling egg...
thats it ...
you see namrata, here you dont have to wait for 7hrs initially and
then start boiling egg...
so in your case you r actually using 22 hrs (though exact 15 hrs for
boiling) while in this case it uses exactly 15 hrs...

amey patil

unread,
Mar 25, 2010, 9:38:43 AM3/25/10
to FRBECOMPS2011
As the above question was from interview i dont kno the exact answer
For the following question they have given the answer but approach i
dont kno so try it ...

Cisco, Bangalore question 2005

int main()
{
int a;
printf("%d",scanf("%d",&a));
}
what will be the o/p of this program? ..what will be printed?

Message has been deleted

namu

unread,
Mar 25, 2010, 11:05:25 AM3/25/10
to FRBECOMPS2011
o/p will be 1 irrespective of the i/p because scanf function returns
how many format specifiers (%) it has

so o/p of da following prog is 2


{
int b,a;
printf("Enter the Inputs");
a=scanf("%d %d",&a,&b);
printf("\n a value is :\t");
printf("%d",a);

}


hope..it's clear now..

don't be surprised even i dinno dis..searchd it on da net ;)

> > > > but how do u calculate 11-7 using sand clocks...?- Hide quoted text -
>
> - Show quoted text -

amey patil

unread,
Mar 26, 2010, 8:48:15 AM3/26/10
to FRBECOMPS2011
Accenture 2004

Of Abdul, Binoy, and Chandini :

a) Each member belongs to the T family whose members always tell the
truth or to the F family whose members always lie.
b) Abdul says ''Either I belong or Binoy belongs to a different family
from the other two."

Whose family do you name of?

namu

unread,
Mar 29, 2010, 11:26:20 AM3/29/10
to FRBECOMPS2011
following combinations r posibl
abdul binoy chandini
T F F
T F T
F F T

so v can surely say dat binoy belongs to F :)

> > > - Show quoted text -- Hide quoted text -

amey patil

unread,
Mar 31, 2010, 10:27:52 AM3/31/10
to FRBECOMPS2011
Some Java Questions and Answers , from Satyam, Wipro, Syntel and
"Yahoo"

1) The mechanism by which java frees the memory occupied by unused
objects is ________.

2) Which thread is created automatically when the program is started ?

3) Which is more efficient? Nested If or Switch

4) Exit statement is optional in which loops in java?

5) The ________ is similar to break, except that instead of halting
the execution of the loop, it starts the next iteration.

6) The mechanism which binds together the code and data and keeps both
safe is ________.

7) Start( )executes a call to ________.

8) Name the Access Specifiers available in Java?

9) What are the different forms of polymorphism?

10) __________ can be used as an alternative to Inheritance.


True or False ---

1) With java Type Casts are checked at both compile-time and runtime.

2) Integer can Cast to byte value.

3) Transient variable is variable that may not be serialized.

4) Interface can be extended.

5) There can not be an abstract class with no abstract methods in it.

6) Operator Overloading does not exist in java.

7) Interface can not have class in it.

8) A static method can refer to any instance variable of the class.

9) Java does not allow a method with the same signature in a subclass,
as a method in the super class.

10) When implementing a derived class’ copy constructor, its base
class copy constructor is automatically called whether or not an
explicit call to super( ) is made.


Read the following program:
public class test {
public static void main(String [] args) {
int x = 3;
int y = 1;
if (x = y)
System.out.println("Not equal");
else
System.out.println("Equal");
}
}

What is the o/p?
.
.
.
.
.
.
.
.
Answers -->

1) Garbage Collection
2) Main thread
3) Switch
4) While , Do-while , For
5) Continue
6) Encapsulation
7) run( )
8) Public
Protected
Private
Defaults
9) Method overloading
Method overriding through inheritance
Method overriding through the Java interface
10) Delegation


1) True
2) False
3) True
4) True
5) False
6) True
7) False
8) False
9) False
10) True


Program --
An error at " if (x = y)" causes compilation to fall.

amey patil

unread,
Mar 31, 2010, 11:09:48 AM3/31/10
to FRBECOMPS2011
Infosys Aptitude Test 1998

At six o'clock the wall clock struck 6 times . Checking with my
watch, I noticed that the time between the first & last strokes was
30
seconds. How long will the clock take to strike 12 at mid night (time
btwn first and last strokes)?

namu

unread,
Apr 2, 2010, 1:15:03 AM4/2/10
to FRBECOMPS2011
66seconds

because.....
time between 2 strokes=6seconds
at 12, 12 strokes wil b der so 11 time intervals so 11*6=66

amey patil

unread,
Apr 3, 2010, 8:00:07 AM4/3/10
to FRBECOMPS2011
good 1 namrata ....

tanmay

unread,
Apr 3, 2010, 10:03:13 PM4/3/10
to FRBECOMPS2011
Try this:

put any mathematics sign-

2 2 2 = 6

3 3 3 = 6

4 4 4 = 6

1 1 1 = 6

ahmed

unread,
Apr 4, 2010, 12:35:27 PM4/4/10
to FRBECOMPS2011
2 + 2 + 2 = 6

3 * 3 - 3 = 6

4 + 4 - sqrt(4) = 6 // i m using sqrt

(1 + 1 + 1)! = 6

amey patil

unread,
Apr 10, 2010, 1:37:30 AM4/10/10
to FRBECOMPS2011
good 1 ahmed , for d last 1 actually it gives 2 meanings... lol
3 's factorial = 6 or
3 is not equal to 6
off course 1st is more approriate ...

amey patil

unread,
Apr 10, 2010, 1:45:20 AM4/10/10
to FRBECOMPS2011
"yahoo" apti question
quite big ... :-(

Five sailors survive a shipwreck and swim to a tiny island where there
is nothing but a coconut tree and a monkey. The sailors gather all the
coconuts and put them in a big pile under the tree. Exhausted, they
agree to go to wait until the next morning to divide up the coconuts.
At one o'clock in the morning, the first sailor wakes up. He realizes
that he can't trust the others, and decides to take his share now. He
divides the coconuts into five equal piles, but there is one coconut
left over. He gives that coconut to the monkey, hides his coconuts
(one of the five piles), and puts the rest of the coconuts (the other
four piles) back under the tree.
At two o'clock, the second sailor wakes up. Not realizing that the
first sailor has already taken his share, he too divides the coconuts
up into five piles, leaving one coconut over which he gives to the
monkey. He then hides his share (one of the five piles), and puts the
remainder (the other four piles) back under the tree.
At three, four, and five o'clock in the morning, the third, fourth,
and fifth sailors each wake up and carry out the same actions.
In the morning, all the sailors wake up, and try to look innocent. No
one makes a remark about the diminished pile of coconuts, and no one
decides to be honest and admit that they've already taken their share.
Instead, they divide the pile up into five piles, for the sixth time,
and find that there is yet again one coconut left over, which they
give to the monkey.

Question: What is the smallest amount of coconuts that there could
have been in the original pile?

On Apr 4, 9:35 pm, ahmed <ahmed1...@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages