⏱ 0:01est. 12 min
Bloomberg
// https://www.glassdoor.sg/Interview/Bloomberg-L-P-Front-End-Web-Developer-Interview-Questions-EI_IE3096.0,13_KO14,37.htm?countryRedirect=true
// https://www.glassdoor.sg/Interview/Bloomberg-L-P-Senior-Software-Engineer-Interview-Questions-EI_IE3096.0,13_KO14,38.htm
//Q What is a JavaScript callback function?
// A callback function is a piece of JavaScript code that executes after the main function that the callback is attached to executes successfully.
//Q Given a DIV box of x width and y height in a browser how do you position four smaller images in each corner of the box?
// Position the DIV box relative. Have the other four child DIV boxes inside that positioned absolute. Then position .box1{ top:0; left: 0; position: absolute;}
// .box2{ top:0; right: 0; position: absolute;}
// .box3{ bottom:0; left: 0; position: absolute;}
// .box4{ bottom:0; right: 0; position: absolute;}
//Q What happens when you click on the URL.
// split URL by fragment, host, etc -> (DNS->IP) -> HTTP GET request -> wait for response status....etc
// Q
// The first two interviews are technical, a system design question and a coding question.
// If you do well in those two rounds, you're invited back after lunch to meet with the hiring manager and HR for some additional rounds.
// The technical portions were straightforward and all on LeetCode (easy/medium).
//Q Remove element from linked list with matching value?
//Q Pick k elements from list which sums to a number provided?
//Q Determine if two BSTs are equal.
//Q Calculate how much income tax a person would need to pay for the year.
//Q Design and implement a way to split payments across a collection of bonds which had balances. The split is determined by payment rules such as prorata or sequential and rules could be nested in one another.
//Q Design and implement a 401k savings calculator which returns the balance given the number of years, interest, and contribution amount as parameters.
//Q Onsite: Matrix multiplication
//Q BST, LinkedList
//Q Coderpad - 1 Leetcode easy and 1 leetcode medium.
// Round 1-
// Interviewer 1 :1 LC easy + follow up to create a package of this solution.
// Interviewer 2: 1 LC medium (asked to code in python, my choice was java for all questions).
// Round 2 -
// Interviewer 1: 1 LC medium
// Interviewer 2: 1 LC medium (only discussion, no time to finish).
// Two rounds with two members each,
// Most questions were on computer science fundamentals such as trees, hashing, sorting etc.
//Q Sorting and system design
//Q Print tree level by level
// Do company tagged leetcode questions.
// https://leetcode.com/discuss/interview-question/439548/Bloomberg-Phone-Interview-Questions
// https://leetcode.com/problems/design-browser-history/
// Hacker rank
// coding test on hackerrank. given a matrix with 0 and 1. find paths of 1 from one corner of matrix to another
// DFS from any node == 1, mark them as any letter like "P", time complexity would be exponential
// It was a problem related to finding the missing number in an array, which was then further constrained two times.
// IMPT Hackerrank questions:
Design of a regular expression parser to match the repeating characters and algorithm based on binary search.
Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers which has the largest sum.
https://goodtecher.com/tag/bloomberg-interview-question/
a) Find longest substring with unique characters in O(n) time.
b) Find all nodes matching a given value in a Tree.
// Onsite round 1
a) How do you implement hashCode of a long value?
b) Find all prime numbers in a range(say all prime numbers from 1 to 100).
// Onsite round 2
a) Sort a collection using a calculated attribute(fairly simple calculation on find frequency of occurrence of a word in an array). Then change it to find top K elements using a heap and provide the time compexity.
b) Design a file processing system that can handle large number of files and extract and aggregate data from them.
Given a list of direct airport connections, print all possible paths between two airports.
// https://www.geeksforgeeks.org/bloomberg-interview-experience-for-internship-2021-london/
1. Given a string, find its first non-repeating character
2. Check for balanced parentheses in Python
// https://www.careercup.com/page?pid=bloomberg-lp-interview-questions
1. Find the two elements that have the smallest difference in a given array.
2. Write an iterator class to traverse the tree
3. How to traverse a tree?
4. Print an unbalanced binary tree in level order with new lines after each level.
5. Say you have two large files (100 TB each) and only 1 MB of RAM. What's an efficient algorithm that will print the missing lines (diff)? The files don't necessarily contain duplicates.
The two files are not sorted and could have different ordering in both files.
e.g.:
File1 File2
A B
B A
C C
D E
F D
F
Output:
File 2: E
The input are two large files (containing strings).
The output is a list of strings telling you the presence of a line in File X and not in File Y.
6.* Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers which has the largest sum.
7. Implement singleton pattern
All types of containers, datastrutures, there differences, Project details, C++ concepts
8. Implement phone book <unique name, number>
1.Sorted phone book
2.searching based on name
3Searching based on number. What are the data strutures required
9. code Bubble sort, and modify it to return if the array is already sorted.
2.If single swap is needed perform and break without going through o(n2) looping
10. 1. Input string s. Check if string s is a valid string with valid brackets
For example:
(({{}})) is a valid s
{[]} is a valid s
[{[}]] is not valid
2. What kind of tests would you conduct to your program to minimize bugs in your program.
3. On the previous example there is only "()", "{}", and "[]" combination of brackets. If other developers want to add a new kind of brackets such as "<>". What kind of changes would change in your previous program.
11.* A company wants to fly in a total of 100 candidates for the interview. The company has two office location, one in NY and other in SF and max capacity at each location is 50 candidates. You are given the cost it incurs to fly in each candidate to NY and SF.
[500, 300],[540, 600],[550, 600],[300, 50]..so on
Write an algorithm for the minimum total cost?
12. Remove 3 or more consecutive characters from a string, repeat until there are no more.
eg. ABCCCCBBA => ABBBA => AA
13. A company's organizational structure is represented as
1: 2, 3, 4
In the above employees with id 2, 3 and 4 report to 1
Assume the following hierarchy.
1: 2, 3, 4
3: 5, 6, 7
5: 8, 9, 10
Given an employee Id, return all the employees reporting to him directly or indirectly
14. You are given an array of values, (not necessary integers or positives) and a value. You have to print all the pairs whose sum is given value. Write a general method which can accept integers, float, doubles, long, or any other thing where this make sense.
15. You are given an array of stock prices, You have to return maximum profit one can make when buying once and selling once. Consider, you are buying one stock only.
16. You are given set of strings, you have to print out the could of each distinct patterns. Please consider anagrams as same pattern and even the char count does not matter.
Ex:
abbba
ab
ba
abcd
abdc
adbc
aabddc
output:
ab: 3
abcd: 4
17. You are given three type of data sets.
Type 1
Data size: 4 billion
Distinct Data: 1000
Type 2
Data Size: 4 billion
Distinct Data: 2 billion
Type 3
Data Size: 1000
Each Data is of length 100 million byte
What kind of data structure would you use to answer search/insert/remove queries for each data types?
(Merkle tree a.k.a hash tree)
18. Implement pow(x, n)
19. You are given an array of integers both negative and positive.
Print the maximum continuous sum of the array and if all the elements are negative, print the smallest of them.
Ex : [-20, -5, -2, -9] :> -2(-2)
Ex : [20, -19, 6, 9, 4] :-> 20(20)
Ex : [10, -3, 4, -2, -1, 10] -> 18 (10, -3, 4, -2, -1, 10)
20. You are given a vector of integers. You have to delete the odd numbers from it.
Expected complexity is O(N) Time and O(1) space
21. Q1. You are given a binary search tree (with unique values) and two values. You need to find their lowest common ancestor. (Expected Complexity O(log(n)) + O(1))
Q2. Now let's assume the tree has duplicates, and when a duplicate number come, the insertion logic chooses left node. (Expected Complexity O(log(n)) + O(1))
Q3.Now let's assume the input tree is a binary tree instead of the binary search tree.(Expected Complexity O(n) + O(1))
// https://www.careercup.com/page?pid=bloomberg-lp-interview-questions
// Bloomberg | Phone | Number of ways to purchase oil
// https://leetcode.com/discuss/interview-question/550259/bloomberg-phone-interview-se-grad-2020
Question:
'm' amount of oil can be purchased from 'n' companies. Every company has 'k' capacity of oil to be sold, you can take zero or many times the quantity offered by each company. Give the maximum number of combinations possible.
For examples:
There are three companies: A, B, C
A - 10
B - 15
C - 50
Target: 60
Number of Combinations: 4 {[10,50], [15,45], [20,40],[10,20,30]
I was able solve the question by priting all combination but my count was not updating, I was debugging the code but he told he didn't know java at all so we can move on. I thought I would get through, but they rejected me.
I hope this expereince might be useful for you!
Approach, I took:
I have generated multiples of all quantities in a list till the target amount. Then generated all possible subsets and for every subset, I was calculating sum of all elements in the subset. Later, compared sum with target, I have incremented count.
https://raihassen.github.io/