Bloomberg LP Interview Questions
- 1of 1 vote
AnswersGiven a list of URLs entered by a user write a program to print unique and most recently used URLs. For example if user entered the following: -
- ik.yola March 25, 2017 in United States
1. google.com
2. yahoo.com
3. wsj.com
4. google.com
The output should be :-
1. google.com
2. wsj.com
3.yahoo.com| Report Duplicate | Flag | PURGE
Bloomberg LP Software Analyst Algorithm - 1of 1 vote
AnswersCalculate and replace repeated characters in a string with their number of occurrences.
- krietallo January 24, 2017 in United States for London
Example :
aaaggbbbbc
3a2g4b1c| Report Duplicate | Flag | PURGE
Bloomberg LP Intern Algorithm - 1of 1 vote
AnswersSort elements by frequency, print the elements of an array in the decreasing frequency if 2 numbers have same frequency then print the one which came first.
- krietallo January 24, 2017 in United Kingdom for London| Report Duplicate | Flag | PURGE
Bloomberg LP Intern Algorithm - 2of 2 votes
AnswersGiven points on a plane like (0,0), (1,0), (0,1), (1,1), (0,2), (2,2), (1,2). How many rectangles can be formed ?
- solveIt December 26, 2016 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Algorithm - 0of 0 votes
AnswersI was asked to design a stock ticker system. Stock ticker is simply the shortened name of company and its current stock size. e.g. for Apple - "AAPL" -> "115"
- 256.cool December 14, 2016 in United States
He asked me to design a data structure to store incoming stream of stock tickers. Stream can contain same company more than once but all the values of it had to be stored. I used HashMap<String, List<Integer>>. Then he was adding more functionalities to system I don't exactly remember the questions now but one of them was related to calculating some ratio in constant time. Some of the questions were challenging.| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer System Design - 0of 0 votes
AnswersGiven a set find its power set. (This question is from CTCI) Interviewer then discussed the complexity of my solution. He asked me to explain him how the complexity is 2^n? As per my solution, I was iterating over an arraylist which contained the set elements so the size of list was getting doubled in every iteration. Hence the complexity (2^0 + 2^1 + 2^2 +.....+2^n-1 = 2^n)
- 256.cool December 14, 2016 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven a string, add some characters to the from of it so that it becomes a palindrome. E.g.1) If input is "abc" then "bcabc" should be returned. 2) input -> "ab" output -> "bab" 3) input -> "a" output -> "a"
- 256.cool December 14, 2016 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Algorithm - 0of 0 votes
AnswersYou are given a binary tree. Each node in the tree is a house and the value of node is the cash present in the house. A thief can rob houses in alternate levels only. If thief decides to rob house at level 0 then he can rob houses in levels 2,4,6... or he can rob houses in levels 1,3,5,7...Find out the maximum possible amount thief can rob.
- 256.cool December 14, 2016 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Trees and Graphs - 0of 2 votes
AnswersHey guys, I was asked this question on Bloomberg's pre-interview screening exam and I was wondering how to go about it.
- it_tech_guy October 11, 2016 in United States
Find the tightest asymptotic bound for:
T(n) = n(T(n/2)^2)
so far I was able to get it to look like this (not sure if correct):
T(n) = 1 / (1 + T(n/2)^2)
From then I made a recursion tree which led me to think that T(n) might be exponential in this case. Do you have any idea where could I go from here? Do you think this has no tight asymptotic bound?| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Algorithm - 0of 2 votes
AnswersReturns the zero based index of the first occurrence of any character of str2 in str1
- tikolo September 06, 2016 in United States
Input:
str1="adf6ysh"
str2="123678"
output: 3
I have solved this by taking second string in hashset and then iterating first string one by one but i need more optimized way.| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer Algorithm - 5of 5 votes
Answers* Given an unsorted integer array, place all zeros to the end of the array without changing the sequence of non-zero
- haldokan August 12, 2016 in United States
* elements. (i.e. [1,3,0,8,12, 0, 4, 0,7] --> [1,3,8,12,4,7,0,0,0])| Report Duplicate | Flag | PURGE
Bloomberg LP Developer Program Engineer Algorithm - 0of 0 votes
Answers* Implement a tick server the has multiple clients interested in different tickers. Clients have Plotters that are updated
- haldokan August 12, 2016 in United States
* in real-time with the top 10 tickers that have the most price updates on the top. What data structure would you choose
* for the server and client plotters?| Report Duplicate | Flag | PURGE
Bloomberg LP Developer Program Engineer Algorithm - 0of 0 votes
Answers* Royal titles consist of name followed by space and a Roman numeral. Example: Richard IV. The Roman numeral in the title
- haldokan August 12, 2016 in United States
* can go to L (50). You are given the roman numerals from 1 to 10:
* I II III IV V VI VII VIII IX X. And you are given the 10 multiples up to 50: XX XXX IL L. Numbers between 10 and 50 that
* are not given can be formed from 10 multiples and a numeral b/w 1 and 9. Example: 48 is XLVIII wichi is XL (40) plus
* VIII (8).
* <p>
* You are given an array of Roman titles sort it as follows: sort it on the name unless the names are equal, in which
* case you have to sort it on the ordinal of the numerals.
* Examples:
* Henry II, Edward VIII => Eward VII, Henry II
* Richard V, Richard II, Richard X => Richard II, Richard V, Richard X| Report Duplicate | Flag | PURGE
Bloomberg LP Developer Program Engineer Algorithm - 0of 0 votes
AnswersFind out the output. Or Correct it if something is wrong.
#include <iostream> #include<typeinfo> using namespace std; class base{ public: int a; base():a(0) {} int getA(){return a;} }; class der:public base { public: int b; der():b(1) {} int getB(){return b;} }; void display(base *obj, int ele) { for(int i = 0; i < ele; i++) { cout << (obj+i)->getA() <<endl; } } int main() { int i = 3; base arrb[i]; display(arrb, 3); der arrd[i]; display(arrd, 3); return 0; }
The output is looking like
0 0 0 0 1 0
To me the output should be
0,0,0,0,0,0 //6 0's
But, how come
1
is coming in?
- rasmiranjanbabu July 12, 2016 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Analyst C++ - 0of 0 votes
AnswersGiven a string find biggest palindrome substring. For example for given string "AABCDCBA" output should be "ABCDCBA" and for given string "DEFABCBAYT" output should be "ABCBA".
- Preeti May 24, 2016 in United Kingdom| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Algorithm - 0of 0 votes
AnswersTHERE ARE SEVERAL LOG FILES COMING BY DATE WITH PRODUCT IDS AND I NEED TO REPORT THE TOP 10 (PRODUCT IDS) DURING A MOVING PERIOD OF 1 MONTH. DISCUSSED ABOUT THE DATA STRUCTURES NEEDED TO IMPLEMENT THE SOLUTION.
- bhardwaj.cs February 23, 2016 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersSSUME YOU HAVE A LARGE FILE WITH LINES OF TIMESTAMPS AND IP ADDRESSES . TIMESTAMPS ARE ORDERED, BUT MAY REPEAT AND MAY SKIP. HOW DO YOU DETERMINE WHETHER
- bhardwaj.cs February 23, 2016 in United States
THERE IS A TIME WINDOW THAT HAS A CERTAIN IP ADDRESS APPEARING MORE THAN K TIMES? HOW WOULD YOU SOLVE THIS IF INSTEAD YOU RECEIVED A STREAM.| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer Algorithm - 1of 1 vote
AnswersImage an airport with the control tower having a constantly rotating radar scanning for airplanes. The radar's coordinates in the 2-d plane are (0,0). The radar has an API: void scan(const Plane &P) that is called periodically whenever the radar detects a plane. You can imagine that the Plane structure has x,y coordinates for that plane. You should fill in the function Scan, such that at any given time you are able to return the 100 closest planes to the tower (0,0).
- Johnybegood December 24, 2015 in United States for Derivatives| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Algorithm - 0of 0 votes
AnswersFind summation of n records added in past 60 secs
Items of the typestruct { int i; time_t timestamp; }
needs to be stored in a C++ container. One of the requirement is to calculate summation of 'i' s of these items added in past 60secs.
- northernlight November 24, 2015 in United States
What container/datastructure will you use. (number of items can be in the order of 10s of thousands.| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Application Engineer Algorithm - 1of 3 votes
AnswersGiven an array A = [3, 7, 2,5,6,4] for a number N, print the pairs from that array A that sums up to N. You should print each pair once.
- nonameno October 29, 2015 in England| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer Intern - 0of 0 votes
AnswersGiven an array A [0, 1, 3, 4,9,5,7,6] and number N.
- nonameno October 29, 2015 in England
This means that the array consists of the numbers from 0 ... N. However, as you see, 8 is missing in A. Print the missing number.
Think about the case N = 10^6| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer Intern Algorithm - 0of 0 votes
AnswersHow do you decide whether we should use Java or C++ for a particular project . what are pros and cons
- chad August 01, 2015 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP SDE-2 Java - 0of 0 votes
AnswerHow does garbage collector work ? In mark and sweep , how does gc know which objects it needs to mark , how are references stored for objects for gc to understand that its reference is null or it is no more referenced anywhere j
- chad August 01, 2015 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP SDE-2 Java - 0of 0 votes
AnswersImplement hashtable put function in C++ without using STL stuff.
- kustiki July 21, 2015 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Developer - 0of 0 votes
AnswersA client wants to build a software phone book that contains everyone in the world (7 billion people). Every person has only the first name and the name is unique. What data structure would you use to store the data?
- rv July 14, 2015 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Algorithm Data Structures - 0of 0 votes
AnswersGiven a MxN grid, like :
111 111 111 or 001 111 001
Write a function to return all possible paths from start (0,0) to destination (M-1,N-1). Allowed moves: right, down, and diagonal down. Value 1 indicates moves is possible, 0 indicates move not possible.
- rv July 14, 2015 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Algorithm - 0of 0 votes
AnswersGiven a BST write a function that looks for a value.
- rv July 14, 2015 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Algorithm C++ Data Structures - 2of 2 votes
AnswersThere's a function that concatenates two strings and returns the length of the resultant string. When called upon a series of strings how do we minimize the cost of using this function. Let's say we have 3 strings, A= "abc", B="def", C = "gh".
- Spectral July 07, 2015 in United States
Now cost of merging AB = 6 and cost of merging the resultant string with C is 8. Thus the total cost is 6 + 8 = 14. However, if we merge A and C, then the cost is 5 and then merge B with this, the cost is 8, so the total cost is 13.
Find an algorithm that minimizes the cost of adding such a series of strings.| Report Duplicate | Flag | PURGE
Bloomberg LP SDET Algorithm - 0of 0 votes
AnswersYou have a function f1() that generates 0 or 1 with the equal probability. Write a function f29() that generates a number between 0 and 29 with equal probability.
- azaad2004 June 29, 2015 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer Algorithm - 0of 0 votes
AnswersMake use of an example to depict Singleton pattern. How would you make sure it works in Multithreaded environment.
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Algorithm Threads