Getting to know NodeJs event loop, how synchronous and asynchronous calls are processed

callback stack first serves all synchronous callbacks, and remove from  the stack when one is done executing, node api such as setTimeout, setImmediate, setInterval?, they for asynchronous calls put respected functions into callback queue, only when callback stack is empty would callback queue items be put to callback stack for execution.

Execution structure:

Event loop phases: