Bloomberg LP Interview Question for Financial Application Engineers


Country: United States
Interview Type: Phone Interview




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

using double array, one containing the value other containing the index of the next element.

- Anonymous April 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

In that case too, cost of inserting/deleting an element will be linear in worst case time. Or am I missing something here?

- Second Attempt March 13, 2013 | Flag
Comment hidden because of low score. Click to expand.
2
of 2 vote

Consider arr[][3] as a linkedlist where arr[i][1] stores the data, arr[i][0] stores the previous index, and arr[i][2] stores the next index. Adding an element is trivial. To delete an element, modify the next index of the prev element and prev index of the next element. To prevent possible "holes" in the array on multiple deletions, maintain a "free list" that you can use to add an element to the deleted index instead of using a new slot altogether.

- Jagat September 21, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

one way you can think of it as the index of the array as the value and the address of the next to be stored on that index. The head var would store the address of the starting array index.

- raja roy March 31, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I think this is a terrible idea. If you only has one element, say 1m, then you have to allocate an array of size 1m to store it. How about 1b?

- Jason April 07, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

In Java Library, ArrayList is a resizable-array implementation of the List interface.
LinkedList (class) is another implementation of same List interface.

Array needs to be re-sized (adding more element then initialized array) or
If linked list is implemented using array then new array needs to be created for positional updates. ie. add(index, element). New array creation and copying all the element in new array with required update.

- Anonymous April 02, 2012 | 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