Bloomberg LP Interview Question for Financial Software Developers






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

I told I'll implement aa hash table for the dictionary. And check the misspelled word in the dictionary by this hashfunction:

hashval = (127*hashval()+key.charAt(i))%N (N is a big prime number 16908799)

- Siva December 30, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Use binary search to guess the world.

- Avinash December 31, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

we can build a trie for the dictionary and lookup to check if the word is a terminal word in the trie?

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

See this post. This is written by Google's Director of Research
norvig.com/spell-correct.html

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

@siva...is this question asked for full time r intern?

- RajiniHassan January 02, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

full time

- siva January 07, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

The trie method seems better..and please dont post google,python and such answers. Nobody in the world likes/wants to hear them.

- Vaibhav Garg January 09, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

true!

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

Solve it through edit distance approach.

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

Dictionary as TST . Then we can find out all words within Hamming distance d .

- JD January 26, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Words might be variable length, so hamming distance might be difficult to define ?

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

A lexicographic search can be done to narrow down search operation. If no word exists, the word is misspelled.

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

It seems to me that the phrase "a dictionary is given" is an ambiguous phrase. I would ask the interviewer what this phrase meant.

If it meant that a data structure representing the dictionary was provided, I would perform what ever lookup was appropriate for the data structure. I cannot imagine a complexity greater for such a lookup that would be greater than N and any attempt to fill an additional data structure would be at best N before the lookup could be performed.

If it meant that a file of words was provided, it gets pretty tricky. Are the number of entries in the file known? Is the format of the file known? Can the position of entry n/2 be easily calculated? If so, I would perform a binary search on the disk file. I am aware that this would require a lot of disk accesses, but I doubt that it would be expensive than reading the while disk file into some more accessible data structure.

Only if the format of the disk file made a binary search difficult would I read the data into a data structure.

- Wandering programmer March 05, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

If it were upto the candidate, I would represent the dictionary as a suffix tree.
In that case looking up any word is straight forward.

- Rob March 14, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

A Prefix tree and NOT Suffix tree would help here. Suffix tree are useful for pattern matching while Prefix trees are useful for word matching (as checking against a set of words).

- vj March 10, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Actually the most query-efficient solution would be to have both a suffix and prefix tree. For an easy analysis, let's assume there we are in one of these cases:
1) 1 extra character somewhere,
2) 1 mispelled characters somewhere,
3) 1 missing character somewhere.

Therefore, the word can be represented as "(part contained in the suffix tree) (character x) (part contained in the prefix tree)". Walk down both trees and at some point we either won't be able to proceed further; intersect the sets containing the following characters and find out the value of x to fix the word.

- GodOfCode April 01, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I am going to use a simple greedy algorithm for the problem and gives possible predictions to choose from if the word is mispelled.
as the dictionary is given to us checking whether a word is mentioned in the dictionary is matter of time function check(word) say O(1).
Step1: check whether are there any matches for the word in the dictionary if not continue else end
Step 2:
for(i < length of word)
for( j from a to z)
word[i] = j
if( check(word) = = TRUE)
possibility[i][j] = word[i];

output possibility[i][j];

The Program runs for 26 * length of the word(n) i.e O(n)

- Roshan December 16, 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