User raptor16 from leetcode compiled the following list of Bloomberg’s phone interview questions (original can be found here):
Monday¶
- Diameter of Binary Tree
- Number of Islands
- Two Sum
- Given a string print all subsets (not permutations)
- Two City Scheduling
-
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.
-
Insert Delete GetRandom o(1)
Design a data structure with requirements: You have a
structured input data for all objects Where you have Insert : O(1) Lookup : O(1) Delete : O(1) You can traverse the added elements in the order they were inserted.
Similar to https://leetcode.com/problems/insert-delete-getrandom-o1/
-
Given a string of parentheses: s = “()(()()()()())” Remove the minimum amount of parentheses to make the string parentheses balanced in-place
Wednesday¶
-
Palindrome Number Optimize from O(N) to O(log N) time complexity.
-
Output data from a stream in order
Input: (1, “abcd”), (2, “efgh”), (4, “mnop”), (5, “qrst”), (3, “ijkl”)
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. 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.
-
Find the minimum steps to generate a number given only two operations (BFS)
-
https://leetcode.com/discuss/interview-question/329221/Bloomberg-or-Phone-screen-or-Software-Development-Internship-2019
-
Reorder array based on dictionary Similar to Reconstruct Itinerary
Saturday¶
-
Right side view and Word Search: This is the question I (the author) got on my phone interview today. Nov 10 2019. I got 2 Leetcode medium questions with 5 minutes for questions and 5 minute for introductions, leaving 35 minutes for the coding portion. We discussed my past experience and he probled in deeper to see if I did have a good understanding of the tech stack that was used by my previous internship.
- LC Medium: Right side view of a binary tree They expected this code to compile and be tested out to be completely bug free, so you need to write the test cases yourself.
- LC Medium: Word Search I The interviewer did not expect this code to compile, so long as the general idea is correct you are good. You are expected to manually run through your code using their example.
More under the interview experience section of leetcode
Why Bloomberg OOP Questions Discuss the difference between Python, Java, and Javascript LC: Intersection of two linked list x2 Check if two linked lists intersect and return the intersecting point LC: Candy Crush LC: Merge Intervals LC: Add two numbers LC: Interleaving strings Implement a vector in C++ (use dynamic array approach) LC: Insert delete getrandom o(1) 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 LC: Trapping rain water LC Two sum Iterative and Recursive BS LC 3Sum Onsite (ignore for now) Definition of a Binary Search Tree followed by a coding question on finding the kth largest element in a binary search tree