Bloomberg LP Interview Questions
- 1of 1 vote
AnswersFind the two elements that have the smallest difference in a given array.
- si October 23, 2019 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer Intern Arrays - -1of 1 vote
AnswersWrite an iterator class to traverse the tree
- si October 23, 2019 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer Intern Trees and Graphs - -1of 1 vote
AnswersHow to traverse a tree?
- si October 23, 2019 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer Intern Trees and Graphs - 1of 1 vote
AnswerPrint an unbalanced binary tree in level order with new lines after each level.
- CoderDude7 June 17, 2019 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Python Developer Algorithm - 0of 0 votes
AnswersSay 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.
- CoderDude7 June 17, 2019 in United States
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.| Report Duplicate | Flag | PURGE
Bloomberg LP Python Developer Algorithm - 0of 0 votes
AnswersImplement singleton pattern
- reshma.dhotre November 30, 2018 in India
All types of containers, datastrutures, there differences, Project details, C++ concepts| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer - 0of 0 votes
AnswersImplement phone book <unique name, number>
- reshma.dhotre November 30, 2018 in India
1.Sorted phone book
2.searching based on name
3Searching based on number. What are the data strutures required| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer Data Structures - 0of 0 votes
Answer#include <iostream>
- reshma.dhotre November 30, 2018 in India
using namespace std;
int main()
{
int a = 32, *ptr = &a;
char ch = 'A', &cho = ch;
cho += a;
*ptr += ch;
cout << a << ", " << ch << endl;
return 0
}| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer C++ - 0of 0 votes
Answercode Bubble sort, and modify it to return if the array is already sorted.
- reshma.dhotre November 30, 2018 in India
2.If single swap is needed perform and break without going through o(n2) looping| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer Algorithm - 0of 0 votes
Answers1. Input string s. Check if string s is a valid string with valid brackets
- donkeysnore November 05, 2018 in United States
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.| Report Duplicate | Flag | PURGE
Bloomberg LP Intern Algorithm - 0of 0 votes
AnswersIf you had n racers and m checkpoints, how would you list out the racers in the order in which they are in the race given that each checkpoint gets a notification when a specific racer crosses it?
- AnonyMous October 11, 2018 in United States
Your code should run in O(1).
Note: Players cannot cheat, i.e. they cannot miss a checkpoint
Example:
Assume 5 checkpoints(C1, C2, C3, C4, C5) and 10 racers(P1, P2,...P10).
Now once the race begins, lets say P2 first crosses C1. So the current race order is P2.
Now P1, P3, P4 cross C1; so the race order is P2, P1, P3, P4.
Now P1, crosses C2; so the race order becomes P1, P2, P3, P4
Now P3, crosses C2; so the race order becomes P1, P3, P2, P4
Now P5, crosses C1; so the race order becomes P1, P3, P2, P4, P5
Now P1 crosses C3; so the race order remains P1, P3, P2, P4, P5
and so on.
Assume that you get notified of players crossing a checkpoint by a function update(player name, checkpoint). Your task is to show the players in order in O(1) i.e return a vector of players in-order in O(1)| Report Duplicate | Flag | PURGE
Bloomberg LP SDE1 Data Structures - 0of 0 votes
AnswersA 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?
- nishug001 September 22, 2018 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer Algorithm - 0of 0 votes
AnswersRemove 3 or more consecutive characters from a string, repeat until there are no more.
- kqiann August 17, 2018 in United States
eg.
ABCCCCBBA => ABBBA => AA| Report Duplicate | Flag | PURGE
Bloomberg LP SDE1 String Manipulation - 0of 0 votes
AnswerGiven two positive integers represented as linked lists, provide the sum of the numbers as a linked list.
- anonymous March 14, 2018 in United States1->2->3 4->5->6 ----------- 5->7->9 1->2->3 4->5 ----------- 1->6->8 4->5->6 7->8->9 ----------- 1->2->4->5
| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersA company's organizational structure is represented as
- JustYourAverageDev July 14, 2017 in United States
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| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer Coding - 0of 0 votes
Answersproducer consumer problem
- peddiz June 19, 2017 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer - 0of 0 votes
AnswersDefine a singleton class
- peddiz June 19, 2017 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer - 0of 0 votes
AnswersYou 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.
- sonesh May 08, 2017 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer Algorithm Coding - 0of 0 votes
Answers1) write a concurrent singleton class.
- sonesh May 08, 2017 in United States
2) Write a factory method class, and how it is used
3) Define a sealed class.
4) What if we want to replace sealed class with another class and use this new class where ever we have used our sealed class, how do you do that.
5) What would you look in a code review?
6) Do you know about adapters, bridges design pattern
7) Define async await method, how do we read data in task library
8) What are the other methods of making your call multi-threaded
9) Do you know Linq queries
10) How to make defer/no defer execution in Linq Queries.
11) Where do you use singleton class, give at least three examples
12) When we use singleton class and when static, both have the single instance.| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer design - 0of 0 votes
AnswersYou 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.
- sonesh May 08, 2017 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Algorithm - 0of 0 votes
AnswersYou 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.
- sonesh May 08, 2017 in United States
Ex:
abbba
ab
ba
abcd
abdc
adbc
aabddc
output:
ab: 3
abcd: 4| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Algorithm - 0of 0 votes
AnswersYou are given three type of data sets.
- sonesh May 08, 2017 in United States
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?| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Data Structures - 0of 0 votes
AnswersImplement pow(x, n)
- alisonlee659 May 03, 2017 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer Algorithm - 1of 1 vote
AnswersPick three numbers a, b, c from an array of integers to get the maximum product a * b * c.
- alisonlee659 May 03, 2017 in United States
Began with the O(N^3) solution. Then the interviewer give clues on optimization by sorting the array.| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer Algorithm - 0of 0 votes
AnswersQ1. 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))
- sonesh April 13, 2017 in United States
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))| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Trees and Graphs - 1of 1 vote
AnswersYou are given a vector of integers. You have to delete the odd numbers from it.
- sonesh April 13, 2017 in United States
Expected complexity is O(N) Time and O(1) space| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Arrays - 0of 0 votes
AnswersOne question containing multiple questions
- sonesh April 07, 2017 in United States
1) Define the structure of a function which takes an array of size n as input and returns True or False.
2) Write a function which takes an array as input and returns a string containing all the elements separated by a comma.
Ex : [0, -45, 9, 10] => "0,-45,9,10";
3) Write a function which takes two arrays ass input, and returns minimum common element in them.
Ex : [0, -90, 45, 10, 4], [4, 8, 90, 45] => 4
4) Now let's say, the function takes an array of arrays, and each array is sorted. now, returns their first common element.
Ex : [0, -90, 45, 10, 4], [4, 8, 90, 45], [-1, -3, -5, -7, 10, 4], [24, 35, 78, -90, 56, 4] => 4| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Arrays - 1of 1 vote
AnswersYou are given an array of integers both negative and positive.
- sonesh April 07, 2017 in United States
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)
Thanks velu007 for pointing out the mistake| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Algorithm - 1of 1 vote
AnswersDefine a graph using Adjacency list where node and graphs are different entities, for example, Node is a struct/class and graph is set of nodes.
- sonesh April 07, 2017 in United States
The graph is an acyclic directed graph(may be a forest not necessarily connected).
Write an assignment copy constructor for this graph.
Please note that the copy constructor should create a new copy of the graph, including all its edges and vertices. Interviewer called this deep copy.| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Graphics