Bloomberg LP Interview Question for Software Engineer / Developers






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

You are confusing "operator new" with "new" operator(Read it again..as it is important)

Lets talk about the "new" operator which returns an object pointer. It roughly works in the following way:

- It calls "operator new", which is the function that u mentioned above.
- It calls the object constuctor, if any.
- Return a pointer to the newly-constructed object.

So the function that u mentioned is part of the "new" operator. If you want to use it, you can do something like this:

void* mem = operator new(128); //Allocate 128 bytes

Notice the difference in syntax between "operator new" and "new" operator.

HTH,
Chander

- Chander Shivdasani February 09, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

nice

- siva.sai.2020 May 13, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

@Chander: Absolutely.

There is one more difference between

operator new

and

new operator

.
When you overload new, you overload

operator new

and not

new operator

because

new operator

cannot be overloaded because of other reasons demands a separate question and discussion thread!

- rajendra February 10, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

a void pointer can hold any type of pointer thts why there is a void*

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

a void pointer can hold any type of pointer thts why there is a void*

- sriks April 04, 2011 | 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