Welcome to the interview_practice repository! This repository is designed to be a comprehensive resource for coding interview questions across various programming languages, starting with JavaScript. Whether you're preparing for an interview or simply honing your coding skills, this collection of problems and solutions will help you get ready for technical interviews.
The goal of this repository is to provide clear, concise, and well-documented solutions to common coding interview questions. Each problem is accompanied by a corresponding solution in JavaScript, with plans to expand to other languages in the future.
This repository currently covers a range of topics, from basic string manipulation to more complex algorithmic challenges.
Here is a list of the questions currently included in the repository:
- Program to find the longest word in a given sentence
- How to check whether a string is a palindrome
- Program to remove duplicates from an array
- Program to reverse a string without using built-in methods
- Find the maximum count of consecutive 1's in an array
- Find the factorial of a given number
- Merge and sort two sorted arrays
- Check if every value in one array has its corresponding value squared in another array
- Check if one string can be formed by rearranging the letters of another string
- Get unique objects from an array of objects
- Find the maximum number in an array
- Return a new array with only the even numbers from an input array
- Check if a given number is prime
- Find the largest element in a nested array
- Generate the Fibonacci sequence up to a given number of terms
- Count the occurrences of each character in a string
- Sort an array of numbers in ascending order
- Sort an array of numbers in descending order
- Flatten a nested array into a single-dimensional array
Solutions written in JavaScript are located in the javascript/
directory with the question number and name as the filename for easy reference. Tests for each are located in javascript/test
directory.
Currently, the solutions are implemented in JavaScript. However, the repository is designed to be language-agnostic, with plans to add solutions in other popular programming languages, such as Python, Java, and C++.
As new languages are added, they will be organized into their respective directories.
Contributions are welcome! If you have a new solution, optimization, or a completely new question to add, feel free to fork the repository and submit a pull request. Please ensure your code is well-documented and follows the repository's structure.
To contribute:
- Fork the repo
- Create a new branch (
git checkout -b feature/your-feature
) - Commit your changes (
git commit -m 'Add some feature'
) - Push to the branch (
git push origin feature/your-feature
) - Open a pull request
- Expand Language Support: Add solutions in multiple programming languages.
- Add Difficulty Levels: Categorize questions by difficulty (Easy, Medium, Hard).
- Include Explanations: Provide detailed explanations and time complexity analysis for each solution.
- Interactive Practice: Integrate with online coding platforms for interactive problem-solving.