I compiled a lists on a document for Bloomberg's phone interview questions that I got here from Leetcode - mainly for tracking my progress, but this may be useful to some of you.
1. Given a string print all subsets (not permutations)
Eg. String "abc" should output
empty string
a
b
c
ab
bc
ac
abc3. 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.4. Insert Delete GetRandom o(1)
Design a data structure with requirements:
You have a <Key, Value> 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-place7. LRU Cache
10.
11. 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.12. Find the minimum steps to generate a number given only two operations (BFS)
14. Reorder array based on dictionary
Similar to Reconstruct Itinerary
15.
16. Longest Substring without repeating characters
17. File Diffs with RAM Constraints
18. Remove array elements in given index ranges
19 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.
(1) 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.
(2) 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