Bloomberg LP Interview Question for Financial Software Developers






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

Well, if there is no constraint of balance, this may be a case of simple insertions in a binary search tree with complexity of 0(logn). If balance is a constraint, then probably a red-black tree may be a way to go, with the same complexity of O(logn).Comments are welcome

- amit October 10, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

For unbalanced trees complexity of insertion is same as lookup which is O(n)

- Jai October 21, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

What did you mean by balance?

- Ano October 13, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

By balanced it is meant that the tree does not degenerate into a link list with each node just having either left or right children. For it to be balanced the height of the tree should be O(n) which only happens when children are equally divided between left and right subtrees.

- Jai October 21, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Sorry for the typo, I meant height of the tree should be O(logn), for it to be balanced.

- Jai October 21, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Use Red Black Tree

- Anonymous November 29, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Why Only RedBlack , why Cant AVL be used here ?? AVL tree is more balanced than RedBlack ..

- Anonymous January 21, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Red black trees and 2-3-4 trees are operationally equivalent for all practical purposes. I mean that their memory management is different, etc. but from a complexity point of view( time or memory) they are completely equivalent.

- Anonymous February 02, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Why not simply create a set<int> mySet and call mySet.insert for each number? I am assuming they didn't ask you to implement a redblack or avl or any other balanced tree.

- Anonymous April 18, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Splaying would be easier and far simpler ....

- Egon August 23, 2010 | 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