PGoCareerGoCareer prep tools
Home
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

Node.js · Theory

Buffer.compare() Method

← All stacks

Theory

63/723

Buffer.compare() Method

Don’t start Buffer.compare() Method with jargon. Start with read a big CSV. That is the whole point.

Do Buffer.compare() Method once by hand. createReadStream. Change one input. Say the new result out loud.

Buffer.compare() Method exists so Rohit can keep read a big CSV correct in an upload job.

Buffer.compare() Method shows up in an upload job. Name read a big CSV, not “a real-world scenario”.

Buffer.compare() Method trap — loading the whole file into RAM. Rohit loses marks for that every viva.

Buffer.compare() Method is not a lonely heading. Rohit ties it to read a big CSV.

Viva for Buffer.compare() Method — what it is → createReadStream → the mistake (loading the whole file into RAM).

Exam tip

Board: read a big CSV. Dry-run Buffer.compare() Method. Name the trap: loading the whole file into RAM.

Example

const buf = Buffer.from("PrepPilot", "utf8");
console.log(buf.toString("utf8"));
console.log(buf.length);

Buffer.compare() Method — buffer holds raw binary data outside the V8 string heap.

Short notes

  • DefBuffer.compare() Method — Rohit uses it for read a big CSV in an upload job.
  • RuleBuffer.compare() Method → createReadStream.
  • RememberBuffer.compare() Method + an Express route (an upload job).
  • UseBuffer.compare() Method in an upload job (read a big CSV).
  • TrapBuffer.compare() Method — loading the whole file into RAM.
  • ExBuffer.compare() Method → read a big CSV.

Questions

1

In one breath: what does Buffer.compare() Method do for Rohit?

2

If you skip Buffer.compare() Method, what breaks in an upload job?

3

Which mistake makes read a big CSV fail?

4

Change one input on read a big CSV. Predict the new result.

Previous← Buffer.alloc() MethodNextBuffer.equals() Method →
P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.