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.