Amazon Interview Question for Software Engineer / Developers






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

Threads:
1. code, address space, system space can be inherited from parent thread.(in case of process spawning all are not inherited.)
2. threads of same process can be communicated easily. (spawned processes can be communicated by using pipes or IPCS.)
3. parent thread's configurable parameters (eg. priority, cancellation) can be applicable to child threads. because they stored under system space and that is inheritable.
this is not incase of processes.

- Anonymous June 09, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Threads of a process share the same address space.Processes always have different virtual address space

- Anonymous June 09, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

process- a program is in execution.
thread- a program path of execution

- Anonymous June 11, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I got it from one of reading over the internet

Both threads and processes are methods of parallelizing an application. However, processes are independent execution units that contain their own state information, use their own address spaces, and only interact with each other via interprocess communication mechanisms (generally managed by the operating system). Applications are typically divided into processes during the design phase, and a master process explicitly spawns sub-processes when it makes sense to logically separate significant application functionality. Processes, in other words, are an architectural construct.

By contrast, a thread is a coding construct that doesn't affect the architecture of an application. A single process might contains multiple threads; all threads within a process share the same state and same memory space, and can communicate with each other directly, because they share the same variables.

Threads typically are spawned for a short-term benefit that is usually visualized as a serial task, but which doesn't have to be performed in a linear manner (such as performing a complex mathematical computation using parallelism, or initializing a large matrix), and then are absorbed when no longer required. The scope of a thread is within a specific code module—which is why we can bolt-on threading without affecting the broader application.

--Alan Zeichick

- Santosh June 14, 2010 | 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