Bloomberg LP Interview Question for Senior Software Development Engineers


Country: United States




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

Have a balanced BST holding records sorted on timestamp. The question will reduce to find nodes in given range in a bst. For descriptions keep a hash with values pointer to the nodes in the balanced BST nad return all matching descriptions.

- PB October 08, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

We could use sorted or hash maps for quick search by name and the timestamp. Those maps should just deal with the same pointers to records. GetDesriptions may return a vector of strings, and the GetRecords may return a vector of records for your programming convenience.

- igorfact August 13, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

It depends on the cache implementation technique like LRU etc.
We can use LinkedHashMap here if programming in java...

- avi August 14, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

1. LinkedHashMap is the easiest, just like a LRU cache.

2. Otherwise, use a HashMap to store all the records in pairs like (Name, Record). Then use a ArrayList to sort all records based on time. This is a way to simulate LinkedHashMap.

- lixiang.cmu August 14, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Well, one question is: Is the data stagnant or evolving over time?
If data is stagnant / bearly changes with time, I would use an ISAM (Indexed Sequential Access Method) tree or in the latter case, a B+ Tree. Both of these trees with startTime as primary key and name as the secondary key. This is because, the primary key is efficient for range searches (because it will be clustered) while secondary key is not. There are open source libraries available to build and maintain these datastructures.

For example: jdbm2 @ google code (Sorry could not provide actual link)

- Anonymous September 09, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

If able to use C++11, use std:: unordered_multimap to hash records by name, and std::ordered_set to organize records by time. GetDescriptions() can return a std::vector of const char* for descriptions, and GetRecords,() can return std::pair of const_iterators to range of records.

The assumptions here were that return values cannot be modified; drop the const if that is not the case.

- sk3l April 19, 2015 | 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