โ† Genpact questions
CodingReported in a candidate post, Jun 2024

Predict the output of a loop with nested setTimeout calls

Filed under Genpact

The question

Code-output question in JavaScript: a loop containing a setTimeout of 3 seconds with a console.log and another of 2 seconds with a console.log; guess the output.

No write-up yet. Related questions below have one.

Related Genpact questions

Collected from public candidate posts and coding forums. Updated Nov 2026.