1 Essential Express.js Interview Question*

What function arguments are available to Express.js route handlers?

The arguments available to an Express.js route handler function are:

  • req - the request object
  • res - the response object
  • next (optional) - a function to pass control to one of the subsequent route handlers

The third argument may be omitted, but is useful in cases where you have a chain of handlers and you would like to pass control to one of the subsequent route handlers, and skip the current one.

Fields marked with an asterisk (*) are required
Comment submitted succesfully. Thank you.
We are going to review the comment and get back to you as soon as possible.
* There is more to interviewing than tricky technical questions, so these are intended merely as a guide. Not every “A” candidate worth hiring will be able to answer them all, nor does answering them all guarantee an “A” candidate. At the end of the day, hiring remains an art, a science — and a lot of work.
Submit an interview question
Submitted questions and answers are subject to review and editing, and may or may not be selected for posting, at the sole discretion of Toptal, LLC.
All fields are required
Thanks for submitting your question.
Our editorial staff will review it shortly. Please note that submitted questions and answers are subject to review and editing, and may or may not be selected for posting, at the sole discretion of Toptal, LLC.
Sean Desmond
United States
Sean is a top software engineer with a passion for exceptional design and a proven ability to build effective, scalable, multi-tiered solutions. He has over ten years of software development and architecture experience, and has worked a variety of roles, from individual developer to tech/team lead.
Michael Cole
United States
Michael is a full-stack web developer (with DevOps) who gets things done. He works with small to medium sized businesses to move ideas to MVPs and beyond for users and revenue. He has the experience to work as an indie contributor, as team augmentation, or as a technical lead. He doesn't just write software; he actively helps businesses and teams.
Alejandro Hernandez
Argentina
Alejandro got his Bachelor's in software engineering eleven years ago, and since then has been working for software companies of all sizes from all around the globe as a freelancer. Currently, he enjoys working as the technical lead on JavaScript projects, where his deep understanding of architecture and theory is most impactful.