Infosys Interview Question for Software Engineer / Developers






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

process is a program under execution
Thread is a tiny program.

- saneep March 13, 2007 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

lol@above answer...thread is a path of execution...not a tiny program...

- lol June 01, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Process is the execution state of a program. An application (or program) may consist of a single process or multiple processes. A thread is a path of execution with in a process. There can be one or more threads runnig within a process. A process has it's own address space, data segment, code segment, stack, state, register sets etc. A thread shares the process's address space but has its own stack, state and register set. Because of this context switching between processes is more costlier and resource intensive than context switching between threads. Since the threads share process's address space, it is easy for threads to communicate using shared memory area. For processes to communicate special inter process mechanisms like FIFO, pipes, shared memory regions etc need to be setup. This makes inter process communication costly. But threads also have its share of problems because of sharing address space. It can pollute the address space of the process. Threads require synchronization mecahinsms to avoid race conditions while accessing shared variables for communciation. One can go into other details like differences between threads and child processes also. But these are the major differences.
The next question after you answer this comes, if threads are advantageous than processes, why do we have processes? Anyone.

- SG May 08, 2007 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Threads are a way for a program(process) to fork (or split) itself into two or more simultaneously (or pseudo-simultaneously) running tasks. The term Thread and process are used interchangeably but in general process is a bigger Aspect of a thread. In the sense that a thread is smaller part of excution of a program or process.

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

process is a program under excution:
thread is a small peace of code excution:

- ramesh February 25, 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