Show HN: I made a spaced repetition tool to master coding problems (lanki.xyz)
As you solve LeetCode questions, you can mark them as hard, medium, or easy. The tool will then recommend questions you should review based on (1) how hard the question was for you and (2) how much time has passed since you last reviewed it. I'd recommend normally attempting LeetCode problems and just marking them as hard, medium, or easy for you at first so the tool knows which problems to recommend you review!
Here's the theory behind spaced repetition and learning if interested: https://www.codecademy.com/article/spaced-repetition
102 comments
[ 3.1 ms ] story [ 161 ms ] threadI recently noticed that many people that solve leetcode style problems to learn programming patterns tend to save links to problems they'd like to try again later on google docs/notes.
However, this doesn't help them remember to try these problems again or differentiate between problems that are more urgent to revise.
Built this tool to help solve this inefficiency!
It's a cool project, though!
Otherwise one can make their own cards (I often use LLMs to convert knowledge into cards and then import them into my account) for just about anything.
score = ( timeSinceLastAttempt ^ 2 ) * difficulty;
Anything else you'd want factored in?
But I see it's already been mentioned here in another thread.
Do you rank the problems solved by the user only, or all leetcode problems?
Because I think that a nice thing would be for your tool to first suggest one pb in each category, and then start recommending the category where you're the weakest.
Thank you
I take it you solve puzzles by writing code. How does it help with job interviews really?
What makes software engineering interviews a grind these days is that many employers don’t care about your thinking process; they want an optimal solution to the problem within the time limit without errors, since chances are high that an applicant will come up with the optimal solution. In addition, the high compensation for many Silicon Valley employers has made these positions very desirable and thus ultra-competitive. The same type of applicants who grinded for high SAT and AP scores in high school and who grinded in college for 3.7+ GPAs don’t feel discouraged grinding some more for a six-figure job with life-changing amounts of RSUs once vested and other perks. You can grind hard, but chances are high that somebody else spent even more time studying than you. These types of interviews are similar in spirit to the employment exams that some companies have in Japan during job-hunting season for upper-level college students.
So, aiming for a FAANG position, as well as software engineering positions at many other companies in Silicon Valley, essentially require studying not unlike preparing for a GRE subject test for graduate school admissions.
I think "grinding" on Leetcode also entails learning and practicing a lot of irrelevant topics for many jobs, but there are newer resources out there that help you focus on what you need to know for specific roles. I don't like to plug my own company, but Exponent[1] is designed to help with this more 'well-rounded' interview prep for different types of engineering paths, and we also have a mock interview feature that helps you iron out your communication skills with other candidates.
1. https://www.tryexponent.com
Do US most companies outside of Silicon Valley not use leetcode style interviews? Every single software interview I've done in Canada had at least one round of leetcode programming exams.
Leetcode questions do happen but typically they are guidelines for a further discussion rather than the entire signal. By that I mean, they are used to investigate problem solving, communication, and personality.
It tends to be the bigger places have more rote tests. One company posed the "If you were re-making Instagram, design me the ability to handle millions of page views over the span of an hour" or something like that. Apparently CDNs, caching, and load balancers wasn't the answer...
Never bothered to look it up because I spent what felt like an hour trying to figure out why this guy thought a CDN wasn't good enough and whether he was _trying_ to get a rise out of me.
What only made it funnier is this place had nothing to do with images.
Cool idea btw. What do you think about incorporating the "patterns" associated with problems into the repetition algorithm? For example, if I find 2 pointer problems hard, then the next 2 pointer problem will be recommended sooner.
https://alpine-aspen-2ab.notion.site/Lanki-da1481129bfa4d3ca...
If you want one data point about how I prepare for coding interviews - I just solve Neetcode's list and the blind 75 list (minus the overlap between the two). For reference I got 5 offers in quick succession after being laid off in early 2023.
If you have an old problem, copilot can solve it, true.
The people / companies using it to hire will tend to hire people who studied leetcode.
The companies that don't use leetcode / don't use it as a strong signal will continue not using it.
In my opinion, leetcode is a poor signal if used as a binary decision ("were they right or wrong?"). The more important thing is communication and how they worked through the problem. I've heard this multiple places and I absolutely agree: attitude over aptitude. You can teach knowledge, you can't teach attitude or ability to problem solve.
The companies that use them as a strong signal are the ones that will be absolutely demolished in engineering because they are on a fast track for a staff full of rote memorization rather than strong creative problem solving. They'll be handicapped when it comes to solving problems that aren't covered by leetcode because no one there bothered to learn it.
Seems like society should try to figure this out.. if attitude is so important, why can’t we cultivate it systematically?
The way to cultivate it is letting people figure things out on their own and rewarding atypical solutions that arrive at the same conclusion.
A lot of education tries to deliver in a specific box and a specific way and any other method is punished. Society would likely get more value if education was more diverse in perspective and methods. It took me way too long to realize that I didn't care about anything but computers. I started doing better in my classes when I framed everything through my lens rather than viewing it through the instructor's lens.
I don't know the correlation but I think a lot of entrepreneurial families tend to have good problem-solving children or maybe it is a selection bias among friends. It could be genetic but I think these families tend to reward / not punish ingenuity. In addition, I believe part of the equation is leaving children alone to figure things on their own. It sucks but I think that letting your kids jump into the deep end of the proverbial pool makes them better for it even if they flail for a bit.
Give them boundaries but give them the space to figure it out and make mistakes. I know it drove my parents crazy that me and my siblings took everything apart and argued systematically but it paid off in our adulthood.
We do. It's called culture.
But culture doesn't optimize for something so narrow since it exists in a much wider context than just "what's good for knowledge workers in a capitalist system".
What metric are you using to measure this? I think its a positive correlation at best as far as good business outcomes are concerned, and maybe uncorrelated at worst. Google and Meta have been known to ask contrived puzzle questions for years, even before Leetcode (and Meta now is infamous for having a high standard for Leetcode interviews), and I do not see Engineering being "demolished" here, as far as results are concerned.
What people don't realize is that Leetcode selects for generally positive traits, no matter how its solved. In my mind, here are things LC selects for:
1. Actual innate skill. If someone never practiced leetcode before but can solve an arbitrary new coding question, they probably have a pretty decent aptitude for problem solving.
2. Determination. If someone practiced leetcode for hours a day just to pass an interview, thats commendable. Does it really matter that they don't "know" the problems if they studied hard and passed? They might be more likely to work hard on the job given the right rewards.
Leetcode style interviewes were basically initially created as a thinly veiled aptitude test, and in theory they are still good at that. If you _can't_ solve an easy to medium leetcode question then what does that say about you, assuming it basically is the inverse of the two singals above?
I applied to Atlassian as a 50 year old from South Africa who has very broad and deep experience but has never worked in big tech. Failed at the last interview (of 5) but I found the process and feedback very fair and much better than others I’ve seen elsewhere. The focus was on collaboration and communication and not being a jerk, along with the problems to be solved. I enjoyed it.
If you master the methods and ideas, you should be able to derive the answers on the spot. That's better than memorization because then you can actually deal with real interviewers who 1) Want to hear your train of thought and 2) Will give you random changes or variants to problems.
It's not about memorizing solutions, because in reality when are you ever going to reverse a linked list or balance a red-black tree? No, so if you're going to put in the effort anyway, you should learn the concepts and understand when to apply them so your knowledge is actually applicable. This will actually make you a better programmer, and you'll do better with the interviews that are actually good (I speak with experience giving interviews at FB).
It feels obvious to me that, in theory, we could do a lot more to leverage your current world knowledge to recommend the next piece of educational content, to optimize not just your understanding but also other things like how engaged you are. For example, a system could throw you an easier question if it helps you focus longer.
When I see the state of current interview prep it’s mostly “here’s a big list of questions” , perhaps tagged by difficulty and grouped under related topics such as “graph problems” or “tree problems” but I’m personally convinced a more sophisticated system could serve you the best possible next problem to stretch your brain in the right way.
Spaced rep is simply the proven starting point. The rest of adaptive learning has a bit of a troubled past because it was trendy to VCs , but pushed on educators and presented more as an alternative to a teacher rather than something to augment a teacher. I worked for a company that raised 100M+ to work on it but the CEO was great at terms sheets but uninterested in actually building a great education project.
But the reason that I joined the company was the high level idea still resonates with me. Surely many HN users have a big list of things they want to learn- perhaps about LLMs. But a typical course will have zero knowledge on where you’re starting as a student . It might bore you with stuff you know already or take for granted key prerequisites and skip them.
Anyway, I’m currently building my own adaptive learning platform but focused on helping professional poker players learn game theory . My idea being that it’s an easier ed tech app to bootstrap as the knowledge very directly translates to money. And really the same criticism applies because you can’t truly memorize a game tree , it’s more important that you build a high level conceptual understanding. But , as much as rote memorization deserves to be maligned when done in isolation, it’s not so bad when done as part of a broader learning strategy. For example, you can’t memorize vocab to learn Spanish but certainly knowing 5000 words in Spanish is a very nice starting point compared to not knowing any words. And tools like spaced rep have been proven by research to help with that goal and I view as a pathway to more broad adaptive learning strategies.
Traditionally, yes. But several people use the SR algorithm to simply do the same problems over and over (practice), without the memorization component.
Looking at a typical SR algorithm, you're not really going to memorize doing the same medium/high Leetcode problem unless you actively try to memorize it. The interval sequence will be something like: 2, 5, 13, 35, 120, etc. By repeatedly solving the problem so few times in such a long period (and while solving other problems at the same time): You're not really going to memorize it accidentally.
1) Learning for mastery / competency to apply the skills to real life endeavors
2) Learning so you can meet some standard necessary to enable certain opportunities in life
It seems your opinion comes from a personal value bias towards #2 and I share that bias, but perhaps not as dominantly as you do (at the moment). For both of these, memorization can be very helpful, even optimal. But the application of spaced repetition would be different depending on the goal.
On memorization applied to learning for genuine personal mastery:
I believe memorization is optimal for foundational axiomatic knowledge. A good example is quick addition and times tables (and other arithmetic). I believe:
1) People should consider it a necessary life skill to be able to perform reasonably complex arithmetic manually in your head. For example, 4462+9241=13703 or 25120=3000. Many people will disagree on the nuances on where this begins and ends, and that's okay. For example some people will feel that people should be able to multiple 27123 in their head, others would feel it's okay for something like that to be done on paper. But for me, the point is that there exists a category like "things you should be able to do, but it's fine not to have memorized". More importantly, I believe it would be suboptimal to spend a significant amount of your life memorizing an increasing sample of these, but it's reasonable to spend time maintaining the skill of manual mental arithmetic and probably reasonable to spend time improving the speed and accuracy with which you do it.
-- 1a) A nuanced subset of this skill example is "estimation", for situations where it's appropriate. It might take longer for some people to manually calculate 27123 (or whatever) than for them to pull out their cell phone or ask their Apple Watch. If the situation only needs them to have an upper and lower bound within they might break it down to {lower_bound = 25120 = ((256)2)10 = (150210) = 3000; upper_bound = 30125 = 3055 = 150510/2 = 75010/2 = 7500/2 = 3750} and they could determine the answer is around 3350 or so, but absolutely 100% definitely between 3000 and 3750. And they could still do this type (if not degree) of estimation faster (and more stealthily, which can be important sometimes, like during negotiations/haggling) than pulling out a cellphone and calculating.
2) People absolutely cannot do arithmetic if they do not have certain foundational axioms memorized. If you do not have 1+1=2, 2+1=3, 3+1=4, etc memorized (counting), you literally cannot do arithmetic. That would be an absurdly low-functioning adult and essentially means you don't know how to count. But technically* you only need to be able to count to add, subtract, and multiply (by maintaining two counts simultaneously) any real numbers. Obviously just counting is a helpful, but not optimal, level of memorized knowledge to be competent at arithmetic. It would plainly be helpful to also memorize things like 7+6=13 and 152 = 30, and have instant recall for these rather than re-calculating them manually every time you need them. Which brings me to:
-- 2a) I believe it is helpful to memorize more than what many people think it is helpful to memorize. We generally are taught in primary school to memorize times tables up to 10x10. But perhaps it would be useful to extend this beyond 10x10, at minimum for some additional prime numbers which might show up frequently and cannot be quickly factored to smaller numbers. I could see it being super nice to have my times tables memorized up to 100x100, and additional addition/substraction memorized. I feel this way because despite having done well in three semesters of calculus and differential equations, I have alway...
For the curious, I write a little more about it here: https://two-wrongs.com/learning-some-logarithms.html
https://nautil.us/how-i-rewired-my-brain-to-become-fluent-in...
Who would ever claim otherwise?
Most of the concepts I learned, although I don't remember learning Kadane's algorithm for solving the maximum subarray problem in school, so I've learned some things like that. I can also implement a solution for an associated Leetcode problem in one line of code, so I wound up memorizing that too.
OP says "If you master the methods and ideas, you should be able to derive the answers on the spot", but I hear from a lot of people that does not happen, even (implicitly) in this thread. Any how, even if I use OPs method, if I do the same problem over and over and over again I'm going to wind up memorizing it any how.
Some people are closer to each other, and upon realizing that they believe they've found a pattern. But it's like when people tell you that you need to supplement x in your diet. It's possible that x helped you. And it's even possible that you'll find other people with the same nutritional deficit, creating the illusion that everyone would benefit from supplementing. But that's just what it is: a premature extrapolation from anecdotes
Just for the record, that never actually happened. It's just a thing the homebrew guy made up.
(I know, the rest of your points are unaffected by this. I just feel annoyed when we casually warm up old myths.)
I tried to find some outside sources, but nothing about Howell admitting his 'artistic license' outright. So take my fallible memory with a large pinch of salt.
See https://news.ycombinator.com/item?id=15713801 for some discussion, and to see how 'invert a binary tree' wasn't even an established term that anyone at Google would have used.
https://leetcode.com/problems/invert-binary-tree/
Spaced repetition is nothing other than intentionally refreshing something you currently know, to ensure that in a month or a year or longer, you'll still know it. It's not your place to judge what to memorize or not. I'd suggest you should also use spaced repetition on the methods and ideas, since we're very prone to forgetting that too. I would also never criticize anybody for memorizing something, since it's literally just doing intentionally what we would otherwise do haphazardly and by accident.
Writing good flashcards is about
- noticing similarities and differences,
- exploring variations of a concept,
- finding generalisations of related concepts,
- learning properties of a concept, etc.
All these things are things you use when reasoning also about more complex ideas.
In other words, spaced repetition is an efficient way to raise the baseline for what counts as a "fundamental fact" which makes it possible to think at a higher level of abstraction.
What experimental psychology and neuroscience research has found is that the better people memorize topics, the better they understand and reason about them.
For those interested, this book has the best compilation I've seen of such research: https://www.amazon.com/Memory-Alan-Baddeley/dp/1138326097
Edit: Of course, you can memorize things without any effort to understand. But if you are making these efforts, having an efficient and effective memorization technique can help a LOT.
I don't know if I'm just lucky in terms of how my brain works in some way and I found I had a pretty good 'natural' memory when it came to things like learning languages, and I appreciate that this is totally anecdotal. That book looks interesting however and as somebody who teaches, I'm interested in what works for everybody, not just me.
Whenever I practice, I always have my notes in front of me and I focus on puzzling through the problem at hand rather than testing my memory.
But in an exam, for me there us always the possibility of failing to recall some fact. To combat this, I record every not-completely-obvious fact into Anki and aggressively practice it in the run-up to the exam.
I well doubled my income after using SRS to master leetcode/algo/ds patterns. Implementing SRS was a catalytic moment in my interview prep training that really accelerated the volume of patterns I held in the RAM of my brain.
You can view the cards I made at https://github.com/yfSWn5KP/algo_and_ds
There’s also system design cards at https://github.com/yfSWn5KP/sys_design
> ...
> That's better than memorization
Bullshit. You can't get to mastery without memorizing (at least) the fundamentals into muscle memory.
Can you just "master" the 7 notes and what octaves are and all other theory to be able to play beethoven? Or should you play a few songs repeatedly till they're muscle memory practicing in parts or full and then moving over to other songs?
Should you learn that the integral means the area under the graph to "master" integration or do you still need to run through dozens of same/similar problems till you can solve them without an error?
You need to memorize but its a fools errand to start and stop at memorizing leetcode problems. You need to get the fundamental problems (binary search, bfs, dfs, sliding window) solve them repeatedly to a point it just flows naturally and then apply it to problems that build on them and still repeat those till they get natural too.
It's genuinely amazing for what it covers. A fantastic way to quickly get up to speed for JS/TS, SQL, and basic Python.
Edit: I just remembered it takes like 500(?) data points to train the algo... so maybe not.
(Jarrett's the author of fsrs, fyi.)
The goal of our site is to teach smart people how to quickly master leetcode.
We put in a year's worth of thought to make things as simple as possible, and are super proud of our content. Recently, two people used our site to land Amazon. Check it out!
Not sure if it's worth mentioning, but we made sure to cover all the ideas you learn from the Blind75 and NeetCode150. It's not like you're missing out - we're just:
- organized better
- higher quality solutions
(==> more efficient, hence not thousands of problems)
[1]: https://mnemosyne-proj.org/features
[2]: https://orgmode.org/worg/org-contrib/org-drill.html/