Hello Meetcode CLI

Easy
4 views 25 Jan 2026
Print a welcome message for meetcode using Node.js....

Read ENV Variable

Easy
3 views 25 Jan 2026
Read MEETCODE_NAME from process.env and print it (use fallback if missing)....

Parse Command Line Args

Medium
4 views 25 Jan 2026
Read --topic and --level from process.argv and print them as JSON....

Export And Require Module

Medium
3 views 25 Jan 2026
Create a small math module and use it to add two numbers....

CommonJS vs ESM Hint

Medium
4 views 25 Jan 2026
Detect if running in CommonJS and print a friendly note....

Resolve Current File Path

Easy
4 views 25 Jan 2026
Print the directory of the current file and join a child path....

Safe JSON Parse

Hard
3 views 25 Jan 2026
Parse a JSON string safely and print an error message on failure....

Timing A Function

Medium
3 views 25 Jan 2026
Measure how long a function takes using process.hrtime.bigint()....

Process Exit Codes

Easy
3 views 25 Jan 2026
Exit with code 1 when an input number is negative....

Simple Logger Function

Easy
4 views 25 Jan 2026
Write a small logger that prefixes time and 'meetcode'....

Read Text File

Medium
3 views 25 Jan 2026
Read a file path from stdin and print its contents....

Write File Safely

Hard
4 views 25 Jan 2026
Write 'meetcode' to a file path, creating folders if needed....

Append Log Lines

Easy
3 views 25 Jan 2026
Append a new line to meetcode.log with current time....

List Directory Files

Hard
4 views 25 Jan 2026
Read a directory path and print file names sorted....

Path Normalize

Medium
5 views 25 Jan 2026
Normalize a user given path and print the safe version....

File Stats Size

Medium
3 views 25 Jan 2026
Read a file path and print its size in bytes....

Copy File

Hard
5 views 25 Jan 2026
Copy a source file to destination and print COPIED....

Delete File If Exists

Easy
4 views 25 Jan 2026
Delete a file only if it exists, print OK....

Read JSON Config

Medium
3 views 25 Jan 2026
Read config.json and print config.site or 'meetcode'....

Atomic Save Pattern

Hard
3 views 25 Jan 2026
Write JSON to a temp file then rename, print SAVED....

EventEmitter Counter

Medium
3 views 25 Jan 2026
Use EventEmitter to count events and print the total....

Promise Chain Order

Hard
4 views 25 Jan 2026
Show the execution order between sync code, Promise.then, and setTimeout....

Async/Await Try Catch

Medium
3 views 25 Jan 2026
Call an async function that can throw and handle it cleanly....

Parallel Promises

Medium
3 views 25 Jan 2026
Run two promises in parallel with Promise.all and print combined result....

Timeout With Promise.race

Hard
4 views 25 Jan 2026
Add a timeout wrapper for an async task using Promise.race....

Retry With Backoff

Hard
4 views 25 Jan 2026
Retry a failing async function 3 times with small delays....

Queue Tasks One By One

Medium
4 views 25 Jan 2026
Process async tasks in order (not parallel) and print final array....

AbortController With Fetch

Hard
3 views 25 Jan 2026
Cancel a fetch request using AbortController and print ABORTED....

Event Loop Starvation

Hard
5 views 25 Jan 2026
Show how a long sync loop blocks timers (print before and after)....

Custom Delay Function

Easy
4 views 25 Jan 2026
Create a delay(ms) promise and use it with await....

Basic HTTP Server

Medium
3 views 25 Jan 2026
Create an HTTP server that returns 'Hello meetcode'....

Parse URL Query

Medium
3 views 25 Jan 2026
Parse ?q=react&page=2 from a URL and print an object....

Routing Without Framework

Hard
3 views 25 Jan 2026
Handle /, /health, and 404 using if statements....

Read JSON Body

Hard
3 views 25 Jan 2026
Read request body, parse JSON, and echo it back....

CORS Headers

Medium
3 views 25 Jan 2026
Add simple CORS headers for GET requests....

Set Cookie Header

Medium
4 views 25 Jan 2026
Return a response that sets a cookie and prints a message....

Static File Server

Hard
3 views 25 Jan 2026
Serve a local file for /file and 404 otherwise....

Request Timeout

Easy
5 views 25 Jan 2026
Close idle connections by setting a server timeout and print the value....

URL Builder Function

Easy
3 views 25 Jan 2026
Build a URL for meetcode search with query params....

Handle Large JSON Response

Medium
4 views 25 Jan 2026
Fetch JSON (mocked) and safely handle missing fields....

Buffer From String

Easy
5 views 25 Jan 2026
Create a Buffer from a string and print its byte length....

Hex To Buffer

Medium
4 views 25 Jan 2026
Read a hex string and print the utf8 text....

Stream Copy File

Hard
3 views 25 Jan 2026
Copy a file using streams and print DONE....

Readable Stream Line Counter

Hard
3 views 25 Jan 2026
Count how many lines are in stdin using streams....

Transform Uppercase Stream

Medium
3 views 25 Jan 2026
Read stdin, convert to uppercase, write to stdout....

Backpressure Idea Demo

Hard
4 views 25 Jan 2026
Pipe a readable to writable and log when drain happens....

JSON Lines Writer

Medium
5 views 25 Jan 2026
Write an array as JSONL (one JSON per line)....

Gzip Compress Text

Hard
4 views 25 Jan 2026
Compress a string with gzip and print compressed byte length....

Decode Base64

Easy
4 views 25 Jan 2026
Read base64 from stdin and print decoded text....

Chunked JSON Parse Problem

Hard
3 views 25 Jan 2026
Explain why JSON.parse on stream chunks fails, and fix by buffering....

Basic CLI Calculator

Medium
3 views 25 Jan 2026
Create a CLI that reads two numbers and an operator and prints result....

Pretty Print Errors

Medium
5 views 25 Jan 2026
Catch an error and print message plus stack first line....

Color Output Without Library

Hard
4 views 25 Jan 2026
Print green text using ANSI codes only when stdout is TTY....

Progress Bar Idea

Hard
3 views 25 Jan 2026
Print a simple progress bar from 0 to 100 in steps....

Spawn Child Process

Hard
4 views 25 Jan 2026
Run 'node -v' using child_process and print the version....

Read From Stdin Lines

Easy
5 views 25 Jan 2026
Read all stdin, split into lines, and print count....

Simple Config File Locator

Medium
3 views 25 Jan 2026
Pick config path: MEETCODE_CONFIG env else ./meetcode.config.json....

Debug Flag Switch

Easy
4 views 25 Jan 2026
If --debug is present, print extra information....

Graceful SIGINT

Hard
3 views 25 Jan 2026
Handle Ctrl+C (SIGINT) and print Bye meetcode then exit....

Simple Worker Thread

Hard
3 views 25 Jan 2026
Run heavy work in worker_threads and return result to main thread....

Cluster Basics Explanation

Medium
4 views 25 Jan 2026
Print how many CPU cores exist and a note about clustering....

Require Cache Singleton

Medium
5 views 25 Jan 2026
Show that requiring the same module twice returns the same instance....

Safe Number From String

Easy
3 views 25 Jan 2026
Convert a string to number and print 0 if it is not a valid number....

Random ID Generator

Easy
4 views 25 Jan 2026
Generate a random id for meetcode logs using crypto....

Merge Defaults With User Config

Medium
4 views 25 Jan 2026
Merge user config JSON into defaults and print final JSON....

Use assert For Quick Check

Medium
3 views 25 Jan 2026
Use Node assert to validate a condition and print PASS....

Measure Memory Usage

Easy
4 views 25 Jan 2026
Print heapUsed in MB using process.memoryUsage()....

queueMicrotask Demo

Hard
3 views 25 Jan 2026
Use queueMicrotask to schedule work and show ordering....

File URL Conversion

Hard
3 views 25 Jan 2026
Convert a file path to file URL and back, print both....

Simple In-Memory Cache

Medium
3 views 25 Jan 2026
Cache a slow function result in a Map and print cache hits....

Unhandled Rejection Handler

Hard
3 views 25 Jan 2026
Handle unhandledRejection and print a friendly message....

fs.promises ReadFile

Medium
4 views 25 Jan 2026
Read a file using fs.promises and print its length....

Create File If Missing

Easy
4 views 25 Jan 2026
If file does not exist, create it with 'meetcode' and print CREATED/EXISTS....

Rename File

Medium
3 views 25 Jan 2026
Rename a file and print RENAMED or FAIL....

Watch File Changes

Hard
3 views 25 Jan 2026
Watch a file and print CHANGED when it updates (demo)....

Read Large File Line By Line

Hard
4 views 25 Jan 2026
Read a file line by line and print how many lines contain 'meetcode'....

Recursive Folder Size

Hard
4 views 25 Jan 2026
Compute total size of files in a folder recursively....

Temporary File Path

Easy
3 views 25 Jan 2026
Create a temp file path in os.tmpdir and print it....

Compare Two Files By Hash

Hard
4 views 25 Jan 2026
Compare two files by sha256 and print SAME or DIFF....

Resolve User Home Path

Easy
4 views 25 Jan 2026
Join a filename into the user home directory and print it....

nextTick vs setImmediate

Hard
4 views 25 Jan 2026
Print the order between process.nextTick and setImmediate....

EventEmitter once()

Medium
4 views 25 Jan 2026
Listen to an event only once and print count....

Promisify Callback API

Medium
5 views 25 Jan 2026
Convert a callback-style function to promise using util.promisify....

Concurrency Limit Pool

Hard
4 views 25 Jan 2026
Run tasks with max 2 concurrency and print completion order....

Async Generator Basics

Hard
3 views 25 Jan 2026
Create an async generator that yields values with delay....

Debounce Function

Medium
5 views 25 Jan 2026
Build a debounce(fn, ms) and show it only calls once....

Stop Interval After N

Easy
4 views 25 Jan 2026
Run setInterval and stop after 3 ticks, print count....

Handle SIGTERM Async Cleanup

Hard
4 views 25 Jan 2026
Handle SIGTERM, wait for cleanup promise, then exit....

Task Queue With setImmediate

Hard
4 views 25 Jan 2026
Process an array of tasks without blocking the event loop....

Microtask With Promise.resolve

Easy
5 views 25 Jan 2026
Queue a microtask using Promise.resolve().then and print order....

HTTP Client GET https

Hard
6 views 25 Jan 2026
Send a GET request using https and print status code....

Fetch With Timeout

Hard
4 views 25 Jan 2026
Use AbortController to timeout a fetch call....

Parse Cookies Header

Medium
3 views 25 Jan 2026
Parse Cookie header into an object and print JSON....

Basic Auth Header

Easy
5 views 25 Jan 2026
Build an Authorization header for basic auth and print it....

In-Memory Rate Limiter

Hard
4 views 25 Jan 2026
Limit to 3 requests per minute per key (demo counter)....

Handle Redirect Response

Medium
3 views 25 Jan 2026
Detect 301/302 and print the Location header (demo)....

Parse Form Urlencoded

Medium
4 views 25 Jan 2026
Parse x-www-form-urlencoded body into object and print JSON....

Keep-Alive Agent

Easy
5 views 25 Jan 2026
Create an http.Agent with keepAlive and print keepAlive status....

Send JSON With Status

Hard
3 views 25 Jan 2026
Return 201 JSON response for /create and 404 otherwise....

SHA256 Of Stdin Stream

Hard
4 views 25 Jan 2026
Read stdin as stream and print sha256 hex....

pipeline Promise

Hard
5 views 25 Jan 2026
Use stream.pipeline with a promise wrapper to copy file....

ObjectMode Filter Stream

Hard
3 views 25 Jan 2026
Filter objects in a stream (only keep level=hard) and output JSONL....

Buffer.concat Example

Easy
6 views 25 Jan 2026
Join multiple buffers and print final text....

Slice Buffer Range

Medium
5 views 25 Jan 2026
Read text, slice first 4 bytes, and print it....

PassThrough Logger

Medium
3 views 25 Jan 2026
Use PassThrough to tap into a stream and count bytes....

Line Split Transform

Hard
4 views 25 Jan 2026
Split stdin by lines using a Transform and print number of lines....

Readable From Generator

Medium
3 views 25 Jan 2026
Create a readable stream from a generator and print output....

Count Bytes In File Stream

Hard
4 views 25 Jan 2026
Count bytes in a file using createReadStream....

Readline Prompt Name

Medium
3 views 25 Jan 2026
Ask user name using readline and greet them with meetcode....

Print Help Text

Easy
4 views 25 Jan 2026
If --help is passed, print usage text for a CLI....

Write To stderr

Easy
3 views 25 Jan 2026
Print warnings to stderr and normal output to stdout....

Spinner While Waiting

Hard
3 views 25 Jan 2026
Show a simple spinner for 1 second then print DONE....

Subcommand Switch

Medium
3 views 25 Jan 2026
Support subcommands: init and run, print what was chosen....

Read File Preview CLI

Medium
4 views 25 Jan 2026
Read a file path from args and print first 100 chars....

Exit Code On Failure

Easy
4 views 25 Jan 2026
If input string is empty, print FAIL and set exitCode=2....

Enable Debug Logs With ENV

Medium
3 views 25 Jan 2026
If DEBUG=1, print extra logs around a task....

JSON Output Mode

Medium
3 views 25 Jan 2026
If --json flag is present, print output as JSON instead of text....

Durable Write With fsync

Hard
4 views 25 Jan 2026
Write text to a file and fsync so it is flushed, then print DONE....

ETag 304 Cache

Hard
3 views 25 Jan 2026
Return 304 when If-None-Match matches, else return content with ETag....

Download With Stream

Hard
3 views 25 Jan 2026
Download a URL to a file using streams and print DONE....