Interview Question for Software Engineer / Developers






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

en.wikipedia.org:wiki:Priority_inversion

should answer your question.

- Raghav June 19, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

RTOS follows priority scheduling , if same priority then round robin .

Now suppose low task is running and has lock L1 . Now lets say High Priority task comes since it priority is high now cpu will given to him
task states (ready running block suspended)

scheduler will select high priority task from ready queque
------------------ Now ---------------------------------------

Low Pri Task-->acquires L1 -->
High Pri Task ->Low pri task goes to ready queue since priority is less ->High Pri try acquiring L1 => goes to block queue state on that lock, later it should go ready state when L1 is unlocked


Please note that Low priority task was in ready queue to be picked up by schdeduler
Now at this time suppose Medium pri task also comes in ready queque.

Now Medium task will be picked up by scheduler since pri is more, this is problem.

- Rakesh Kushwaha June 19, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

One scenario where it is used is pipeline consumption. If in case the high priority thread expects some worked-up variable in low priority state which it will consume and any pre-emption will render the whole solution useless because of inconsistent state that low prioirty thread amy end up with.

- pankaj March 06, 2018 | 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