## Bloomberg LP Interview Question for Financial Software Developers

• 0

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

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

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.

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

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

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'.

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..

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.

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

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.

### 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.