https://github.com/danedens/javascript_interview_questions
https://github.com/danedens/javascript_interview_questions
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/danedens/javascript_interview_questions
- Owner: DanEdens
- Created: 2025-01-03T15:52:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-03T20:20:17.000Z (over 1 year ago)
- Last Synced: 2025-02-10T02:41:23.438Z (over 1 year ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# JavaScript Interview Solutions
A collection of common JavaScript interview coding challenges and their implementations. This repository includes solutions for various JavaScript concepts, utilities, and design patterns.
## ๐ Features
### Promise Implementations
- Custom Promise.all, Promise.race, Promise.any, Promise.allSettled
- Promise sequencing and parallel execution
- Cancelable promises
- Promise retry mechanism
### Functional Programming
- Chain calculator
- Pipe and compose functions
- Currying implementation
- Array polyfills
### Performance Utilities
- Debouncing (basic and advanced with leading/trailing options)
- Throttling
- LRU Cache for typeahead search
- MapLimit functionality
### Event Handling
- Custom Event Emitter
- Observable Array implementation
- DOM element finder
### Data Structure Operations
- Array flattening
- Deep object cloning
- Document comparison
- Custom sorting algorithms (QuickSort, MergeSort)
### Object-Oriented Programming
- Prototype inheritance examples
- Custom implementations of call, apply, and bind
## ๐ง Usage
### Calculator Example
javascript
const calc = new Calculator(10);
console.log(calc.add(5).multiply(2).subtract(8).get()); // 22
javascript
const calc = new Calculator(10);
console.log(calc.add(5).multiply(2).subtract(8).get()); // 22javascript
const calc = new Calculator(10);
console.log(calc.add(5).multiply(2).subtract(8).get()); // 22
### Debouncing Example
```javascript
const debouncedFn = debounce(() => console.log('Executed'), 1000);
debouncedFn(); // Will execute after 1 second of inactivity
```
## ๐ Documentation
The codebase includes detailed comments explaining each implementation. Additionally, there's a comprehensive explanation of the React DOM rendering process at the bottom of the main.js file.
## ๐งช Testing
To test the implementations:
1. Clone the repository
2. Open the code in your preferred JavaScript environment
3. Run the test cases provided in the comments
4. Use the browser console or Node.js REPL to experiment with the functions
## ๐ค Contributing
Feel free to submit issues and enhancement requests!
## ๐ License
This project is licensed under the MIT License - see the LICENSE file for details.