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.
Andrej Trajchevski
United Kingdom
Andrej is a developer with experience in delivering clean, working, and testable code. He's been actively working for 5 years, both in firms and as a freelancer. His last job was writing games for Gambit.com (a gaming platform) and developing the platform itself, along with 5-6 other people.
Edward Lin
United States
Edward is a web architect, technology enthusiast, and problem solver. With over 12 years of industry experience, he has delivered scalable and robust software for high traffic, enterprise level mobile web and eCommerce applications.
Alessandro Iob
Austria
Alessandro is a top freelance architect and developer with a number of skills. He has designed and developed API services, games, process automation systems, fault-tolerant distributed systems, and multi-platform applications. He has also reverse-engineered PLCs and interfaced with refrigerator systems.