Bloomberg LP Interview Question for Financial Software Developers


Country: United States
Interview Type: Phone Interview




Comment hidden because of low score. Click to expand.
3
of 5 vote

If efficiency is determined in terms of time complexity of insertion/deletion/search, a hash table mapping name (key) to phone number (value) will provide O(1) lookup, addition and deletion, should be most efficient.

This will hold true, unless the number of name-phone number entries are exorbitantly large, leading to hash collisions.

- Sharma February 13, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
2
of 6 vote

Trie
Probably this was the answer the interviewer was looking for.

Full details here: //en.wikipedia.org/wiki/Trie

- Shekar Gurram February 13, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

how a hash table mapping name (key) to phone number (value) will provide O(1) lookup?
looking for key (name) in hashmap will itself take O(n) time?

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

In HashMap you use Hash of the name to look for. It is O(1)

- xyz May 22, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Search for what? Name? Full name or partial match? What is considered a partial match (e.g. firstname/lastname split)?

Or search for the phone number (the name having a phone number)? Or just part of the phone number - number matching?

- Selmeczy, P├ęter February 13, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

HashMap<String, String>
String1 - name
String2 - phone number
O(1)

- Kevin February 06, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

If we have non collide hash function thne hash table is perfect chioce.
otherwise balanched binary search three would be good choice as data strcuture

- Bond January 26, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Dictionary<string,long>

- Anonymous February 25, 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