Interview Question for Software Engineer / Developers


Country: India




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

Varun,

Parallel/Concurrent computing is basically divided into shared-memory, and distributed-memory architectures. In this case, both multiprocessor and multi-core are (assumed to be) shared memory architectures. Now, there are different ways synchronization is achieved by different programming languages/systems.

However, if it is assumed that the difference between two systems for the same program is asked, then at a programming level there should be:

No difference, since both are shared memory architectures.

At internal hardware Level: Assuming that POSIX thread-mutex is used for synchronization, then it is usually implemented using a low level instruction like test-and-set, compare-and-swap etc. So, for that a (volatile) variable is used to hold the atomic lock value. This might be treated as an integer. If two or more (physically parallel) threads try to acquire a lock at a time, then the only difference between multicore & multiprocessor should be in the cache-coherency (usually hardware) mechanism used to access the shared-memory lock-variable.

This has covered little internals also.

So, the code design & implementation should NOT change in either cases.

see: http-> superuser.com/questions/214331/what-is-the-difference-between-multicore-and-multiprocessor

Please feel free to correct me if I am wrong.

-T

- t April 18, 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