Bloomberg LP Interview Question for Financial Software Developers






Comment hidden because of low score. Click to expand.
0
of 0 vote

Circular Double Linked list

- Anonymous January 18, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Why do we need a doubly linked list? Isnt a circular (singly )linked list suffice?

We dont need to traverse backwards, all we need to do is increment the counter and move forward and when the counter reaches 3, remove the element and reset the counter and countinue the same again.

- Anonymous January 18, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

i think someone said Doubly circular linked list 'coz its easier and efficient to delete in a doubly linked list.

- rad# January 28, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

The question is not complete. What will happen once the count of the people is less than 3? Does the count wrap around? In that case a circular linked list makes sense.

If on the other hand, we stop once the count is less than 3, a simple bool array will do. If the person still in the game, the corresponding element will have value 'true' and if not, 'false'.

- Arby February 21, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

bloomberg sucks ass. do they expect us to write a book on puzzles, expecting us to solve stupid questions like these..

- booberg March 05, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think linked list is enough, because you can calculate the index of element to be actually deleted without iterating over the whole list again and again.

In each round, if number of remaining people is greater or equal to 3, then remove the 2nd element in the linked list(index start from 0).

If number of remaining people is less than 3, then remove (n % 3 - 1)th element.

Until there is only one element left.

- Zhengyang.Feng2011 March 13, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Can we maintain a Linked List and delete head->next->next always until our list has < 3 nodes? Thanks

- Srinivasan March 18, 2013 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More