Skip to content

Latest commit

 

History

History
222 lines (154 loc) · 11.6 KB

File metadata and controls

222 lines (154 loc) · 11.6 KB

Basic JavaScript Challenges:

  1. Write a function that adds two numbers.
  2. Write a function that subtracts two numbers.
  3. Write a function that multiplies two numbers.
  4. Write a function that divides two numbers.
  5. Write a function that calculates the square of a number.
  6. Write a function to find the maximum of two numbers.
  7. Write a function to find the minimum of two numbers.
  8. Write a function to check if a number is even or odd.
  9. Write a function to check if a number is prime.
  10. Write a function to find the factorial of a number.

Array Challenges:

  1. Write a function to find the sum of all elements in an array.
  2. Write a function to find the average of all elements in an array.
  3. Write a function to reverse an array.
  4. Write a function to check if an array is sorted in ascending order.
  5. Write a function to remove duplicates from an array.
  6. Write a function to find the intersection of two arrays.
  7. Write a function to merge two sorted arrays.
  8. Write a function to count the occurrences of an element in an array.
  9. Write a function to find the largest and smallest elements in an array.
  10. Write a function to rotate an array to the left by a specified number of positions.

String Challenges:

  1. Write a function to reverse a string.
  2. Write a function to check if a string is a palindrome.
  3. Write a function to count the number of vowels in a string.
  4. Write a function to find the longest word in a string.
  5. Write a function to capitalize the first letter of each word in a string.
  6. Write a function to check if two strings are anagrams.
  7. Write a function to remove all spaces from a string.
  8. Write a function to find the first non-repeated character in a string.
  9. Write a function to check if a string contains only numbers.
  10. Write a function to count the occurrences of a word in a string.

Object Challenges:

  1. Create an object representing a person with name, age, and address properties.
  2. Write a function to list all the keys of an object.
  3. Write a function to list all the values of an object.
  4. Write a function to merge two objects into one.
  5. Write a function to check if a key exists in an object.
  6. Write a function to remove a key from an object.
  7. Write a function to deep clone an object.
  8. Write a function to calculate the total age of people in an array of person objects.
  9. Write a function to find the youngest person in an array of person objects.
  10. Write a function to convert an array of objects into a single object with key-value pairs.

Functional Programming Challenges:

  1. Write a function to implement map function.
  2. Write a function to implement filter function.
  3. Write a function to implement reduce function.
  4. Write a function to implement the forEach function.
  5. Write a function to implement the some function.
  6. Write a function to implement the every function.
  7. Write a function to implement a simple debounce function.
  8. Write a function to implement a simple throttle function.
  9. Write a function to compose two functions.
  10. Write a function to curry a function.

Advanced JavaScript Challenges:

  1. Implement a promise-based function to make an HTTP GET request.
  2. Write a function to implement a simple event emitter.
  3. Create a function to flatten a nested array.
  4. Write a function to implement memoization for a given function.
  5. Create a function to perform deep comparison of two objects.
  6. Write a function to find the shortest path in a graph using Dijkstra's algorithm.
  7. Create a function to generate a unique identifier (UUID).
  8. Write a function to find the common elements in multiple arrays.
  9. Create a function to implement a basic Pub/Sub pattern.
  10. Write a function to implement a basic routing system for a single-page application.

DOM and Web Development Challenges:

  1. Create a simple image carousel using HTML, CSS, and JavaScript.
  2. Implement a form validation function to validate email, password, and other inputs.
  3. Write a function to fetch data from an API and display it on a web page.
  4. Create a responsive navigation menu using CSS and JavaScript.
  5. Implement infinite scrolling on a web page using the Intersection Observer API.
  6. Create a real-time chat application using WebSockets.
  7. Build a simple to-do list application with add, edit, and delete functionalities.
  8. Implement a drag-and-drop feature for reordering items on a web page.
  9. Create a modal dialog that can be opened and closed with a button click.
  10. Implement lazy loading for images on a web page to improve performance.

Testing Challenges:

  1. Write unit tests for a simple math library (add, subtract, multiply, divide).
  2. Implement tests for a function that reverses an array.
  3. Write tests for a function that checks if a string is a palindrome.
  4. Create tests for a function that merges two sorted arrays.
  5. Implement tests for an API request function using a testing library (e.g., Jest).
  6. Write tests for a function that calculates the factorial of a number.
  7. Create tests for a function that validates email addresses.
  8. Implement tests for a function that counts the number of vowels in a string.
  9. Write tests for a function that removes duplicates from an array.
  10. Create tests for a function that calculates the average of numbers in an array.

Concurrency and Asynchronous Challenges:

  1. Write a function to fetch data from multiple APIs in parallel and combine the results.
  2. Implement a simple promise-based task queue for managing concurrent tasks.
  3. Create a function to simulate asynchronous file uploads and track progress.
  4. Write a function to perform parallel processing of a large array using web workers.
  5. Implement a function to synchronize access to a shared resource using semaphores.
  6. Write a function to perform asynchronous image loading and display images as they load.
  7. Create a function to implement a basic promise-based throttle mechanism.
  8. Implement a function to handle race conditions in a concurrent program.
  9. Write a function to simulate a producer-consumer problem using asynchronous queues.
  10. Create a function to perform parallel computation of a complex task and merge the results.

Security and Performance Challenges:

  1. Write a function to sanitize user input to prevent cross-site scripting (XSS) attacks.
  2. Implement a function to hash and salt passwords for secure storage.
  3. Write a function to prevent SQL injection in database queries.
  4. Create a function to optimize the loading of external scripts and resources.
  5. Implement a function to secure user authentication using JSON Web Tokens (JWT).
  6. Write a function to protect against brute force attacks on login forms.
  7. Implement a Content Security Policy (CSP) for a web application.
  8. Create a function to prevent clickjacking attacks using X-Frame-Options headers.
  9. Implement a function to protect against cross-site request forgery (CSRF) attacks.
  10. Write a function to detect and prevent security vulnerabilities in third-party libraries and dependencies.

Advanced Algorithm Challenges:

  1. Longest Substring Without Repeating Characters: Write a function to find the longest substring without repeating characters in a given string.

  2. Sudoku Solver: Create a program that can solve a Sudoku puzzle.

  3. A Pathfinding Algorithm:* Implement the A* pathfinding algorithm to find the shortest path in a grid.

  4. Knapsack Problem: Solve the 0/1 Knapsack problem using dynamic programming.

  5. Traveling Salesman Problem: Create an algorithm to find the shortest route that visits a set of cities and returns to the starting city.

  6. Conway's Game of Life: Implement Conway's Game of Life, a cellular automaton simulation.

  7. Optimal Change: Write a function to calculate the optimal way to make change for a given amount of money using the fewest coins.

  8. Graph Traversal: Create a function to perform depth-first search (DFS) and breadth-first search (BFS) on a graph.

  9. Big Integer Arithmetic: Implement arithmetic operations for big integers (numbers larger than JavaScript's Number type).

  10. Heap Implementation: Write a class to create and manipulate a binary heap (min-heap or max-heap).

Advanced Data Structures:

  1. Trie Implementation: Create a trie data structure for efficient string search and autocomplete.

  2. Bloom Filter: Implement a Bloom filter, a probabilistic data structure for membership testing.

  3. Red-Black Tree: Implement a Red-Black Tree and perform insertions, deletions, and searches.

  4. LRU Cache: Create an LRU (Least Recently Used) cache with a fixed size.

  5. Suffix Tree: Implement a suffix tree, a data structure for efficient substring searches.

  6. Skip List: Create a skip list data structure for fast search and insert operations.

  7. Fenwick Tree (Binary Indexed Tree): Implement a Fenwick Tree for efficient range sum queries.

  8. B-Tree: Create a B-tree data structure and implement insertion, deletion, and search operations.

  9. Priority Queue: Implement a priority queue data structure using a binary heap or other techniques.

  10. Bloom Filter Set Operations: Extend the Bloom filter to perform set operations (union, intersection, etc.).

Concurrency and Parallelism:

  1. Web Workers: Use Web Workers to parallelize a time-consuming task in a web application.

  2. Async/Await Parallel Processing: Implement parallel processing of asynchronous tasks using async/await.

  3. Shared Memory and Atomics: Create a multi-threaded JavaScript program using shared memory and atomic operations.

  4. Race Conditions Handling: Write code to handle and prevent race conditions in a concurrent environment.

  5. Parallel MapReduce: Implement a parallel MapReduce framework for distributed processing.

  6. Asynchronous Generators: Use asynchronous generators to process a large dataset without loading it all into memory.

  7. Task Scheduling: Create a task scheduler that can execute tasks in a specific order or with dependencies.

  8. Rate Limiting: Implement a rate-limiting mechanism to control how often a function or API can be called.

  9. Parallel Merge Sort: Write a parallel merge sort algorithm to sort large arrays more efficiently.

  10. Deadlock Detection: Create a program to detect and handle deadlocks in a concurrent system.

Security Challenges:

  1. Cross-Site Scripting (XSS) Challenge: Try to exploit and then protect against XSS vulnerabilities in a web application.

  2. SQL Injection Challenge: Attempt to exploit and then secure a vulnerable SQL query in a web application.

  3. Secure Session Management: Create a secure session management system with proper session handling, validation, and encryption.

  4. JWT Token Security: Test the security of a JSON Web Token (JWT) implementation and implement best practices.

  5. CORS Bypass: Try to bypass Cross-Origin Resource Sharing (CORS) restrictions and then secure the application.

  6. Password Cracking: Implement a program to crack hashed passwords and then discuss password security best practices.

  7. Authentication Bypass: Attempt to bypass authentication mechanisms in a web application and discuss mitigation techniques.

  8. Security Headers Implementation: Configure and test various security headers, such as Content Security Policy (CSP) and HTTP Strict Transport Security (HSTS).

  9. Secure API Authentication: Create a secure API authentication system using OAuth 2.0 or OpenID Connect.

  10. Buffer Overflow Challenge: Attempt to exploit a buffer overflow vulnerability in a simple C program and discuss buffer overflow prevention.