Microsoft Interview Question for Software Engineer / Developers


Country: India
Interview Type: In-Person




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

Sure, there could still be benefits. I don't know what you mean by "process itself is pretty responsive", but I would note that having multiple threads allows you to do tasks while one thread is, for example, waiting on disk I/O or network I/O to complete.
_
Furthermore, processors employing hyper-threading can execute instructions from multiple threads simultaneously. This may offer a performance advantage because instructions from one thread can run when the instruction stream from another thread is stalled because of data hazards or memory access latency.

- eugene.yarovoi January 19, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Correct. If there is a blocking operation like blocking I/O as said by Eugene, the processor can execute instruction from the other thread.

- topgun.in January 19, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I think "process is pretty responsive" means it is not stuck in I/O operations or any such operations...
i think in this case there won't be much of a difference whether we use multithreading or single threading...
for. eg.. if we are downloading a page on a browser and all blocks have html data..why would we use multithreading? multithreading in that case would only increase the time involved in context switching..Multithreading helps only when some blocks are heavier than the other and take more time to respond(due to I/O operations or any such operation)
I hope u r getting my point.

- dreamer February 04, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Most programs have at least a little I/O. But even if there's no I/O, the hyper-threading argument applies.

- eugene.yarovoi February 04, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

You forgot to mention one point.

Sometimes, designing for multiple threads simplifies the code and makes it easier to maintain etc.

Of course, finding bugs due to race conditions becomes trickier, but in general, the code is less brittle than trying to cram asynchronous IO etc in one thread.

- Anonymous September 20, 2012 | Flag
Comment hidden because of low score. Click to expand.
2
of 2 vote

Actually, there are two main goals when a developer works with multiple threads:
1) Concurrency, or better responsiveness.
2) Separation of concerns.
2nd goal still holds good in the given scenario.

- Nayan January 18, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

yes why not its always!!! because there may be reason that one thread is got busy in input output and user wants to see results so swithing between the threads like computing thread on input already taken is shown to the user so user think that its interactive

- geeks January 19, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

yes, sometimes the threading is required , like one thread is listening for event and other is processing the events and the other one is UI thread.

- Anonymous September 20, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Actually Yes..... by using threads you are doing multitasking ... now you are doing all the tasks at the same time span .... multitasking in single core processor takes longer time than serial tasking because of context switching but if the number of threads are less then it will work just fine..

- Wayne January 18, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

-1: unclear

- eugene.yarovoi January 19, 2012 | Flag
Comment hidden because of low score. Click to expand.
-1
of 1 vote

We can answers this as another question to Microsoft.The question is as follows:
When there was one processor, why did Microsoft developed Operating systems that run many process simultaneously. Well what ever the advantages were there the same(almost) apply here.

- Dr.Sai January 20, 2012 | 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