What actually happens during a context switch, and why should an application developer care?
A context switch in an operating system saves one thread's CPU state, runs the scheduler and restores another thread. Application developers care because excessive switches add latency through cache and TLB disruption, lock contention and oversized thread pools. It also connects scheduling to the point an interviewer is testing.