HomeQuizzesNode.jsFile System & Streams
beginnerND-BEG-002

File System & Streams

10 questions  ·  Node.js  ·  beginner level

📝10 questions
No time limit
🔄Retake anytime
Instant feedback

Preview questions

1
Multiple Choice

What is the difference between fs.readFile() and fs.readFileSync()?

A
B
C
D
🔒 Sign in to answer and see explanation
2
Spot the Bug

This should read a file and log its content. Spot the bug:

const fs = require("fs")
fs.readFile("data.txt", (data, err) => {
  if (err) throw err
  console.log(data.toString())
})
A
B
C
D
🔒 Sign in to answer and see explanation
3
Fill in the Blank

Which encoding should you pass to get a string instead of a Buffer?

fs.readFile("file.txt", "_______", (err, data) => {
  console.log(data) // string, not Buffer
})
A
B
C
D
🔒 Sign in to answer and see explanation
+ 7 more questions
Sign in to attempt the full quiz
Free · No credit card required

Ready to attempt the full quiz?

Sign in to attempt all 10 questions, track your progress, and unlock AI-powered personalization.

← Browse all Node.js quizzes