Domanda di colloquio di Microsoft

How is a context switch handled by the operating system?