Bloomberg LP Interview Question for Financial Software Developers


Country: United States
Interview Type: Phone Interview




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

i think the appropriate answer for this question would be how they are implemented :that is the program they use to implement that is like test and set program: these programs are implemented by the hardware developers such as intel which uses xchnge

- sai s February 05, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

By using memory barrier. A mutex lock, for example begins by locking the mutex and completes by issuing a memory barrier. So any memory access issued while the mutex is locked can not complete before other thread can see the mutex is locked.

- santosh February 19, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Use some hardware specific functions to ensure atomicity and waiting channel (if implement sleeping mechanism), like spinlock and wchan in OS161. Test whether or not the lock holder is NULL, if yes, set the holder to the current thread itself, if no, sleep in the waiting channel.

- orangetime23 May 18, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

In the old days, Mutex Locks need hardware support and essentially there are many schemes to ensure Lock atomicity some eg. are LL_SC, Test&set, Ticket or Token based, Array Locks with back off schemes ...c++11 is supposed to have added mutex lock featurees for a fully parallel/multi threaded execution of a single program code.

- Rahul June 20, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

from stackoverflow.com/questions/5095781/how-pthread-mutex-lock-is-implemented

In Linux, for example, a system called Futex (Short for Fast Userspace Mutex) is used.

In this system an atomic increment and test operation is performed on the mutex variable in user space.

If the result of the operation indicates that there was no contention on the lock, the call to pthread_mutex_lock returns without ever context switching into the kernel, so the operation of taking a mutex can be very fast.

Only if contention was detected does a system call (called futex) and context switch into the kernel occurs that puts the calling process to sleep until the mutex is released.

- vaticanoptimist October 01, 2013 | 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