Welcome to the 150 Interview Questions repository! This collection is designed to help you prepare for technical interviews by solving a curated list of problems from LeetCode and other popular coding platforms. Each problem is carefully selected to cover key topics and patterns that are frequently asked in coding interviews.
The repository is organized into different categories based on the type of problems:
- Array
- String
- Linked List
- Tree
- Dynamic Programming
- Sorting and Searching
- Recursion
- Backtracking
- Math
- Greedy
- Graph
- Others
Each problem folder contains:
- Problem Description: A detailed explanation of the problem statement, including input and output formats, and examples.
- Solution: The implemented solution in Python (or any other language).
- Explanation: A step-by-step explanation of the approach and logic used to solve the problem.
Problem Description:
Given an integer array nums and an integer val, remove all occurrences of val in-place and return the new length of the array.
Example:
Input: nums = [3, 2, 2, 3], val = 3
Output: 2, nums = [2, 2, _, _]
Solution:
The function iterates over the array, shifting elements that are not equal to val to the front. The resulting array contains all elements except val, and the function returns the new length.
Clone the Repository:
git clone https://github.com/superALLEY/150InterviewQuestions.git
Navigate to a Problem Category:
Browse through the folders to find the problem you want to solve or study.
Run the Solutions:
Open the solution files in your favorite IDE and run them to see the results. Each solution is tested with various test cases.
Contributions are always welcome! If you have solved a problem that isn't included in this list or have a more efficient solution, please consider contributing:
- Fork the repo
- Create a new branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This repository is licensed under the MIT License. Feel free to use the code for learning and interview preparation.
Happy coding!