Skip to content

A curated collection of JavaScript code snippets, algorithms, mini-projects, and practice challenges to enhance coding skills. Explore concepts in vanilla JavaScript, frameworks, LeetCode problems, and more through hands-on practice.

License

Notifications You must be signed in to change notification settings

Ritahchanger/Javascript-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

99 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

JavaScript Playground

A comprehensive collection of JavaScript, TypeScript, React, and Node.js projects, algorithms, and coding challenges. This repository serves as both a learning resource and a reference for various programming concepts and implementations.

Table of Contents

Overview

This repository contains a wide range of JavaScript projects, from fundamental concepts to advanced implementations. Whether you're learning JavaScript, preparing for technical interviews, or building production applications, you'll find relevant examples and implementations here.

Repository Structure

Javascript-playground/
β”œβ”€β”€ DSA/                          # Data Structures & Algorithms
β”œβ”€β”€ Leetcode/                     # LeetCode problem solutions
β”œβ”€β”€ amazon/                       # Amazon interview questions
β”œβ”€β”€ codility/                     # Codility challenges
β”œβ”€β”€ arrays/                       # Array manipulation problems
β”œβ”€β”€ strings/                      # String algorithms
β”œβ”€β”€ objects/                      # Object-oriented programming
β”œβ”€β”€ hooks/                        # React Hooks examples
β”œβ”€β”€ statemanagement/              # State management patterns
β”œβ”€β”€ advancedstatemanagement/      # Advanced state management
β”œβ”€β”€ react-tuto/                   # React tutorials
β”œβ”€β”€ frontendJS/                   # Frontend JavaScript concepts
β”œβ”€β”€ backendjs/                    # Backend JavaScript/Node.js
β”œβ”€β”€ node1/                        # Node.js projects
β”œβ”€β”€ nodecore/                     # Node.js core concepts
β”œβ”€β”€ apis/                         # API implementations
β”œβ”€β”€ oauth/                        # OAuth authentication
β”œβ”€β”€ githubAuth/                   # GitHub authentication
β”œβ”€β”€ social_authentication/        # Social auth integrations
β”œβ”€β”€ rolesbased/                   # Role-based access control
β”œβ”€β”€ Caching/                      # Caching strategies
β”œβ”€β”€ usingPrisma/                  # Prisma ORM examples
β”œβ”€β”€ animations/                   # Animation projects
β”œβ”€β”€ forms/                        # Form handling
β”œβ”€β”€ filesH/                       # File handling
β”œβ”€β”€ media/                        # Media processing
β”œβ”€β”€ SimpleGames/                  # Simple game implementations
β”œβ”€β”€ modernlandingpage/            # Modern landing page designs
β”œβ”€β”€ web-meeting-server1/          # Web meeting server
β”œβ”€β”€ Todo2/                        # Todo application v2
β”œβ”€β”€ todoApp/                      # Todo application
β”œβ”€β”€ Ts/                          # TypeScript projects
β”œβ”€β”€ classes/                      # JavaScript classes
β”œβ”€β”€ corejs/                       # Core JavaScript concepts
β”œβ”€β”€ General/                      # General programming concepts
β”œβ”€β”€ js1/                         # JavaScript fundamentals
β”œβ”€β”€ Hoisting/                    # Hoisting concepts
β”œβ”€β”€ ErrorHandling/               # Error handling patterns
β”œβ”€β”€ preparations/                # Interview preparations
└── LICENSE

Core Topics

Data Structures & Algorithms

Fundamental data structures and algorithms implementations.

Solutions to LeetCode problems with detailed explanations.

Key Solutions:

  • Array problems (Two Sum, Merge Sorted Arrays, Maximum Subarray)
  • String problems (Longest Substring, Anagram Checker, Valid Parenthesis)
  • Linked Lists (Reverse Linked List, Merge Lists)
  • Trees (Binary Search, DFS/BFS, Traversals)
  • Dynamic Programming (Coin Change, Climbing Stairs, Kadane's Algorithm)
  • Sorting Algorithms (Quick Sort, Merge Sort, Binary Search)
  • Hash Tables (LRU Cache, Majority Element)
  • Stacks & Queues
  • Sliding Window problems
  • Matrix problems (Spiral Matrix, Number of Islands)

Files Include:

  • AddNumbers.js, AnagramChecker.js, ArrayChunking.js
  • Binary.js, climb.js, CoinsChange.js
  • debouncing.js, dfs.js, duplicates.js
  • EventLoopAndConcurrency.js, Factorial.js, Fibonnaci.js
  • KadanesAlgorithm.js, LongestSubstring.js, LruCache.js
  • MergeSortedArrays.js, MergeSort.js, QuickSort.js
  • ReverseLinkedList.js, spiralMatrix.js, Sudoku.js
  • validParenthesis.js, and many more!

Common interview questions asked at Amazon.

  • LRU Cache implementation
  • Merge Sorted Arrays
  • Reverse Linked List
  • Tree problems
  • Two Sum variants

Solutions to Codility coding challenges.

  • BinaryGap.js - Binary representation problems
  • FrogRiverOne.js - Array traversal
  • MaxCounters.js - Counter operations
  • PassingCars.js - Prefix sums
  • PermCheck.js - Permutation checking
  • RateLimiter.js - Rate limiting implementation
  • TapeEquilibrium.js - Array splitting

Array manipulation techniques and algorithms.

String processing and manipulation problems.

βš›οΈ React & Frontend

Comprehensive React.js tutorials and examples.

React Hooks implementations and patterns.

  • useState, useEffect, useContext
  • Custom hooks
  • Hook composition

Basic state management patterns in React.

Advanced state management techniques.

  • Redux patterns
  • Context API advanced usage
  • State machines
  • Zustand, Recoil implementations

Frontend-specific JavaScript concepts.

  • DOM manipulation
  • Event handling
  • Browser APIs
  • Performance optimization

Animation implementations and libraries.

  • CSS animations
  • JavaScript animations
  • Animation libraries

Form handling and validation.

Modern landing page designs and implementations.

πŸ”§ Backend & Node.js

Backend JavaScript concepts and implementations.

Various Node.js project implementations.

Core Node.js concepts and modules.

  • Event loop
  • Streams
  • Buffer
  • File system
  • Networking

API development and integration.

  • RESTful APIs
  • GraphQL
  • API design patterns

Prisma ORM examples and best practices.

  • Schema design
  • Migrations
  • Queries
  • Relations

Caching strategies and implementations.

  • In-memory caching
  • Redis integration
  • Cache invalidation strategies

Authentication & Security

OAuth implementation examples.

GitHub OAuth integration.

Social media authentication implementations.

  • Google Auth
  • Facebook Auth
  • Twitter Auth

Role-based access control (RBAC) implementations.

πŸ“± Applications

Full-featured todo application.

Enhanced version of todo application.

Simple game implementations in JavaScript.

Web-based meeting server implementation.

πŸ’» Core JavaScript Concepts

Fundamental JavaScript concepts.

Basic JavaScript programming concepts.

JavaScript classes and OOP.

Object-oriented programming in JavaScript.

Understanding JavaScript hoisting.

Error handling patterns and best practices.

General programming concepts and patterns.

πŸ“˜ TypeScript

TypeScript implementations and examples.

  • Type definitions
  • Interfaces
  • Generics
  • Advanced types

Interview Preparation

Interview preparation materials and strategies.

Learning Path

graph TD
    A[Start Here] --> B[Core JavaScript]
    B --> C[js1 - Fundamentals]
    B --> D[corejs - Core Concepts]
    B --> E[classes - OOP]
    
    C --> F[DSA Basics]
    F --> G[arrays]
    F --> H[strings]
    F --> I[objects]
    
    G --> J[Algorithm Practice]
    J --> K[Leetcode]
    J --> L[codility]
    J --> M[amazon]
    
    D --> N[Advanced Concepts]
    N --> O[Hoisting]
    N --> P[ErrorHandling]
    N --> Q[EventLoop]
    
    E --> R[Frontend Development]
    R --> S[frontendJS]
    R --> T[React Tutorials]
    T --> U[hooks]
    U --> V[statemanagement]
    V --> W[advancedstatemanagement]
    
    D --> X[Backend Development]
    X --> Y[node1]
    Y --> Z[nodecore]
    Z --> AA[backendjs]
    AA --> AB[apis]
    
    AB --> AC[Database & Auth]
    AC --> AD[usingPrisma]
    AC --> AE[oauth]
    AC --> AF[Caching]
    
    K --> AG[Interview Prep]
    AF --> AG
    AG --> AH[preparations]
Loading

Getting Started

Prerequisites

# Node.js and npm should be installed
node --version
npm --version

Quick Start

  1. Clone the repository
git clone https://github.com/Ritahchanger/Javascript-playground.git
cd Javascript-playground
  1. Choose a topic to explore
# For DSA practice
cd Leetcode

# For React learning
cd react-tuto

# For backend development
cd nodecore

# For interview prep
cd preparations
  1. Run examples
# For Node.js files
node filename.js

# For projects with package.json
npm install
npm start

Project Categories

πŸŽ“ Learning & Practice

πŸ’Ό Interview Preparation

πŸ—οΈ Full Projects

πŸ“š Tutorials & Guides

Common Algorithms & Patterns

Array Algorithms

  • Two Pointers
  • Sliding Window
  • Prefix Sum
  • Binary Search
  • Sorting algorithms

String Algorithms

  • Pattern matching
  • String manipulation
  • Anagram detection
  • Palindrome checking

Tree Algorithms

  • DFS (Depth First Search)
  • BFS (Breadth First Search)
  • Tree traversals (Inorder, Preorder, Postorder)
  • Binary Search Trees

Dynamic Programming

  • Fibonacci sequences
  • Coin change problems
  • Climbing stairs
  • Kadane's algorithm

Data Structures

  • Arrays & Hash Tables
  • Linked Lists
  • Stacks & Queues
  • Trees & Graphs
  • Heaps

Key Concepts Covered

JavaScript Fundamentals

  • Variables & Scoping
  • Functions & Closures
  • Prototypes & Inheritance
  • Async/Await & Promises
  • Event Loop & Concurrency
  • Currying & Functional Programming
  • This keyword & Context
  • WeakMap & Map

React Concepts

  • Component lifecycle
  • State management
  • Hooks (useState, useEffect, useContext, custom hooks)
  • Context API
  • Redux patterns
  • Performance optimization

Node.js Concepts

  • Event-driven architecture
  • Streams & Buffers
  • File system operations
  • HTTP servers
  • Express.js
  • Database integration

System Design Patterns

  • Caching strategies
  • Rate limiting
  • Authentication & Authorization
  • API design
  • Error handling
  • Logging & Monitoring

Code Quality

Best Practices

  • Clean code principles
  • SOLID principles
  • DRY (Don't Repeat Yourself)
  • Error handling
  • Code documentation
  • Testing strategies

Performance

  • Time complexity analysis
  • Space complexity analysis
  • Algorithm optimization
  • Memoization
  • Debouncing & Throttling

Useful Commands

# Navigate to specific topics
cd DSA/
cd Leetcode/
cd react-tuto/

# Run JavaScript files
node filename.js

# For React projects
npm install
npm start

# For Node.js projects
npm install
node index.js

Study Recommendations

Week 1-2: Fundamentals

  1. Start with js1 - JavaScript basics
  2. Explore corejs - Core concepts
  3. Practice arrays - Array manipulation
  4. Study strings - String operations

Week 3-4: Data Structures

  1. DSA - Fundamental structures
  2. Leetcode - Easy problems
  3. Practice with codility

Week 5-6: Advanced Algorithms

  1. Continue Leetcode - Medium problems
  2. Study amazon - Interview questions
  3. Master sorting and searching algorithms

Week 7-8: Frontend Development

  1. React Tutorials
  2. Hooks implementation
  3. State Management
  4. Advanced State Management

Week 9-10: Backend Development

  1. Node.js Core
  2. Backend JS
  3. APIs
  4. Using Prisma

Week 11-12: System Design & Auth

  1. Caching strategies
  2. OAuth & Social Authentication
  3. Role-Based Access
  4. Build full-stack projects

Resources

Internal Documentation

  • Check individual directory README files for specific topics
  • Review code comments for implementation details
  • Examine test files for usage examples

πŸŽ₯ Recommended Tutorials

Tutorial 1 Tutorial 2
JavaScript Tutorial Advanced JavaScript

πŸ‘‰ Click any banner to watch the video.

File Handling

Interview Resources

Contributing

Contributions are welcome! Here's how you can help:

  1. Add new problems/solutions

    • Place them in the appropriate directory
    • Include comments explaining the approach
    • Add time/space complexity analysis
  2. Improve existing solutions

    • Optimize algorithms
    • Add alternative approaches
    • Improve documentation
  3. Create new projects

    • Build example applications
    • Add tutorials
    • Create learning resources
  4. Fix bugs

    • Report issues
    • Submit pull requests
    • Improve error handling

Project Status

This is an active learning repository that is continuously updated with new problems, solutions, and projects.

License

See LICENSE file for details.


Quick Reference

Most Popular Directories

Common Patterns to Study

  • Array: Two pointers, sliding window, prefix sum
  • String: Pattern matching, palindromes, anagrams
  • Trees: DFS, BFS, traversals
  • Dynamic Programming: Memoization, tabulation
  • Graphs: Traversal, shortest path, cycles

Time Complexity Cheat Sheet

  • O(1) - Constant time
  • O(log n) - Logarithmic (Binary search)
  • O(n) - Linear (Array traversal)
  • O(n log n) - Linearithmic (Merge sort, Quick sort)
  • O(nΒ²) - Quadratic (Nested loops)
  • O(2ⁿ) - Exponential (Recursive Fibonacci)

Happy Coding! πŸŽ‰

Start exploring the directories and happy learning! For questions or suggestions, please open an issue.

About

A curated collection of JavaScript code snippets, algorithms, mini-projects, and practice challenges to enhance coding skills. Explore concepts in vanilla JavaScript, frameworks, LeetCode problems, and more through hands-on practice.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published