Node.js Course
Node.js
/
Advanced

Coding Questions

Definition

Live programming challenges that require demonstrating Node.js specific patterns like asynchronous flow control, event emitters, or streams.

Explain Like I'm New

The interviewer shares their screen and says: 'Write a function that reads 3 files simultaneously and returns their combined data in alphabetical order'. You must code it live.

Real World Example

Writing a custom `EventEmitter`, implementing a basic Express server from scratch using only the raw `http` module, or solving a Promise concurrency problem.

Common Use Cases

  • •Technical interviews
  • •Pair programming assessments

Interactive Example

Loading...
Console output will appear here...

Interview Questions

basic

  • Can you implement `Promise.all` manually?

intermediate

  • Write a script to recursively find all `.js` files in a directory using the `fs` module.

Flash Cards

Question

Implement Promise.all?

Click to reveal answer
Answer

You create an array to hold results, loop through the promises, use `.then()` to push results to the array, keep a counter of resolved promises, and resolve the main wrapper Promise only when the counter equals the length of the input array.

Question

Find files recursively?

Click to reveal answer
Answer

Use `fs.readdirSync`. Loop through the results. Use `fs.statSync(file).isDirectory()`. If it's a directory, call the function recursively. If it's a file, check if it ends with `.js`.