Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript Interview Questions Series

A simple test-driven structure for practicing JavaScript interview questions.

Structure

Each question has its own directory with a descriptive name:

  • questions/question1-promise-all/ - Promise.all() polyfill
  • questions/question2-map/ - Array.map() polyfill
  • questions/question3-{name}/ - (Future questions)

Each question directory contains:

  • index.js - Contains the problem, solution, and tests (all in one runnable file)
  • README.md - Problem description and instructions

How to Use

Running a Question

Navigate to the question directory and run:

cd questions/question1-promise-all
node index.js

Or from the root directory:

node questions/question1-promise-all/index.js

This will:

  1. Execute the solution code
  2. Run all test cases
  3. Show ✓ (green) for passing tests
  4. Show ✗ (red) for failing tests
  5. Display a summary at the end

Example Output

🧪 Running tests for: Question 1: Promise.all() polyfill

──────────────────────────────────────────────────

✓ All promises resolve successfully
✗ One promise rejects
  Error: ...
──────────────────────────────────────────────────

📊 Results: 1 passed, 1 failed

❌ Some tests failed

Adding New Questions

  1. Create a new directory: questions/questionN-{problem-name}/
  2. Create index.js in that directory
  3. Import the TestRunner: const TestRunner = require('../../test-runner');
  4. Create a runner instance: const runner = new TestRunner('Question N: Description');
  5. Add tests using runner.test('description', async () => { ... })
  6. Run tests with runner.run();
  7. Optionally add a README.md with problem description

Current Questions

  • Question 1: Promise.all() polyfill implementation (questions/question1-promise-all/)
  • Question 2: Array.map() polyfill implementation (questions/question2-map/)

Contributing

For YouTube tutorial series - feel free to fork and practice!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages