{"id":19459900,"url":"https://github.com/hamza-rafique/javascript-interview-questions","last_synced_at":"2026-02-04T10:42:17.900Z","repository":{"id":128278216,"uuid":"584840490","full_name":"Hamza-Rafique/JavaScript-Interview-Questions","owner":"Hamza-Rafique","description":"JavaScript Interview Question with Coding Example one by one in detials","archived":false,"fork":false,"pushed_at":"2024-09-17T04:31:18.000Z","size":38,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-25T07:35:40.582Z","etag":null,"topics":["interview-questions-javascript","javascript","javascript-basic-programming","javascript-interview-questions","javascript-interview-questions-and-answers","most-important-topic-javascript"],"latest_commit_sha":null,"homepage":"https://java-script-interview-questions.vercel.app","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hamza-Rafique.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-03T16:44:30.000Z","updated_at":"2024-09-18T06:41:59.000Z","dependencies_parsed_at":"2024-01-11T10:27:48.727Z","dependency_job_id":"1fff7601-80fb-489c-ab2a-b8d7e1126ddb","html_url":"https://github.com/Hamza-Rafique/JavaScript-Interview-Questions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Hamza-Rafique/JavaScript-Interview-Questions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamza-Rafique%2FJavaScript-Interview-Questions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamza-Rafique%2FJavaScript-Interview-Questions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamza-Rafique%2FJavaScript-Interview-Questions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamza-Rafique%2FJavaScript-Interview-Questions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hamza-Rafique","download_url":"https://codeload.github.com/Hamza-Rafique/JavaScript-Interview-Questions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamza-Rafique%2FJavaScript-Interview-Questions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262916575,"owners_count":23383883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["interview-questions-javascript","javascript","javascript-basic-programming","javascript-interview-questions","javascript-interview-questions-and-answers","most-important-topic-javascript"],"created_at":"2024-11-10T17:34:27.238Z","updated_at":"2026-02-04T10:42:12.880Z","avatar_url":"https://github.com/Hamza-Rafique.png","language":"HTML","readme":"# JavaScript Interview and Coding Challenges\n\nThis repository contains JavaScript coding examples, interview questions, and solutions. The goal is to help prepare for JavaScript-related technical interviews by practicing coding challenges and understanding basic concepts.\n\n## Topics Covered\n\n### 1. `call`, `apply`, and `bind` Methods\n- **Description**: Explanation and examples of `call`, `apply`, and `bind` methods in JavaScript.\n- **Usage**: Demonstrates how to change the context (`this`) of a function using these methods.\n\n### 2. Count Character Occurrences\n- **Description**: A function to count the number of occurrences of each character in a string.\n- **Use Case**: Useful for string manipulation questions in interviews.\n\n### 3. Currying in JavaScript\n- **Description**: Explanation of currying, a functional programming technique where a function is transformed into a sequence of functions, each taking a single argument.\n- **Example**: Practical examples showing how currying can be used to break down functions into smaller, reusable ones.\n\n### 4. Find Duplicate Number in an Array\n- **Description**: A solution to find duplicate numbers in an array.\n- **Example**: Covers different methods of finding duplicates, such as using sets and hash maps.\n\n### 5. Find Factorial of a Number\n- **Description**: A function to compute the factorial of a given number using recursion and iteration.\n- **Example**: Includes optimized solutions for factorial calculations.\n\n### 6. Find Greatest Common Divisor (GCD)\n- **Description**: A function to compute the GCD of two numbers using the Euclidean algorithm.\n- **Example**: Shows how to use recursion to find the GCD efficiently.\n\n### 7. Find Max and Min Value in an Array\n- **Description**: A function to find both the maximum and minimum values in an array.\n- **Example**: Covers multiple approaches, including sorting and using array methods.\n\n### 8. Find Missing Value in an Array\n- **Description**: Solutions for finding the missing value in an arithmetic progression (AP) array.\n- **Example**: Uses mathematical formulas and loops to solve the problem.\n\n### 9. Find Peak Element\n- **Description**: A function to find the peak element (an element that is greater than its neighbors) in an array.\n- **Example**: Demonstrates how to use binary search for optimal performance.\n\n### 10. Find Sum of Elements in an Array\n- **Description**: A function to calculate the sum of all elements in an array.\n- **Example**: Uses array methods like `reduce` for summing values.\n\n### 11. Reverse an Array\n- **Description**: A function to reverse the elements in an array.\n- **Example**: Covers both in-place and array copying techniques.\n\n### 12. Sort Array\n- **Description**: Solutions for sorting an array using different algorithms like quicksort, mergesort, and native JavaScript methods.\n- **Example**: Highlights the time complexity of various sorting methods.\n\n### 13. String Questions\n- **Description**: Various string manipulation questions, including reversing a string, checking for palindromes, and more.\n- **Example**: Includes multiple techniques for solving common string problems.\n\n### 14. Map, Reduce, and Filter Methods\n- **Description**: Explanation and coding examples of JavaScript’s array methods: `map`, `reduce`, and `filter`.\n- **Usage**: Shows how to use these methods for functional programming.\n\n### 15. Find Longest String in an Array\n- **Description**: A solution to find the longest string in an array.\n- **Example**: Demonstrates how to iterate over an array to find the longest string efficiently.\n\n### 16. Generate Fibonacci Sequence\n- **Description**: Functions to generate Fibonacci numbers using both recursion and iteration.\n- **Example**: Includes optimized approaches for generating large Fibonacci sequences.\n\n### 17. Prime Number Checker\n- **Description**: A function to check whether a given number is prime.\n- **Example**: Includes optimized solutions for large numbers, using trial division and efficient loop bounds.\n\n### 18. Undefined vs Not Defined\n- **Description**: Explanation of the difference between `undefined` and variables that are not defined in JavaScript.\n- **Example**: Clarifies common interview questions about these terms.\n\n## How to Use\n\nClone the repository:\n\n```bash\ngit clone https://github.com/your-repo/javascript-coding-challenges.git\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamza-rafique%2Fjavascript-interview-questions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamza-rafique%2Fjavascript-interview-questions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamza-rafique%2Fjavascript-interview-questions/lists"}