Bloomberg LP Interview Question for Financial Software Developers


Country: United States
Interview Type: In-Person




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

Either the interviewer doesn't know their stuff or it's a trick question. STL maps use trees internally, I imagine balanced ones.

- eugene.yarovoi October 24, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Hash tables are an extension to STL and are NOT using trees internally.
Inside hash map, the buckets are organized into vectors of lists and rehashed once the load factor is exceeded.

- kakawka October 24, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I might not have understood the question. The typical STL maps don't use hash tables, which is why I said what I did.

Perhaps the interviewer was asking about how I would implement a hash table.

- eugene.yarovoi October 24, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Unless they were referring to the unordered maps introduced in the C++11 standard, the STL maps (std::map and std::multimap) maintain the elements in sorted order. This is required by the C++ standard. The standard does not require a specific implementation (just runtime complexity requirements), but having said that, most implementations that I am aware of use red-black trees. Since hash tables don't maintain sorted order, they don't meet the criteria for an STL map. Hash tables and buckets would make more sense in the context of std::unordered_map and std::unordered_multimap.

- Darren Wolford December 31, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@kakavka : I'm sorry that's not accurate. STL maps use red-black balanced trees. For a pure hash table you should use unordered_map.
As for buckets I guess they refer to bucket sort which makes use of a hashing function, but all in all it's nothing but exploiting collisions at own advantage rather than minimizing them as you would do in a hash map.

- Antonio January 19, 2013 | Flag


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