Vamsi Pavan’s Place

When curiousity outbursts …..

Entries Tagged as 'Placements'

3 black hats and 2 white hats

June 18th, 2008 · 1 Comment · Placements, Puzzles

Four
men are lined up on some steps. They are all facing in the same
direction. A wall seperates the fourth man from the other three. So to summarise :-
Man 1 can see men 2 and 3. Man 2 can see man 3. Man 3 can see none of the others. Man 4 can see none of […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:

Create a function, called findZeros(), that will compute the number of zeros in the decimal representation of n!

June 18th, 2008 · No Comments · Algorithms, Google

For example, 5! = 1.2.3.4.5= 120 has one zero and 10! = 1.2.3.4.5.6.7.8.9.10 = 3628800 and has two zeros.
can anybody help? best of all answers comes here …

Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:·

Create a function, called powerSet(), that will output the power set of the input set.

June 18th, 2008 · 1 Comment · Algorithms, Google

The power set in Algebra theory is the set of all subsets of a set
(no..bull-set!) If a set has N elements then the power set will have
2^N elements. So if a set is denoted by {a,b} with a,b as elements then
the power set is { {},{a},{b},{a,b} }.The {} is the empty set.
Can anybody help? best […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:···

Coin weighing and finding defective

June 16th, 2008 · No Comments · Placements, Puzzles

There are 9 coins. Out of which one is odd one i.e weight is less or more. How many iterations of weighing are required to find odd coin?
Try yourself first and finally, Select all to know the answer.
Answer
It is always possible to find odd coin in 3 weighings and to tell whether the odd coin […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:··

Typical Unix/Linux recursive search commands

June 9th, 2008 · No Comments · Algorithms, Linux

The Typical one is - to find the files with some pattern recursively in a given directory.
$ find path/to/dir -name “*.html”
You can replace the “*.html” to your own filename pattern.
Another one is, in addition to above I need the text lines inside those files starting with letter t.

$ find path/to/dir -name “*.html” -exec grep “^t” […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:···

Difference between String str=”abc” and str=new String(”abc”)?

May 25th, 2007 · 5 Comments · Java, Placements

1) using new operator:- String st=new String(”abc”);
2) Without using new operator:- String st=”abc”;
Once string object is created with or without new operator contents of string object cannot be modified. But we can modify String reference variable. when you are trying to modify string objects ie.. concatinating,repalcing etc.. a new […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:

Logic Puzzles : (stamps)

May 14th, 2007 · No Comments · Puzzles

Question : The grand master takes a set of 8 stamps, 4 red and 4 green, known to the logicians, and loosely affixes two to the forehead of each logician so that each logician can see all the other stamps except those 2 in the moderator’s pocket and the two on her own head. He […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:

Logic Puzzles : (hats)

May 14th, 2007 · No Comments · Puzzles

Question : The two losing masters wanted a riposte, so the grand master showed them 5 hats, two white and three black. Then he said: “I will turn off the light and put a hat on each of your heads and hide the other hats. When I turn on the light you will have equal […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:

Logic Puzzles : (dots)

May 14th, 2007 · No Comments · Puzzles

Question : Three masters of logic wanted to find out who was the wisest one. So they invited the grand master, who took them into a dark room and said: “I will paint each one of you a red or a blue dot on your forehead. When you walk out and you see at least […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:

Man in the Elevator

May 14th, 2007 · No Comments · Puzzles

Question : A man lives on the tenth floor of a building. Every morning he takes the elevator down to the lobby and leaves the building. In the evening, he gets into the elevator, and, if there is someone else in the elevator - or if it was raining that day - he goes back […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags: