Bloomberg LP Interview Question for Financial Software Developers


Country: United States
Interview Type: Phone Interview




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

Disadvantage:
Sometimes when using locks (for eg in case of a thread and interrupt handler), interrupts and/or pre-emption is disabled. As a consequence interrupts are ignored/queued and delayed or process can't swap and the higher priority process has to wait. Affects the normal OS operation.

Starvation:
The indefinite waiting by a thread because other threads keeping coming in.

Deadlock:
Number of threads waiting for resources held by other threads.

- T February 09, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Disadvantages of Locks:
1) adds overhead for each access, even when the chances for collision are very rare.
2) deadlock, where two threads each hold a lock on resources that the other needs before releasing its lock.
3) if one thread holding a lock dies before unlocking the resources, all other threads that are waiting on it will be blocked forever
4) high priority threads cannot proceed if a low priority thread is holding the common lock
etc....

- vaticanoptimist October 01, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

i am not sure about the disadvantage of locks...Starvation will occur when one or more processes in program blocked from gaining access from resources.
Deadlock will occcur when one or more threads are waiting for each other.

- thriveni.be2011 February 06, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

Disadvantages of locks:
Only one thread can enter the critical section, if there are multiple readers and they can read at the same time, it is suboptimal in this case.

Deadlock:
It occurs when a thread or set of threads are waiting for each other to finish and thus nobody ever does.

"A deadlock cannot occur unless all of the following conditions are met:
Protected access to shared resources, which implies waiting.
No resource preemption, meaning that the system cannot forcibly take a resource from a thread holding it.
Multiple independent requests, meaning a thread can hold some resources while requesting others.
Circular dependency graph, meaning that Thread A is waiting for Thread B which is waiting for Thread C which is waiting for Thread D which is waiting for Thread A."

Starvation:
"Starvation is an equally-problematic condition in which one or more threads do not make progress."

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

can anyone give disadvantages of locks plz??

- Anonymous July 27, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Disadvantage of locks:
Time is spent in acquiring and releasing locks which may affect performance.

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

disadvantages:
They cause blocking, which means some threads/processes have to wait until a lock (or a whole set of locks) is released. If one of the threads holding a lock dies, stalls/blocks or goes into any sort of infinite loop, other threads waiting for the lock may wait forever.
Lock handling adds overhead for each access to a resource, even when the chances for collision are very rare. (However, any chance for such collisions is a race condition.)
Locks can be vulnerable to failures and faults that are often very subtle and may be difficult to reproduce reliably. One example is the deadlock, where (at least) two threads each hold a lock that the other thread holds and will not give up until it has acquired the other lock.
Lock contention limits scalability and adds complexity.
Balances between lock overhead and contention can be unique to given problem domains (applications) as well as sensitive to design, implementation, and even low-level system architectural changes. These balances may change over the life cycle of any given application/implementation and may entail tremendous changes to update (re-balance).
Locks are only composable (e.g., managing multiple concurrent locks in order to atomically delete Item X from Table A and insert X into Table B) with relatively elaborate (overhead) software support and perfect adherence by applications programming to rigorous conventions.
Priority inversion. A low-priority thread/process holding a common lock can prevent high-priority threads/processes from proceeding. Priority ceiling protocol can be used to prevent priority inversion. Priority inheritance can be used to minimize priority-inversion duration.
Convoying. All other threads have to wait, if a thread holding a lock is descheduled due to a time-slice interrupt or page fault (See lock convoy)
Hard to debug: Bugs associated with locks are time dependent. They are extremely hard to replicate.
taken from wikki....

- priyan October 10, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

deadlock is a situation where threads are waiting for the resources which is hold by another waiting thread.

Starvation is a situation in which a process doesn't get the resource for which it is waiting for a long time because that resource is already occupied by the other process

- abhidreams662 July 12, 2016 | 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