Demant interview question

Theoretical RTOS, Embedded Hardware, and Software questions followed by two C code snippets.