Vamsi Pavan’s Place

When curiousity outbursts …..

Entries Tagged as 'Placements'

The Greedy Pirates! (Solution)

June 5th, 2009 · 1 Comment · Puzzles

For Question
The idea is to reduce the number of participants (greedy pirates) and see what happens in that case and start reasoning based on that. One more thing to note here is that a pirate would accept a proposal only if he knows that in case he would not accept the proposal, he would get […]

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:

The Greedy Pirates!

June 5th, 2009 · 1 Comment · Puzzles

There are 5 pirates, all of them being equally greedy. They have varied number of years of experience. Say for convenience sake 5, 4, 3, 2 and 1. They find a booty of 1000 gold coins which they want to split amongst themselves. Everyone being greedy, wants the most for themselves. So they device a […]

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:

5 cards game … (Solution)

June 5th, 2009 · No Comments · Puzzles

For Question
Since there are 5 cards, at least two will have to be of same suite. So
I keep one of them and pass the other one as the first card. This way
the second guy will know the suite.
With the three remaining cards
that needs to be passed on, I will establish an absolute ordering
between them (breaking […]

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:

5 cards game …

June 5th, 2009 · 1 Comment · Puzzles

Two prisoners were sentenced to death by King Xuan of Zhou and were
kept in two different inaccessible cells. They were to be put to the
gallows the day after. However, King Xuan wanted to give them a last
chance. Since he was very fond of riddles, he came up with one for the
prisoners which if they solved, […]

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:

Memory efficient doubly linked list

October 12th, 2008 · 2 Comments · Algorithms, Articles, Data Structures

Linux Journal has an article in the January 2005 issue that introduces a doubly linked list that is designed for memory efficiency.
Typically elements in doubly linked list implementations consist of a pointer to the data, a pointer to the next node and a pointer to the previous node in the list.

The more memory efficient implementation […]

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:

Sheila and He-Man are twins; Sheila is the OLDER twin. Assume they were born immediately after each other, an infinitesimally small - but nonzero - amount of time apart. During one year in the course of their lives, Sheila celebrates her birthday two days AFTER He-Man does. How is this possible?

June 23rd, 2008 · 2 Comments · Placements, Puzzles

Sheila and He-Man are twins; Sheila is the OLDER twin. Assume they were born immediately
after each other, an infinitesimally small - but nonzero - amount of time apart. During
one year in the course of their lives, Sheila celebrates her birthday two days AFTER
He-Man does. How is this possible?
Bonus: What is the maximum amount […]

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:

There is an array A[N] of N numbers. You have to compose an array Output[N] such that Output[i] will be equal to multiplication of all the elements of A[N] except A[i]. For example Output[0] will be multiplication of A[1] to A[N-1] and Output[1] will be multiplication of A[0] and from A[2] to A[N-1].

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

Solve it without division operator and in O(n).

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:·

You have 1000 integers. All are less than 1000 and greater or equal to 1. Among them, 999 are distinct and there is one that is found twice. How can you find the duplicate?

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

Extension to this questions is - if there are some billion numbers are there, and you have enough memory to fit all these numbers. What is the best of to do the same?

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:·

if I had to find duplicates in book catalogs with entries with different titles but with the same content..

June 18th, 2008 · 2 Comments · Algorithms, Google, Placements

This is related to google print application. In other words, we have many books out of which some books titles were different but content same. We need to figure out such cases efficiently. How?

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:·

If we would like to index the entire earth population, how long should the index size be?

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

Really, it was asked in google interview. Of course, this is pretty much similar to classic questions like how many gas stations in the united states?
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: