A comprehensive collection of JavaScript interview questions and their implementations, organized by categories and difficulty levels.
This repository contains 40+ commonly asked JavaScript interview questions with working implementations. Perfect for preparing for frontend developer positions at companies like Google, Amazon, Microsoft, and startups.
📖 QUESTIONNAIRE.md - Complete Question Bank
A comprehensive guide with:
- Detailed problem statements
- Key concepts for each question
- Difficulty ratings
- Category-wise organization
- Quick reference guide
javascript-playground/
├── async-patterns/ # Async programming challenges
│ ├── asyncSequence.js # Parallel vs Series execution
│ ├── FetchWithLimit.js # Rate-limited API calls
│ ├── mapLimit.js # Concurrent async operations
│ └── PromiseSchedulor.js # Promise orchestration with pause/resume
│
├── patterns/ # Design Patterns
│ ├── circuitBreaker.js # Circuit Breaker pattern
│ ├── singleton.js # Singleton implementation
│ ├── pub-sub.js # Event Emitter/Observer
│ ├── proxy.js # Proxy pattern
│ └── resourcePool.js # Resource pooling
│
├── utilities/ # Utility implementations
│ ├── currencyConverter.js # Graph-based currency conversion
│ ├── customCookie.js # Custom cookie handler
│ ├── customSetTimeout.js # setTimeout implementation
│ ├── mutationObserver.js # DOM observation
│ └── pipe.js # Function composition
│
├── polyfills/ # JavaScript polyfills
│ └── index.js # Promise, map, reduce, call, bind, etc.
│
├── lld/ # Low-Level Design
│ ├── fileSystem.js # In-memory file system
│ └── orderManagement.js # E-commerce order system
│
├── interview-questions/ # Company-specific questions
│ ├── rateLimiter.js # API rate limiting
│ ├── middleware-thoughtspot.js # Middleware pattern
│ ├── tekion.js # Tekion interview problems
│ └── tekion2.js
│
├── debounce-throttle/ # Performance optimization
│ └── index.js # Debounce & Throttle
│
├── promises/ # Promise deep dive
│ ├── CustomPromise.js # Full Promise implementation
│ └── index.js # Promise concepts & examples
│
├── outputs/ # Output-based questions
│ └── index.js # Event loop, closures, etc.
│
├── this/ # 'this' keyword concepts
│ └── index.js # All 'this' binding scenarios
│
├── dom/ # DOM manipulation
│ └── index.js # DOM APIs
│
├── system-design/ # System design concepts
│ └── normalization/ # State normalization
│
└── typescript/ # TypeScript examples
└── src/
- Node.js (v14+)
- Modern web browser (for DOM examples)
- Node.js examples:
node async-patterns/PromiseSchedulor.js
node patterns/circuitBreaker.js- Browser examples:
# Open HTML files in browser
open debounce-throttle/index.html
open promises/index.html- Promise scheduling with pause/resume
- Rate-limited fetch
- Concurrent operation limiting
- Series vs Parallel execution
- Circuit Breaker
- Singleton
- Pub-Sub (Event Emitter)
- Proxy
- Resource Pool
- Promise, Promise.all, Promise.allSettled
- call, bind, apply
- map, reduce, forEach, flat
- Object.flatten
- File System
- Order Management System
- Rate Limiter
- Middleware System
- Event loop & execution order
- Closures & scope
- Promise chains
- Array.map with parseInt
- setTimeout in loops
thiskeyword (all scenarios)- Promises (deep dive)
- DOM manipulation
- Debounce/Throttle
- Array polyfills
- DOM manipulation
- Basic Promise usage
- Singleton pattern
- Custom Promise implementation
- Circuit Breaker
- Rate Limiter
- mapLimit
- Curry/Compose
- Pub-Sub pattern
- Promise Scheduler with pause/resume
- Resource Pool
- File System Design
- Currency Converter with graph traversal
- Middleware implementation
- Read QUESTIONNAIRE.md for problem statements
- Try solving without looking at code
- Compare your solution with implementation
- Understand the key concepts
- Use QUESTIONNAIRE.md as a checklist
- Review output-based questions
- Practice explaining concepts
- Read and understand each implementation
- Run the code and see outputs
- Modify code to test edge cases
- Add your own test cases
- Problem-solving approach: Think out loud
- Code quality: Clean, readable code
- Edge cases: Consider boundary conditions
- Time/Space complexity: Analyze your solution
- Communication: Explain your thought process
- ✅ Promises & Async/Await
- ✅ Closures & Scope
- ✅ Event Loop & Execution Context
- ✅ Array/Object methods
- ✅
thiskeyword - ✅ Design Patterns
- ✅ Performance Optimization
- ✅ System Design basics
- Execution Context
- Hoisting
- Closures
- Prototypes
thisbinding
- Promises
- Async/Await
- Event Loop
- Microtasks vs Macrotasks
- Concurrent execution
- Singleton
- Observer (Pub-Sub)
- Circuit Breaker
- Proxy
- Factory
- Graphs (Currency Converter)
- Trees (File System)
- Queues (Rate Limiter, Middleware)
- BFS/DFS
- Debouncing
- Throttling
- Memoization
- Resource Pooling
This repository includes actual questions asked at:
- Tekion
- Thoughtspot
- And other top companies
This is a JavaScript-focused repository. For complete interview prep, also study:
- React/Vue/Angular (if required)
- TypeScript
- Testing (Jest, Testing Library)
- Build tools (Webpack, Vite)
- Git & Version Control
- System Design (for senior roles)
Use this checklist to track your progress:
Async Patterns:
- asyncSequence
- FetchWithLimit
- mapLimit
- PromiseSchedulor
Design Patterns:
- Circuit Breaker
- Singleton
- Pub-Sub
- Proxy
- Resource Pool
Polyfills:
- Promise
- Promise.all/allSettled
- call/bind/apply
- map/reduce/forEach
- Array.flat
- Object.flatten
LLD:
- File System
- Order Management
- Rate Limiter
- Middleware
Concepts:
-
thiskeyword - Promises
- Event Loop
- Closures
Feel free to:
- Add more questions
- Improve implementations
- Fix bugs
- Add test cases
- Improve documentation
This repository is for educational purposes. Feel free to use for interview preparation.
Good luck with your interviews! 🚀
Pro Tip: Don't just memorize solutions. Understand the concepts and practice explaining them in simple terms.