If you are interviewing at bloomberg for a software engineering internship or new grad role, this might really help you.
I recently gave an interview for New grad postion and while preparing I maintained my a list of all the questions that have been previously asked by bloomberg. The following link contains almost all of the interview questions that have beeen asked in bloomberg in the last 2 years and what kind of follow ups they ask.
Link - (removed notion link as I have deleted the page)
About Interviewing at Bloomberg
Always code optimally!!
Telephonic Interview - Previous Interview Questions
Bloomberg interviews mostly include medium questions from Leetcode. The main topics and questions they ask are listed below. In order to start preparing for the interview, the first thing you should understand their interview pattern, and devise a preparation plan.
Easy
- Reverse Linked List - LeetCode
- Binary Tree Paths - LeetCode
- First Unique Character in a String - LeetCode
- Valid Anagram - LeetCode
- Palindrome Number - LeetCode
- Intersection of Two Linked Lists - LeetCode
- Two Sum - LeetCode
- Min Stack - LeetCode
- Valid Parentheses - LeetCode
- Merge Two Sorted Lists - LeetCode
Medium
- Sum of Mutated Array Closest to Target - LeetCode
- Number of Dice Rolls With Target Sum - LeetCode
- Sort Characters By Frequency - LeetCode
- Add Two Numbers II - LeetCode
- Shuffle an Array - LeetCode
- Range Sum Query 2D - Immutable - LeetCode
- Find Minimum in Rotated Sorted Array - LeetCode
- Word Ladder - LeetCode
- Design Browser History - LeetCode
- Vertical Order Traversal of a Binary Tree - LeetCode
- Minesweeper - LeetCode
- Number of Islands - LeetCode
- Find Peak Element - LeetCode
- Binary Tree Level Order Traversal - LeetCode
- Unique Paths - LeetCode
- Coin Change - LeetCode
- Two City Scheduling - LeetCode
- Subsets - LeetCode
- Binary Tree Right Side View - LeetCode
- Insert Delete GetRandom O(1) - LeetCode
- Minimum Remove to Make Valid Parentheses - LeetCode
- LRU Cache - LeetCode
- Decode String - LeetCode
- Flatten a Multilevel Doubly Linked List - LeetCode
- Word Search - LeetCode
- Word Break II - LeetCode
- Longest Substring Without Repeating Characters - LeetCode
- Merge Intervals - LeetCode
- Add Two Numbers - LeetCode
- 3Sum - LeetCode
- Validate Binary Search Tree - LeetCode
- Valid Triangle Number - LeetCode
- Invalid Transactions - LeetCode
- Design Underground System - LeetCode
- Copy List with Random Pointer - LeetCode
- Remove All Adjacent Duplicates in String II - LeetCode
- Word Search - LeetCode
- Reconstruct Itinerary - LeetCode
Hard
- Allocate Mailboxes - LeetCode
- Longest Consecutive Sequence - LeetCode
- Find K-th Smallest Pair Distance - LeetCode
- Zuma Game - LeetCode
- Remove Invalid Parentheses - LeetCode
- Find Median from Data Stream - LeetCode
- Merge k Sorted Lists - LeetCode
- Trapping Rain Water - LeetCode
- LFU Cache - LeetCode
- Interleaving String - LeetCode
Premium
- Number of Ships in a rectangle - LeetCode
- Meeting rooms ii - LeetCode
- Binary Tree vertical Order traversal - LeetCode
- kill process - LeetCode
- Design search Autocomplete system - LeetCode
- Design a Leaderboard - LeetCode
Questions From Past Interview Experiences
Evaluate Division
Array of currency conversion rates. E.g. ['USD', 'GBP', 0.77] which means 1 US is equal to 0.77 GBP an array containing a 'from' currency and a 'to' currency. Given the above parameters, find the conversion rate that maps to the 'from' currency to the 'to' currency. Your return value should be a number
// Example:
You are given the following parameters:
Rates: ['USD', 'JPY', 110] ['US', 'AUD', 1.45] ['JPY', 'GBP', 0.0070]
To/From currency: ['GBP', 'AUD']
Output: 1.89First Unique Number in the data stream
Design a data strucutre with the following interfaces to find the first unique number in a datastream.
public class Stream {
public Stream() {
// do intialization if necessary
}
/**
* Adds integer num to a stream of integers.
*/
public void add(int num) {
// write your code here
}
/**
* Returns the first unique integer in the stream if found else return null.
*/
public Integer getFirstUnique() {
// write your code here
}
}Stock Ticking (similar to Leaderboard)
Implement the following two functions such that they are optimal. addStocksVolume receives a symbol (INTC, APPL, etc) plus a volume which you cumulate over time. topKstocks would return the k stocks with the highest volume.
void addStocksVolume(string stockSymbol, int volume) {
}
vector<string> topKstocks(int k) {
// return k top stocks
}Stock Exchange System
Given a list of operation hour for each stock exchange, validate if the customer can send a trading order during the input hour. The interviewee asked me(the author) to list all possible solutions that I got and explain the time and space complexity of each solution. Also, he asked me to describe the advantages and disadvantages of each one.
// Example
Operation hours
09:00-16:00 Royal Bank of Scotland
11:00-17:00 Morgan Stanley
Test case #1 - expected result: SUCCESS
10:00-17:00
Test case #2 - expected result: FAILURE
15:00-21:00Intersection of arrays
Given two arrays, return the intersection of two lists. (both cases - when sorted and when not)
// Example
A = [1, 2, 3, 4]
B = [2, 4, 6]
Result - [2, 4]Given a list return the two lists having elements from same group
Given List and a function (take 2 params, returns if 2 are of same group) - return list of lists that belong to same group.
bool sameGroup(int a, int b) {
// returns true if the elements are of same group else false.
}Elements in first but not in Second
Return the strings having characters that are not present in another string
// example
string a - "abcd"
string b - "ab"
ans - "cd"Similar - Break a long list into 2 smaller lists, 1st smaller list has all elements that are smaller than the elements in 2nd list.
Depth of a String
find string at highest depth.
//example
input: "((AB)(((CD))))"
output: depth: 4 and string: "CD"Check if array is sorted or not
Given an array return whether the array is sorted or not (boolean).
true-> Ascending or Descendingtrue-> if all are sametrue-> if just one element- else
false
Sort Tree by children
Sort tree by its childrens and return root, here N=total no of nodes and m is avg no of children
// Example
World
/ | \\
/ | \\
C A B
/ | | /|\\
/ | | / | \\
E D F H G I
to
World
/ | \\
/ | \\
A B C
| /|\\ |\\
| / | \\ | \\
F G H I D EReturn Sorted Array
Given an array sorted by its absolute values, return sorted array by it actually values - Solve in O(N)
// example
input: 0,-1, 2, -4,5, 6, -10, -13, -22
output: -22, -13, -10, -4, -1,0, 2, 5, 6Maximum paths in N steps
Given 2d matrix, find maximum path sum in given N steps only
// example
2, 3, 4, 6
1, 2, 3 ,5
3, 4, x ,5
0, 1, 2, 3
N = 2
starting cordinate = (2,2)
N = 2
Output: 10 (5->5)TV Show
A TV show is "addictive" if the viewers quickly become addicted to the show and eventually finish watching the show. It can be tracked after viewing how many episodes of a show at least 70% of the viewers who watched that continued on to finish the show entirely. In other words, more that 70% of the viewers who watched the first x eposides of a show continued on to finish the entire show. The x is what we are looking for.
Assumptions:
- All shows have 10 episodes
- viewers always start from the first episode (no skipping).
Given a log of entries consisting of a user id, the show name and the episode number that was watched, produce the x for each show.
// example
Input: The following function is called for each log entry
void process_log(string show, int episode, int user_id)
Expected Output:
void print_results();Delete Array in Range
Remove ints from an array from given ranges.
Example:
Input: array = [-8, 3, -5, 1, 51, 56, 0, -5, 29, 43, 78, 75, 32, 76, 73, 76],
ranges = [[5, 8], [10, 13], [3, 6], [20, 25]]
Output: [-8, 3, -5, 29, 43, 76, 73, 76]Reorder Array
Consider a vector of employees with a name and their title: <John, Manager>. And a dictionary where the keys report to the values: [CTO, CEO]. Re-order the vector of employees according to the dictionary mappings. The vector of employees can be extremely big, however the dictionary only contains the title orderings.
vector : [<John, Manager>, <Sally, CTO>, <Sam, CEO>, <Drax, Engineer>, <Bob, CFO>, <Daniel, Engineer>]
dict: {[CTO, CEO], [Manager, CTO], [Engineer, Manager], [CFO, CEO]}
output:
[<Drax, Engineer>, <Daniel, Engineer>, <John, Manager>, <Sally, CTO>, <Bob, CFO>, <Sam, CEO>]
Generate Number
Genereate Number with two operations in min steps. Given an int n. You can use only 2 operations:
- multiply by 2
- integer division by 3 (e.g. 10 / 3 = 3)
Find the minimum number of steps required to generate n from 1.
// Example
Input: 10
Output: 6
Explanation: 1 * 2 * 2 * 2 * 2 / 3 * 2
6 steps required, as we have used 5 multiplications by 2, and one division by 3.
Electronic Exchange
You work in an electronic exchange. Throughout the day, you receive ticks (trading data) which consists of product name and its traded volume of stocks. Eg: {name: vodafone, volume: 20}. What data structure will you maintain if:
- You have to tell top k products traded by volume at end of day.
- You have to tell top k products traded by volume throughout the day.
Reorder Packets
There is a continous stream of data in the form of (1, "abcd"). Write a program to output the data from the stream in realtime in order, so 1,2,3,4,5. You cannot queue up the incoming data from the stream.
Input: (1, "abcd"), (2, "efgh"), (4, "mnop"), (5, "qrst"), (3, "ijkl")
So for example if the first incoming bit of data is (1, "abcd"), and the second is (4, "mnop"), you cannot output (4, "mnop") until you get 2, 3.Related Questions
- Largest Rectangle in Histogram - LeetCode
- Compare Strings by Frequency of the Smallest Character - LeetCode
- String Compression II - LeetCode
- Number of Atoms - LeetCode
- Brace Expansion - LeetCode
- Flatten Binary Tree to Linked List - LeetCode
- https://leetcode.com/problems/correct-a-binary-tree/ - locked
- Evaluate Division - LeetCode
- Populating Next Right Pointers in Each Node - LeetCode
- Minimum Index Sum of Two Lists - LeetCode
More
- Why Bloomberg?
- OOP Questions
- About Projects
- Discuss the difference between Python, Java, and Javascript
- Implement a vector in C++ (use dynamic array approach)
- Occurence sort: given a string sort the string based on the number of times a letter appears in the string from most occurring to least occurring. For letters having the same occurrence sort based on lexicographical order
- External Sort (Big files) - diff with ram constraints
- Iterative and Recursive BS
- Definition of a Binary Search Tree followed by a coding question on finding the kth largest element in a binary search tree
- Design
- Design data structure and algorithm for an ipod with play(),pause(),next(),previous(),shuffle(),addSong(),deleteSong()
- Design a system that allow users to retrieve stock info as fast as possible.
- Design a OOP class
- Design Phonebook
- Design Graph with addRoute,printRoutes
- Design AWS S3
- Design Traffic light system.
- Design Browser History
- Design Autocomplete you send a prefix "a", this should return "abc", "abd".
- General CS
- Time complexity
- Code refractoring
- Database and linux
- Object Oriented Design a lot
- API + DB design + limitations
- Project Architecture
- Behaviourial
- Why Bloomberg?
- Top 3 things you are looking for in companies?
- Resume + behavioral questions + the design of a project that I worked on.
Please feel free to Copy/Add/update anything. or If you know any questions that are not on the list and have been asked in Bloomberg, please comment so that i can update it.


