“do you know event loop?” Asked by my interviewer

LORY
7 min readOct 15, 2023

Let’s explore every aspect where the concept of an event loop excels in this one single post.

The story

“During yesterday’s interview, my interviewer asked me which web server I am using, I told him Apache, PHP” my friend told me.

“Then what he said?” I asked him.

“He said that was a bad choice. Web server a better choice is using nodejs” He said.

“And did you ask him why”.

“Yes, He said it is an ‘async web server’, super efficient for I/O operation”. he told me

“Did you mention nginx?” I asked.

“Yes, and he said they are based on the same design thinking”.

“What design, did you ask?”.

“Event loop.”

“He is right, and then he asked you about the event loop?”

“Yes, but I couldn’t explain the full picture because I am not very sure how exactly event loops make web servers efficient, and I heard it in many places. can you brief me on the details?”

“Sure, Let’s start with a real-life sample, you are seeing it and using it every day if you notice carefully.”

“Really?”

“Yes, I will make sure you won’t be confused again.”

Real-life sample

--

--

LORY
LORY

Written by LORY

A channel which focusing on developer growth and self improvement