Bloomberg LP Interview Question for Software Engineer / Developers






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

in a multithreaded system, if the resource locked by one thread is needed by other and vice-versa, the system stops working. This is deadlock.

deadlock detection and avoidance is a problem in computer science, with many different approaches. these approaches would change with the system they are applied to.
a naive/beginner approach might be the logic that no thread/process should hold on to its resources if it can not find _all_ the resources it needs.

- morpheus February 12, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Check this out, its good:

cs.jhu.edu/~yairamir/cs418/os4/sld010.htm

Deadlock is a situation whereby two or more threads have locked resources needed by each other.
There are two schools of thoughts – Deadlock Prevention (a traffic light) and more promising, Deadlock Avoidance (a traffic police)

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

A deadlock occurs when a thread holds a resource and trying to acquire other resource already held by another thread,while that thread is also waiting for the first thread resource. Any number of threads can be involved in a deadlock if there is at least one resource per thread.Below are techniques to avoid deadlock:

1) Use sequence number with mutexes. Associate a sequence number with each mutex and acquire mutex in sequence. Never acquire a sequence number which is lower than sequence number already hold by thread.

2) Avoid locking more than one mutex at the same time.

- venkat December 16, 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