Bloomberg LP Interview Question for Financial Software Developers






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

haha seriously?

- Anonymous August 20, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Static - allocates memory during compilation (from BSS).
new - allocates memory during runtime (from heap).

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

Its Bloomberg ;)

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

true. these guys are the king of mediocrity!

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

difference as in where are they stored in memory. Details about how they are destroyed

- rk August 20, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

does it mean the difference between malloc() and new?

- beyondfalcon August 21, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

does it mean the difference between malloc() and new?

- beyondfalcon August 21, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

static variables are stored in data segment while new operator in heap.

The static user-defined variable creation doesn't automatically initialise it while new operator calls a default constructor for initialisation.

static variables memory is freed at program exit but memory allocated through new should be deallocated before you exit as better practise and to avoid memory leaks.

- Anonymous August 23, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

>The static user-defined variable creation doesn't automatically initialise it while > new operator calls a default constructor for initialisation.

Each static variable must be *defined* in exactly one compilation unit. It can be initialized at the point where it is defined. Else the compiler null initializes it. If the variable is a user defined type, the (default)constructor will be called before the main() execution begins.

- sudarshan.fs August 23, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Here is an illustration how the program crashes trying to delete statically created object:

void InsertLeadingDigitIntoArray(int*& Arr, int& n)
{
	Arr[Index]=0;
	int* Arr2;
	Arr2 = new int[n+1];
	Arr2[0] = 1;
	memcpy(&Arr2[1], &Arr[0], n*sizeof(int));
	delete [] Arr; // BANG! Here it crashes! - trying to delete dynamically (from the heap)
	Arr = Arr2;
	n++;
}

// inside main:

int Array[]={4,5,6,7,8,7,6,5,4,3,2}; // statically allocated (in the stack)

int* Arr=&Array[0];
int n;
n=sizeof(Arrray)/sizeof(int);
InsertLeadingDigitIntoArray(Arr, n);

- sergey.a.kabanov January 13, 2012 | Flag Reply


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