Bloomberg LP Interview Question for Financial Software Developers






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

TRIES

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

Tokenize the string and look the tokens up in a dictionary or a hash table.

- Anonymous July 27, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

true (multimap could be a better DS if implemented in c++)

- Rahul August 10, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

char * remove_tokens(char a[])
{
char * ptr= new char[strlen(a)];
char * result= new char[strlen(a)];
strcpy(result,"");
ptr= strtok(a," ");
while (ptr)
{

strcat(result,ptr);
strcat(result," ");
ptr= strtok(NULL," ");

}
return result;
}

- Varun October 01, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Here, the key is not about tokening based on white spaces. That is easy. We need to decide how to check mis-spelled words. Which DS to use. There are millions of English words. Hashmap will be fastest with O(1) access time. All others will be slow. Multimap will be the next fastest. We can also cache most-frequently words so that we can increase speed.

Complexity is: O(n) for tokenizing. O(1) mostly for checking spelling. O(n) for dictionary storage.

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

Supposing that we have a dictonary to check if the word form is valid we can permute the letters and for each permutation we can lookup in the dictonary if the word is valid if yes then we can suggest that word.

StringBuffer result = new StringBuffer("miss_spelled_word");
void permute(int i){
if(i==len)
System.out.println(result);
else{
for(int j=i;j<len;j++)
{
swap(i,j);
permute(i+1);
swap(i,j);
}
}
}
static void swap(int i, int j){
char temp = result.charAt(i);
result.setCharAt(i, result.charAt(j));
result.setCharAt(j, temp);
}

- Ravi Ranjan March 08, 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