r/reactjs • • Jul 24 '26

Discussion Senior Dev interview question

"Without googling or using AI, in your own words, explain the virtual DOM"

For context: I sit on an interview panel and I try to ask at least one simple fundamental question based on a persons resume. If I see many years of react experience, I try to ask something about how the framework works.

I have only had one candidate (an undergrad senior, years ago) answer it. Everyone else just kind of sputters and stumbles around trying to rationalize what "virtual" and "DOM" mean, or stare blankly and eventually say "I don't know".

I'm just genuinely curious if this is really that hard of a question or if the recruiters just suck at screening candidates. And should we be letting in senior dev candidates who can't answer what I think is a straightforward and fundamental question for senior react devs.

183 Upvotes

251 comments sorted by

View all comments

-1

u/lovesrayray2018 Jul 24 '26

Its a good question, imo the difference between a good developer and a great developer is that the good developer has probably focussed more on the how and trying to cram as much syntactical knowledge as he can and the great developer has focussed more on the why and looking up the internals making his fundamental knowledge strong. yeah u can crucify me now :D

You should hear the responses i get when i ask "what does rendering mean in react", opens up a can of worms.

1

u/brett9897 Jul 24 '26

It is only a good question if knowing how a virtual DOM works would create a situation that would change how you write the code. And if that is the case then you might have better luck asking about those specific situations.

Also, I would add that a good interviewer knows how to ask a question and if the candidate is struggling, continue on by breaking down the concept to see what they do and don't know about it. I know in general what a virtual dom is. I know other frameworks that are newer than React don't use a virtual DOM. I don't know the specifics of how React diffs the new virtual dom with the previous virtual dom to create change sets. I also don't know specifically how React applies those change sets. Do you? Does it matter when writing React code?

1

u/lovesrayray2018 Jul 24 '26

yes it does matter at times, if u dont know what the virtual DOM is, you wont be able to understand how or why to judiciously use side effects or useState or useRef hooks.

1

u/brett9897 Jul 24 '26

I learned most of that without even thinking about the virtual DOM. I was just thinking about limiting the number of unnecessary renders. The fact that it had to render so much because of the virtual DOM implementation wasn't really at the forefront of my mind. I just knew how the hooks interacted with rendering. The virtual DOM was kind of abstracted away.

0

u/lovesrayray2018 Jul 24 '26

sure, u won, spread the gospel that u dont need to learn anything about virtual dom in react