Bloomberg LP Interview Question for Financial Software Developers






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

sort the larger array....for every element in the smaller array...do a binary search in the larger...efficiency o(nlogn)...n is the size of larger array

- Anonymous December 12, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

why not sort the smaller array, could have been better.

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

Nope sorting the smaller array does not make any sense as you have to search for the values in the big array. So irrespective of the fact that the values in the small array are sorted or un sorted it does not make any difference

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

maintain a hash table for the first array(O(n) space) and then scan through this table to find the elements in array2(O(n)) time.

- Musheka December 12, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

also, you can hash the bigger array...and scan the smaller array....

- Neerav March 14, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Sort both arrays which takes O(nlogn)
and search both arrays for a common element which takes O(n)...

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

nee mama raa! nee mama!

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

How about dynamic programming? For example, for 2 strings, find the longest common substring.

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

because you are insane

- Rocker November 14, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

shouldnt it be O(nlogm)?? where n is the smaller array, m is the larger

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

int main(){
char arr1[] = "asdfghqqewty";
char arr2[] = "asdfghqqioiu";

int len1 = strlen(arr1), len2 = strlen(arr2);
sort(arr1, arr1 + len1);
sort(arr2, arr2 + len2);

int index1 = 0, index2 = 0;
while(index1 != len1 && index2 != len2){
if (arr1[index1] == arr2[index2]){
cout<<arr1[index1];
++index1; ++index2;
}else
if(arr1[index1] > arr2[index2])
++index2;
else
++index1;
}
cout<<endl;

return 0;
}

Time O(nlogn)

- Anonymous February 24, 2010 | 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