100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

What are the Different Process States in an OS?

Learn the process states in an OS — new, ready, running, waiting, terminated — with transitions and interview questions explained.

easyQ90 of 224 in Operating Systems Est. time: 5 minsLast updated:
Open Code Lab

Expected Interview Answer

A process moves through a small set of states — new, ready, running, waiting (blocked), and terminated — and the OS scheduler transitions it between them based on CPU availability, I/O requests, and completion, tracking the current state in the process’s PCB.

When a process is created it enters the new state while the OS allocates its process control block (PCB) and initial resources; once admitted it moves to ready, meaning it is loaded and eligible to run but waiting for the scheduler to grant it the CPU. The dispatcher picks one ready process to move into running, where its instructions actually execute on a core. From running, a process can go back to ready if preempted by the scheduler, move to waiting if it issues a blocking I/O or synchronization call, or move to terminated once it finishes or is killed. A waiting process returns to ready — never directly to running — once its I/O completes or the event it was blocked on occurs, so the scheduler can re-evaluate all ready candidates fairly.

  • Gives a precise vocabulary for describing scheduler behavior
  • Explains why blocked processes never directly resume execution
  • Clarifies what the PCB tracks at each transition
  • Foundation for reasoning about scheduling and concurrency bugs

AI Mentor Explanation

Process states are like a batter’s journey through a match: they are new while padding up in the dressing room, ready once they walk out and wait near the boundary rope for the umpire’s signal, running while actually facing deliveries at the crease, and waiting if rain stops play mid-innings. Once out or the innings ends they are terminated, and a rain-delayed batter always returns to the ready group near the rope, never straight back to the crease, until the umpire restarts play.

Step-by-Step Explanation

  1. Step 1

    New

    The OS creates the PCB and allocates initial resources for the process, but it is not yet eligible to run.

  2. Step 2

    Ready

    The process is fully loaded and admitted, sitting in the ready queue waiting for the scheduler to grant it a CPU.

  3. Step 3

    Running

    The dispatcher assigns the CPU and the process instructions execute; it can leave via preemption, blocking, or completion.

  4. Step 4

    Waiting / Terminated

    A blocking call moves it to waiting until the event completes (back to ready); finishing or being killed moves it to terminated.

What Interviewer Expects

  • Naming all five core states in the correct order
  • Clarity that waiting always returns to ready, never straight to running
  • Awareness that the PCB tracks current state at each transition
  • A correct trigger for each transition (I/O call, scheduler decision, completion)

Common Mistakes

  • Claiming a waiting process resumes running directly once its event completes
  • Merging ready and running into a single state
  • Forgetting the new state exists before a process is admitted
  • Not knowing what a PCB is or that it stores the state

Best Answer (HR Friendly)

Every process moves through a handful of stages as the OS manages it: it starts out being set up, then waits its turn, then actually runs on the CPU, and if it needs to pause for something like disk access it waits again before rejoining the queue, until it eventually finishes. This is how the operating system keeps track of dozens of programs at once without losing track of any of them.

Code Example

Simplified process state enum and transition
enum proc_state { NEW, READY, RUNNING, WAITING, TERMINATED };

struct pcb {
    int pid;
    enum proc_state state;
};

void block_on_io(struct pcb *p) {
    p->state = WAITING;          /* issued a blocking I/O call */
}

void io_complete(struct pcb *p) {
    p->state = READY;            /* returns to the ready queue, not RUNNING */
}

Follow-up Questions

  • What information does the process control block (PCB) store?
  • Can a process move directly from waiting to running? Why or why not?
  • How do process states relate to context switching?
  • What is a suspended or swapped-out state and when is it used?

MCQ Practice

1. When a process finishes a blocking I/O call, which state does it move to?

A process leaving the waiting state always re-enters the ready queue; the scheduler then decides when it actually runs.

2. What happens during the new state?

New is the setup phase where the OS creates bookkeeping structures for the process before it becomes eligible to run.

3. What triggers a transition from running back to ready (rather than waiting)?

Preemption interrupts a running process without blocking it, so it goes back to ready to compete for the CPU again.

Flash Cards

Name the five core process states.New, ready, running, waiting, terminated.

Where does a waiting process go once its event completes?Back to ready — never directly to running.

What tracks a process's current state?The process control block (PCB).

What moves a process from running to waiting?It issues a blocking call, such as I/O or a lock wait.

1 / 4

Continue Learning