Bloomberg LP Interview Questions
- 0of 0 votes
AnswersWhat does an iterator in C++ point to in case of a vector vs. list. Where would it point to if the prior links are deleted in the list? In case of a vector if it points to a specific index, where would it point to if the prior indexes are deleted?
- farzanmoofty August 12, 2014 in United States for Price history| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Arrays C++ Coding Linked Lists - 0of 0 votes
AnswersWhat C++ data structures would you use to implement LRU cache? Show implementation.
- farzanmoofty August 12, 2014 in United States for Price history| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ Coding - 0of 0 votes
AnswersHow would you implement this:
- farzanmoofty August 12, 2014 in United States for Price historyobject["String for a security name"]["another string"] = another_object
| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ Coding - 0of 0 votes
AnswerWhat are the various ways of doing IPC in Unix/Linux? How do you implement it?
- farzanmoofty August 12, 2014 in United States for Price history| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ Coding Operating System unix system programmin - 1of 1 vote
AnswersWrite a program to accept a nonempty string of alphanumeric characters. Define a “run” as a
- PioneerWoman March 06, 2014 in United States
consecutive sequence of a single character. For example, “aaaa” is a run of length 4. The program will
print the longest run in the given string. If there is no single longest run, then you may print any of
those runs whose length is at least as long as all other runs in the string.
Example input: a
Example output: a
Example input: aab
Example output: aa
Example input: abbbbbcc
Example output: bbbbb
Example input: aabbccdd
Example output: aa| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer - 1of 1 vote
AnswersWrite a program to accept a nonempty string of 0's and 1's as an argument. The program will print the
- PioneerWoman March 06, 2014 in United States
offsets of runs, each run consisting of all 0's or all 1's, where the runs are longer than 1. For example, if
given "0010011" it will print "0, 3, 5" on stdout.| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer - 0of 0 votes
AnswersFor an N-ary Tree find the nearest common ancestor.
- Messi February 22, 2014 in United States
Given: rootid and a function which finds and returns the immediate parent of a node.| Report Duplicate | Flag | PURGE
Bloomberg LP - 0of 0 votes
AnswersGiven a set of integer dots (like (1,5)), how can you find a pair that has an integer mid-point? For example, (1,1) and (3,3) have an integer mid-point of (2,2), while (1,1) and (3,2) do not. Tell the complexity of your code. What if the dots are N-dimensional?
- Anonym February 17, 2014 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Algorithm - 2of 2 votes
AnswersFind first unique number in an unsorted array of 32 bit numbers without using hash tables or array of counters.
- xejgomi February 16, 2014 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Algorithm - 0of 0 votes
AnswersThere is a large data file with 10 digit numbers. You are allowed to use only 20 megabytes of memory. How would you sort them ?
- xejgomi February 16, 2014 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Algorithm - 0of 0 votes
AnswersFind the longest repeating character in a sorted string
- xejgomi February 16, 2014 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Algorithm - -1of 1 vote
AnswersPlayer turns are stored in an array like so [1,2,1,2,1,2,1,2]. Make it so that player 1 finishes first and then player 2. i.e [1,1,1,1,2,2,2,2]
- ss123 February 11, 2014 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer - 0of 0 votes
AnswersAn array contains the following elements [9,6,-3,1,7] and a value is equal to 4. Find a pair of numbers in the array that equal the sum.
- ss123 February 11, 2014 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer - 0of 0 votes
AnswersHow do you implement stack in stl? What is the complexity?
- sasivara January 30, 2014 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 1of 1 vote
AnswersI have 5 arrays with integer elements. I want to find the common elements in all 5 arrays. What is the logic?c
- sasivara January 30, 2014 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Algorithm - 0of 0 votes
AnswersWhat is smart pointer? How do you implement? What happens with the following: p2 = p1;
- sasivara January 30, 2014 in United States
What happens P3(p1) (copy const)?| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer C++ - 0of 0 votes
AnswersPicture a restaurant kitchen with tickets of customer’s orders which has a start time, end time of when the order was completed, and price. How would you find the longest contiguous time that tickets were processed within a given day?
- Dany December 05, 2013 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Algorithm - 0of 0 votes
AnswersWebsites like Pandora recommend music based on user preferences. What kind of information would you need in such a design?
- tielongs October 31, 2013 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer Intern Data Structures - 2of 2 votes
AnswersGiven an integer, print out all the prime numbers smaller than that integer.
- tielongs October 31, 2013 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer Intern Algorithm - 3of 5 votes
AnswersGiven a binary tree, find out the maximum sum of value from root to each leaf.
- jielei.wang.0316 October 25, 2013 in United Statesfind_Max(Node *root){ if (root==null) return 0; else return max((find_Max(root->left), find_Max(root->right))+root->value; }
| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Application Engineer - 2of 2 votes
AnswersFind the largest k numbers in an enormous array of numbers. You cannot sort the array. Give the run time of the algorithm.
- jielei.wang.0316 October 25, 2013 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Application Engineer Algorithm - 5of 5 votes
AnswersGiven an integer N, print numbers from 1 to N in lexicographic order.
Details: To be implemented without using character conversion (or Strings).
Example:
N = 25
Print:
1
10
11
..
19
2
20
21
..
25
3
4
5
6
7
8
9
A simple solution using Strings (may not be acceptable):
- Abhi October 04, 2013 in United StatesSystem.out.print("\n\tLexicographic Order\n\nEnter an integer: "); Scanner input = new Scanner(System.in); Integer n = input.nextInt(); List<String> list = new ArrayList<String>(); for (int i = 1;i<n;i++){ list.add(""+i); } Collections.sort(list); for (String j: list){ System.out.println(j); }
| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Algorithm - 0of 0 votes
AnswersWhat are virtual constructors and virtual destructors?
- navya910209 September 27, 2013 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Intern General Questions and Comments - 0of 0 votes
AnswersIn code there is a breakpoint at the first line of main function. The program is executed but it crashes without touching the breakpoint. Is there any code that is executed before main itself
- navya910209 September 27, 2013 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Intern General Questions and Comments - -2of 2 votes
AnswersGiven historical data for the stocks of a company for say 8 day. you can buy and sell the stocks just once. Find the maximum profit you can make:
- wacky.auds September 24, 2013 in United States
Day 1 2 3 4 5 6 7 8
5 9 6 2 4 8 3 1| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Application Engineer - 0of 0 votes
AnswersGiven a string 'aabbcdccefff', find the first Non-duplicate character i.e. 'd'
- wacky.auds September 24, 2013 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Application Engineer - 9of 9 votes
AnswersQ: If you have all the companies that are traded, and live inputs are coming of which company is being traded and what is the volume, how do you maintain the data, so that you can carry out operation of giving the top 10 most traded companies by volume of shares most efficiently.
- Aditya April 14, 2013 in United States
A: I juggled between Hash Map and Max Heap. I said Max Heap, since I can take out top 10 companies in a jiffy with a Max Heap. But then he asked you will need to find a company everytime there is a trade, which will take quite some time in Heap. He pointed out that in real world scenario, number of trades happening, and hence searching of the company and updating it, will be many times more than finding top 10. Which bought me to HashMap. Updations can happen in Real time, while finding top 10 can be done in O(n) or O(nlog(n)) time.
Even that wasn't optimal obviously. The interviewer was very nice and friendly type guy. He stressed that at every trade, at most, only 1 company will change in my top 10. This hit me and got me to the correct answer that we keep all actual data in HashMap, but also maintain a MinHeap of 10 most traded company.| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Data Structures - 2of 2 votes
AnswersQ: If I give you a new book, and ask you to create the index which is found at the end of the book, how will you do it.
- Aditya April 14, 2013 in United States
A: I said for constant addition time of words (and page numbers) in the data structure, we can use Hashmap or TRIE. But since output has to be in alphabetic order, we will use a Trie DS, where at the end of each word, we simple store a list of page numbers.| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Data Structures - 2of 2 votes
AnswersQ: The New operator...how does it work, what are the steps?
- Aditya April 14, 2013 in United States
A: I just said it creates a new memory in the heap and the reference points to it. He seemed satisfied.| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Java - 1of 1 vote
AnswersQ: Do you know what is a Binary tree? How would you go about coding for addition of a new element to Binary tree?
- Aditya April 14, 2013 in United States
A: I asked if they want a Binary Tree or a BST? When he said BST I just said we can have a recursive function in which we pass the root of the tree and see if the value to be added is smaller or bigger than the root, and depending on result, we go to left or right of the tree, assuming the left (or right) is not null. If null, just use new to create a memory location, put the value, and use the left reference of the root to link to this new memory. Simple basic stuff.| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Coding