Bloomberg LP Interview Question for Software Engineer / Developers






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

the easiest way is to use ref count list

- asuran October 13, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

check out

http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)#Implementation_strategies

- Harshal Veera November 07, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

don't f*** here. if you know then ONLY answer

- VM November 13, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Harshal , thanks for the link

- blah November 30, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

create a daemon thread

- pathfinder November 22, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

@pathfinder
would you mind going through the link? 'll help you get your job done sans daemons.

- LLOLer August 18, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The correct answer is: don't. Garbage collection does not work well with C++.

Better to use RAII (which you can Google). Simply put, make sure that you have destructors to properly clean up all the resources you aquire.



std::mutex m;

void bad()
{
m.lock(); // acquire the mutex
f(); // if f() throws an exception, the mutex is never released
if(!everything_ok()) return; // early return, the mutex is never released
m.unlock(); // if bad() reaches this statement, the mutex is released
}

void good()
{
std::lock_guard<std::mutex> lk(m); // RAII class: mutex acquisition is initialization
f(); // if f() throws an exception, the mutex is released
if(!everything_ok()) return; // early return, the mutex is released
}

- anuragpatel.optnio July 25, 2017 | 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