seanprashad / leetcode-patterns Goto Github PK
View Code? Open in Web Editor NEWA pattern-based approach for learning technical interview questions
Home Page: https://seanprashad.com/leetcode-patterns/
License: GNU General Public License v3.0
A pattern-based approach for learning technical interview questions
Home Page: https://seanprashad.com/leetcode-patterns/
License: GNU General Public License v3.0
Originally I had intended for this repo to be used solely by myself as I worked through questions over the past summer.
With the repo being open-sourced now, it makes sense to move my solutions to a solutions
branch, and convert the repo into a template repository so that others can create their own personal copy tailored to their individual journey.
Would it make more sense if pattern was a drop down?
Currently, each question is chosen to fit into a specific pattern, even if it might be applicable to other ones (ie. Some tree questions can be completed via DFS/BFS).
Original suggestion: Also, I see that currently there is only one pattern per LC problem, I would suggest we change it to an array and support multiple patterns per problem.
Originally posted by @mm1705 in #7 (comment)
Currently, if new questions are added here, then any user who visited the site prior to the addition will not be able to use the checkbox to mark off new questions as the array in their local storage won't have indexes for the new questions (ie. it will be short).
We should account for this and update the initialization to handle if the localStorage array already exists and differs in size, then we should create a new array, copy over the old values, and save it over the existing array.
Each question that is found in the list has a specific purpose on what the learning outcome/new technique an individual adds to their own toolkit.
For example, the Subsets
question introduces a Backtracking
skeleton, which can be almost copy-pasted for other similar questions, like Permutations
and Generate Parentheses
.
I think it'd be great to have a hidden field that reveals the intended learning outcome when clicked. It could also be a tooltip that displays the optimal time/space complexity in addition to a short blurb about the outcome.
So, there is a total number of questions present there, but I think it would be beneficial if we could also see the number of questions we have done, including the number of easy medium and hard questions number in the list. I think it would be pretty useful feature. Also, if it is approved, I would like to work upon it, too.
The current repo name, lc
, was used as it was short and easy for me to cd
into using z
.
For better visibility, we should consider renaming from lc
to leetcode-patterns
, leetcode-study-guide
, leetcode-pattern-study-guide
, or some other variant that better depicts to users the meaning/usage behind this repo.
Following steps to re-create this issue:
In the screenshot, one can see it filters out with Capital One and clearly disregard the "easy" difficulty filter. I think UI should either incorporate "smart filtering" - results considering both the filters OR reset the previously selected filter from the screen.
In #72, we combined the Name
and Url
column into one in order to nicely fit the Solutions
column, which linked to Leetcode Discuss.
As a result, filtering capability for the new Question
column (ie. the column meant to replace Name
and Url
) is broken since it's contents are now a custom function and we can't filter by plain text anymore (since it's a hyperlink now).
Remove Duplicates from Sorted List is listed twice.
For some of the premium questions, they have a trailing /
which is expected, since the regular questions all do. However for some questions, like Alien Dictionary, they don't have a trailing /
and so we have to append one so it's a valid URL.
However, the logic is incorrect for how we perform this:
A follow-up to #31 - let's show patterns for completed questions (denoted by the checkbox for the respective row).
TODO before my Leetcode Premium subscription runs out in a few days!
With the introduction of #22, we're now able to add multiple patterns per question. As a result, it'd be helpful to filter the question list by more than one pattern.
Investigate starting here: https://www.w3schools.com/tags/att_select_multiple.asp
Hi Sean, thanks for making this site and keeping it up to date. I've been going through the problems and I found that the Insert Interval question is a medium question in LeetCode, but its tagged as a hard question on your website.
It'd be helpful to show a small lock icon beside questions that are hidden behind Leetcode Premium!
#9 made me realize that the question list only looks 'sorted' since the source file, https://github.com/SeanPrashad/leetcode-patterns/blob/master/src/data/index.js, has the question list conveniently sorted already.
However, this will become a problem when we begin adding new questions that add to existing categories, essentially showing the questions out of place.
Let's look into using react-table
's UseSortBy
method to implement custom sorting by pattern, then difficulty, then question name.
As I filter anything, everything vanishes.
It is working fine on safari, but not on Google Chrome. Please check whats the issue.
Would be great to keep track of questions solved / total number of questions. Thanks.
Also, checkout: Striver's list if you're adding more problems to the list.
Why do I see two different sets of questions on different devices. One of my device shows questions like arrays and stuff early on while my laptop and pc both show questions in this order -
| | Contains Duplicate | https://leetcode.com/problems/contains-duplicate/ | Arrays | Easy |
| | Missing Number | https://leetcode.com/problems/missing-number/ | ArraysBit Manipulation | Easy |
| | Find All Numbers Disappeared in an Array | https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/ | Arrays | Easy |
| | Single Number | https://leetcode.com/problems/single-number/ | ArraysBit Manipulation | Easy |
| | Climbing Stairs | https://leetcode.com/problems/climbing-stairs/ | Dynamic Programming | Easy |
| | House Robber | https://leetcode.com/problems/house-robber/ | Dynamic Programming | Easy |
| | Best Time to Buy and Sell Stock | https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
DP question starts just at number 5 in this set.
Investigate if it is possible to freeze the headers for the table so it's possible to adjust filters when scrolling down the page.
If it is possible can you add some kind of tables where we can see how many easy/medium/hard questions we already done on the top of the page
https://leetcode.com/problems/target-sum/ is related to DP and DFS more and lesser to Backtracking.
Can we change it's tagging?
Hi, it would be helpful if one could filter questions by clicking on company logo or having a search bar near the company header to search for questions asked by a particular company or a set of companies.
another annoying update from yours truly :)
Currently, Companies
are shown for each problem. If we hover over the icon, the company name is displayed.
How about when we hover over the company icon, we provide an option to click which results in a list of filtered LC questions for the current company?
We may also change Companies
to a dropdown like Pattern
and Difficulty
.
I think we should be able to take notes on each of the problems. Could be stored in local storage just like the check marks
It'd be nice to have a column that would show you when you last solved the question! This could be useful for individuals who want to re-attempt previous questions that gave them trouble (like Backtracking for me)
Container With Most Water question is a LC medium but its tagged as LC hard.
Hey Sean, thank you for the list, it has been really helpful. I was wondering whether it would be possible to add a switch or something at the top to toggle on/off the pattern types for each question. Currently all the pattern types are hidden unless a user clicks check at the left. While hiding the pattern type is definitely useful, I imagine that there are quite a few people who may be trying to find questions for a certain pattern type. Hence the ability to toggle on/off the pattern types would be really useful. Thanks in advance!
It'd be great to have a suggested approach when solving questions, including:
Leetcode discuss is an excellent way to share and view current and previously asked questions by some of the major tech firms!
Let's consider adding this to the docs
Hi @seanprashad,
I would like to suggest using a license for this website. You may refer to choosealicense.com, a site maintained by GitHub, for picking a license. This website also explains how licenses work and describe some popular licenses in detail.
As I'm continuing my own studies, I realized that there are some missing categories that would be very helpful, such as:
Design
Trie
Greedy
When adding these new patterns, we should update the existing questions and their respective pattern, if need be, in src/data/index.js
.
Even though there is a "Show/Hide Patterns" slide, it seem that most of the questions are clustered together when they share patterns within a difficulty.
Even though I try not to pay attention to the revealed patterns of the near by questions, I often see them. This gives me a very good hint on how to approach to a problem which I won't have when I will be in an interview.
A shuffle button/slide (some might want to get the original ordering back) would solve that problem since I wouldn't be able to guess the pattern with the ordering randomized.
Longest Substring Without Repeating Characters is a LC medium but is tagged as hard
Need another column to point out the solution, in case if anyone wants to have a look at it. It could be visible based on the preferences.
I think progression labels on the top (e.g. Total: 75/170, Easy: 14/36, Medium: 53/102, Hard: 8/32) should be reflecting the list that's present on the screen. This is not something important, but just realized that they were not changing and felt like mentioning it :)
Preserving the filtering, especially the Companies filtering, after a refresh or when closing the page and opening it again, is a good idea. Recording that information in the cookies seems like an easy fix.
This bug is a result of my patch in #72 - look into reverting and adding the solutions in a better location
If the problem is to be solved inplace, we will get to the solution either by
I dont see the subset pattern
Hi,
First of all wanted to say thank you for collating different patterns of problems. Very helpful.
Now I would really love an ability to hide solved problems, or at-least show a count to user to how many problems he has already solved and how many are remaining.
Thank you.
It would be great if we can hide topic tags for unsolved problems, knowing which algorithm to use beforehand restricts the thinking process in one direction.
Hi Sean Prasad ,the list you have provided is quite great I will suggest u to add these 2 problem in binary search as these are very popular interview problem quite known by name .I will update you if i will face any other good problem.These two problem are unique .
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.