Capgemini interview question

They asked one JavaScript coding question, and another question where I had to predict the output of a JavaScript code snippet and explain the reason behind it.

Interview Answer

Anonymous

Dec 15, 2025

For the coding question, I wrote the required code. For the output-based question, I explained the execution step by step by doing a dry run of the code.