Financial Software Development Interview Questions | Glassdoor

Financial Software Development Interview Questions

296

Financial software development interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

Financial Software Developer at Bloomberg L.P. was asked...

Sep 13, 2010
 How to find the medium number of a given array.3 AnswersRandomized quickselect is usually the easiest to implement http://en.wikipedia.org/wiki/Selection_algorithmFirst sort the given set - O(n logn) Then if the size is odd, the middle element if the size is even, then its the average of the two middle elementsyou could do that in linear time if the array size is less than 5 - easy to find if more than 5, read first 5 elements. Eliminate the smallest and the largest. Now you have 3 elements. Read another 2 elements, compare to your 3 elements that you've read before. Eliminate smallest and largest. Continue doing that until you have less than 5 elements left and then easily find the middle element among the remaining ones.

Financial Software Developer at Bloomberg L.P. was asked...

Feb 15, 2012
 How do you reverse a number without storing it in an array Ex: 412 should be printed as 2144 AnswersI gave an answer but they told me that I am using un-necessary multiplications and divisions,int reverse(int n){ int rev = 0; while(n!=0){ rev = rev*10 + n%10; n = n/10; } return rev; }int reverse(int n){ if(n==0) return; int tmp=n%10; reverse(n/10); printf("%d",tmp);}Show More ResponsesArithmetic operations are unnecessary. If it is required to use an array, have variable i from start and variable j from the end walk towards center of the array and swap content of a[i] and a[j].

Financial Software Developer at Bloomberg L.P. was asked...

Feb 15, 2012
 How do you remove extra parenthesis in a given equation Ex: ((a+b))*c should be converted to (a+b)*c 3 AnswersI used stacks, but they want something simpler.Just recursion?My idea is to scan string left to right, when encounter with "((", find the matching "))" by starting. Then decide if the candidate pair can be removed. My code (java) may be a bit long and can be possibly shortened. But I think the test cases I used may represent the cases they want me to deal with. class RemoveAdditionalParenthesis { public static void main(String[] args) { String input = "((1+2+3))+4";//can be shortened to (1+2+3)+4 String input1 = "((1+2)+(3+5))+4";//Cannot be shortened String input2 = "((1+2)+(3)+(4+5))+4";//can be shortened to ((1+2)+(3)+(4+5))+4 String input3 = "((((1+2)+((3))+((4+5)))))+((4))";//can be shortened to ((1+2)+(3)+(4+5))+(4) System.out.println(RemovePar(input)); System.out.println(RemovePar(input1)); System.out.println(RemovePar(input2)); System.out.println(RemovePar(input3)); } public static String RemovePar(String inputExp) { int startIndex = 0;//global index to keep track of the current focus start position while(true) { char[] inputs = inputExp.toCharArray(); int candiateStart = -1; int candiateEnd = -1; for(int i=startIndex; i

Financial Software Developer at Bloomberg L.P. was asked...

Feb 23, 2011
 Now if you have a sorted array, how will you search for an element? 3 AnswersAlgo of binary searchWe can use binary search, it takes O(log n) time.True. He then asked me to write a function for binary search.

Financial Software Developer at Bloomberg L.P. was asked...

Mar 25, 2011
 sorting the red and green balls.RRRRRGGGGGGGG to RGRGRGRGRGGGGG3 AnswersThis will be a simple, intuitive way. It doesn't guarantee any efficiency. Count the number of R's in RRRRRGGGGGGGG. Then, we will also have the number of G's by subtracting the number of R's from the total size. Now you we compare two values, here R is less than G. So we create a new array with initial total size with everything initialized as lets say A. Replace A with R on alternate slot. Then replace the rest with G. The time complexity for this will be O(n)Or you can keep track of count and work accordingly.If we know the number of reds, then we can swap with green ball starting from index 1 till red balls finish by skipping 2.

Financial Software Developer at Bloomberg L.P. was asked...

Mar 25, 2011
 6 face dice. He rolls 1 to win, and me 6. He rolls first, what's the probability that he eventually win.3 AnswersI didn't answer the exactly number...but it's fine.1/6 + (5/6)^2 * (1/6) + (5/6)^4 * (1/6) +.... = 6/11Here, there are infinite possibilities. He might win in his first attempt, or second attempt, or third attempt or so on... So the probability goes like this: (1/6) + (1/6)^2 (5/6) + (1/6)^3 (5/6)^2.... If you read the pattern....it is in geometric series with initial value as (1/6) and the ratio of (1/6).(5/6)...And we can solve this question further by applying geometric series.

Financial Software Developer at Bloomberg L.P. was asked...

Sep 9, 2011
 Write a program to reverse each word in a string and remove spaces say "i am good" to "imadoog".3 AnswersDid you use STL or write you own code using pointers? I bet they want people who think about and use standard algorighms rather than write complex pointer code. void foo(string& s) { string::iterator pos1; string::iterator pos2; pos1 = s.begin(); do { pos2 = find(pos1, s.end(), ' '); reverse(pos1, pos2); if (pos2 != s.end()) s.erase(pos2); pos1 = pos2; } while (pos1 != s.end()); }maybe using stringstream will doin javascript: var str ="I am Good"; console.log(str.split(" ").reverse().join("")); notice i split the string by space and joined it back by blank

Financial Software Developer Intern at Bloomberg L.P. was asked...

Nov 21, 2011
 Given an array of 1..n numbers with 2 numbers missing in it find the missing ones.3 AnswersSort1. Sort the array 2. Loop from 2 to n, and if array[i] - array[i-1] == 2 then the number missing would be array[i] - 1For a linear solution, find the sum and product of all numbers and use the quadratic formula to find them.

Financial Software Developer Intern at Bloomberg L.P. was asked...

Jan 11, 2014
 Write a program that verifies that a binary tree is a binary search tree.3 AnswersLet the BinaryTree contain 3 variables: value, leftChild, rightChild. The leftChild and the rightChild are again type of BinaryTree only. Now say you are given root node as the argument. At every stage, check if the value of the leftChild is less than current node value which is less than value of rightChild. If it is satisfied, recurse through its children. Otherwise, return "Not a Binary Search Tree"void traversal(Node* root){ if(*root== NULL) return; ArrayList thislevel = new ArrayList; thislevel.add(root) ; while(!thislevel.isempty()){ArrayList nextlevel = new ArrayList; for(Node s in thislevel) { if(s= = NULL)break;if(s>s.leftchild)if(s.rightchild>s){nextlevel.add(left);nextlevel.add(right);}else{return(0);)} thislevel = nextlevel;}return(1);}The first ans won't work since there can be a right node on left hand side of root ..thats more than parent and also more than root.. A violation.. So have min max values check each node shd b between min and max.. If yes bst else no

Financial Software Developer at Bloomberg L.P. was asked...

Nov 3, 2010
 1-100 integer sequence, how to find the missing 2 numbers2 Answersmy guess is square each, and find the difference, solve two equationssolve these 2 equations for A and B: 1+...+ A +...+ B +...+100 = 100(100+1)/2 1x... x A x .. x B x ...x 100 = 100!
3140 of 296 Interview Questions