Bloomberg LP Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
0
of 0 vote

Is this a direct interview or did you give any test before it

- Newbie December 09, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
2
of 2 votes

For question #6,
the best way is to copy the data from the next node to the 5th node and delete the 6th node. In case if we are given the last node to delete then mark it as a dummy.

- sreekar.m December 10, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

for #1 1st part
use

#ifdef cplusplus
 extern "C"{ 
#endif

/*your C code*/

#ifdef cplusplus
 }
#endif

- shoonya.mohit December 10, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

To call C++ library function in C
extern "C++"{
//cpp function
}

- nest August 09, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

In this way compiler maintains the difference in name-mangling of functions in C and C++.

- nest August 09, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

For Q 4:
In order to use object as key in a Map , class must overload '>' operator.
So that comparison of objetcs can be done.

- ManishSindhi December 12, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Internally, the elements in the map are sorted from lower to higher key value following a specific strict weak ordering criterion set on construction.

- nest August 09, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

For number 6, you could copy the sixth element into the 5th element (just copy the values), then make it point to the seventh and delete the sixth

- Noha December 15, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hey,guys I am preparing for Bloomberg can anyone suggest some good C++ books for it. SInce Bloomberg puts a lot of emphasis on C++ knowledge .

- Anonymous December 22, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

you can try "Test your c++ skill" this is a good book even u can find on Amazon.com

- SB December 29, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Try parashift.com. After using this, you will change the way you are currently thinking about C++.

- Helper December 30, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

2. You have an empty class. What does compiler do?

The compiler will implicitly declare four functions for you:
default constructor, destructor, copy constructor, assignment operator "="

- xzy0410 January 04, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

2. Empty class will also have a non-zero size. This non-zero size helps in distinguishing two references pointing to two different objects.

- Anonymous January 04, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

C++ FAQ has a detailed description on (1). FAQ 32.

- Anonymous January 05, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I belive that question 3 was in other words question if the class with 1 object have automatically overloaded operator < based on this single element. Turns out it doesn't, example code:

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class my_class{
public:
    int x;
    
};
bool operator<(const my_class& a, const my_class& b) {
    return a.x < b.x;
}
vector<my_class> v;
int main() {
    sort(v.begin(), v.end());
}

Try to compile this code without the line:

bool operator<(const my_class& a, const my_class& b);

And see how it fails.

- R.Kozikowski January 18, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

2. Compiler compiles the class file anyway, but does not assign any memory (I think the next question determines why this is the answer that was being expected).
3. When the object is created, memory is assigned to the object.
What the interviewer probably expected from the second part of the question was whether the objects could be ordered based on some property/variable. In Java, we can use the Comparable interface to achieve this.
4. Yes, if we use a sorted map (such as TreeMap, again, Java).
5. By default, a map is not sorted. But a sorted Map such as TreeMap is sorted based on the key.

Hope this helps.

- Anonymous January 25, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

seems it will be sorted.
Internally, the elements in the map are sorted from lower to higher key value following a specific strict weak ordering criterion set on construction.

- CTcoolL March 07, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Re: #6 - no other solution posted has tried to preserve the order of the list. In case that matters, copy the data from 6 -> 5, from 7 -> 6 etc, and when you reach the last node, delete it (because you've kept two ptrs, a 'current' and 'next'). This list will be identical to just having removed the 5th element. (Unless some outside code has a ptr to an elts of the list.)

- JeffD January 12, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Just copy (including next pointer) node 6 to node 5 and delete node 6.
You dont need to copy all the way to the last node.

- Satish June 13, 2013 | Flag


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More