Bloomberg LP Interview Question for Financial Software Developers






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

Preprocess all the dictionary words in a Suffix tree.
Traverse the node of suffix as per the character is typed.
If the traversal doesnt leads to any of the node in suffix tree, highlight the word.

If backspace is also allowed to make correction after user sees the highlighted word then each node of Suffix Tree should contain the pointer to its parent node also.

- Tulley December 03, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Wow, that doesn't sound like something someone with just one programming class would know...

- Anonymous December 03, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Why to use suffix tree? Every leaf of this tree means suffixe and here we need words. Instead one may use prefix tree (trie) and there will be the whole words in it.

- Anonymous December 03, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I agree about the idea that suffix tree is not required here. Also I think it would use too much excesive memory. I know that it uses O(n) memory, but that O(n) have an assumption that we store edge as a two indexes from the original word, so here we should store words somewhere or store edges as a string, what would result in O(n^2) memory. Anyway PATRICIA trees would be much better choice than TRIE, since it compresses edges. Tree aproach is not perfect, since they doesn't utilize the property of languages that many deal of words end with the same suffix. We can on example make additional tree for ends of a nouns/werbs, and if we are on the end of the noun we go to the noun tree.

The optimal solution would be using Directed Acyclic Word Graph (DAWG). More about it here: http://en.wikipedia.org/wiki/Directed_acyclic_word_graph . The image on the right shows good comparision of space efficency of DAWG and TRIE.

- R.Kozikowski January 18, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

To check spellings of words - which have a set of delimiters - why not do a last word spell check every time one of the characters in the delimiter is typed? Use a preprocessed dictionary for word lookup. If no such word, highlight the word.
Cancel lookup on backspace or word alteration.

Checking on every character typed is more like auto-completion, not necessary for just spell check I think.

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

I said about checking with each space, I assume thats the delimiter you mean, but he said he wanted something for as the word is being typed out.

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

test

- Soumik December 09, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Question is about Anagram and Hashtable/map is the datastructure to implement it.

- Singh January 30, 2011 | 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