Arcesium interview question

How multitasking occurs in operating system?