Skip to content

Structured curated collection of the ~100 most relevant Data Structures & Algorithms (DSA) coding problems and their solutions, organized by fields, sub-fields, classes of problems and difficulty levels. Includes explanations of all DSA concepts.

Notifications You must be signed in to change notification settings

alvarosf07/computer-science-DSA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DSA-OPC - Data Structures & Algorithms - Optimized Problem Collection

Welcome to the Data Structures & Algorithms Optimized Problem Collection!

This repository houses my personal structured and curated collection of the most relevant DSA problems, extracted from reputable sources like LeetCode, HackerRank, Elements of Programming Interviews...


1. Motivation

Many people do more than 500 coding questions to prepare for coding interviews. It is NOT NECESSARY to do this. After reviewing many different sources (LeetCode, HackerRank, GeeksforGeeks, Elements of Programming Interviews...) I have put together a curated selection of the ~100 most relevant DSA problems and their solutions, organized by fields, sub-fields, classes of problems and difficulty levels.

This collection aims to simplify the learning curve to prepare for DSA coding interviews, by providing a structured and optimized selection of 5-10 problems for each DSA category that will help understand the "general type" of questions, focusing only on the 20% of problems that matter the most and reducing workload by 80%.

Author's Note:

There are plenty of "Best lists" for DSA that can be found online (see resources below). The purpose of this repository is not to be the "ultimate" collection of DSA problems. I decided to create this collection to better understand the field of DSA while I was preparing for coding interviews, and help others do the same for free. It includes problems that I've come across and I've found most relevant from my personal point of view. At the same time, it's organized following a structure I personally find intuitive and practical for the global understanding of Data Structures and Algorithms, but it doesn't intend to be a 100% unique representation of reality.

With that being said, and although this collection is designed based on my personal understanding of the subject, I'm more than happy to receive feedback, suggestions and improvements that can help the community in any way!


2. Features

  • Curated Selection: I've handpicked the most relevant problems to ensure you focus your time and effort on mastering essential concepts.
  • Optimized Learning: The collection is designed with the 80/20 principle in mind: focusing on achieving 80% of the learning with just 20% of the effort, saving you valuable time and energy.
  • Structured Learning Path: The collection follows a progressive learning path, guiding you through increasingly challenging problems to build your skills step by step.
  • Versatile Content: Whether you're a beginner starting your DSA journey or an experienced programmer looking to sharpen your skills, I believe this collection can be helpful for you in some way.

3. Contents & Organization

DSA problems are classified into fields, sub-fields, classes of problems and difficulty levels.

3.1. Fields & Subfields

DSA problems are classified into 5 fields, with its own sub-fields:

  1. Abstract Data Types

  2. Data Structures

  3. Algorithms

  4. Systems Design (still work in progress)

  5. Coding Interview Problems


3.2. Classes of Problems (& Difficulty Levels)

Within each sub-field, problems are classified according to 4 main classes, which encompass different objectives and difficulty levels:

  1. Foundational Problems
  2. Aim to provide a general introduction to the sub-field, and present the basic operations and functionalities in the form of short and to-the-point exercises. Foundational problems are not usually asked in practical coding interviews, but can be asked sometimes as part of "theoretical understanding" of a specific data-type or data-structure. In this repository, foundational problems are only introduced for Python at the moment, but some other languages (JAVA, C++) may be added in the future.

  1. Easy Problems
  2. Easy problems include practical questions that involve using the properties/advantages of the sub-field of study. They're ideal to tackle right after the foundational problems to strengthen the understanding of the DSA sub-field. Easy problems are commonly asked as introductory questions in early/middle round coding interviews, and should take between 5-20 min to complete.

  1. Medium Problems
  2. Medium problems are challenging problems that already require a decent level of skill using a specific DSA sub-field. They usually involve using a specific type of algorithm that works well for a particular set of problems. Medium problems are typically the ones that you can expect as "main question" in most coding interviews. They typically take between 15-40 min to solve for the first time.

  1. Hard Problems
  2. Hard problems are very challenging (and tricky) problems that require not only a good mastery of the specific DSA sub-field, but also good knowledge and skills with algorithms and most importantly: good coding intuition. Most of the hard problems require realizing a certain trick or alternative formulation that makes the question easier to solve. Hard problems are asked in coding interviews mainly oriented to heavy software-developer roles, or certain positions in finance that require strong problem-solving skills. Depending on the coding expertise, hard problems can take from 15 minutes to several hours to solve; although is common to give up before finding a solution. For time optimization purposes, it's recommended to look at the answer to hard problems if no meaningful progress towards the solution has been made after 30-40 minutes.

3.3. Solutions

All the problems presented in the collection include solutions. The main programming languages of the solutions are Python, JAVA and C++:

  • Solutions for the foundational problems are available only in Python at the moment.
  • Solutions for all the problems (easy, medium and hard) are usually available in Python, JAVA and C++ (except a few cases where only Python is available).

Solutions for the problems are not all my own, but usually a combination of my personal implementation and the best solutions I've found for each problem. I've made an effort to reference the original source of the answer for those problems/solutions that are not my own, but feedback is appreciated if this is not the case for some problems.


4. Getting Started

  1. Explore Categories: Browse through the organized categories to find problems that align with your interests and skill level.
  2. Challenge Yourself: Dive into the problems, solve them, and test your understanding of key DSA concepts.
  3. Track Your Progress: Keep track of your progress as you tackle each problem, and celebrate your achievements along the way.

5. Contributing

Contributions from the community to enhance and improve the problem collection are more than welcome! If you have suggestions for additional problems, improvements to existing ones, or any other feedback, please feel free to contribute!


6. Resources

DSA Books:

DSA Learning Websites:

DSA Courses:

DSA Coding Platforms:

DSA Interviews Prep:

DSA Problems "Best Lists":

DSA Resources:


Let's Get Started!

Ready to embark on your journey to DSA mastery? Explore the collection, challenge yourself with the problems, and let's take your programming skills to new heights together!

Happy coding! 🚀

About

Structured curated collection of the ~100 most relevant Data Structures & Algorithms (DSA) coding problems and their solutions, organized by fields, sub-fields, classes of problems and difficulty levels. Includes explanations of all DSA concepts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published