Bloomberg LP Interview Question for Software Engineer / Developers






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

in STL, map is implemented by RB tree, while hashmap is implemented via hash

- guzhiwei August 08, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Another one.
While std::map is in C++ standard, the hash_map is not in standard. So typically it is not recommended to be used. However some STL implementations have it.

- pradip August 19, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

map :
comparison at each node to get correct value
hashmap :
uses hash function to correct map key;
constant lookup;
collision may occuer. so can increase linear time

- RIDER October 03, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

In STL, map is implemented by RB Tree whereas Hashmap is implemented by linkedlists/vectors
Map does have duplicates. HashMap has.
Map does not have collisions.
Map has a complexity O(logn), hashmaps generally have O(1).

- Richa Aggarwal November 10, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

map: elements are sorted. most operation complexities O(logn).
hashmap: elements are random. most operation complexities amortized O(1), worst case O(n)

- blueskin.neo November 21, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Map is implemented through binary search tree where it key are always sorted internally. Since it has to traverse the tree to insert or delete, it slower than unordered_map (hashmap) which takes constant time to insert and retrieve.

- Keyur May 11, 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