Hacker News new | ask | show | jobs
Ask HN: How to practise Algo/DS for interviews that are every 2-3 years?
14 points by 1qazxsw23edc 2703 days ago
It's okay to learn Algorithms and Data structure once and practise questions to be good at it but once you leave practising you forget almost all the details and when time comes to interview for next company, you start to practise all over again to pass the interview which is quite inefficient and tedious.

What strategies do you use to keep up with these interview questions every 2-3 years (assuming you change companies in 2-3 years)? One answer to this question is you keep on practising for eternity to keep your Algo/DS game up, but this means you can never devote your time to learn other fields you might be interested in or to work on your personal projects (assuming you are a full-time working professional and so have limited time to study).

Also if you are not up-to-date with your Algo/DS skills, then there might be a situation that you have been given an opportunity to interview with a great company through Linkedin or something but because you are not practising Algo/DS during that time, you may miss the opportunity.

So, how do you manage this situation where on one hand you want to learn new things but on the other hand don't want your Algo/DS skills to fade away?

5 comments

I don't.

First, I've been with the same company for over nine years. Before that was four years, before that was five, and before that was ten.

Second, I seem to live in a different world that most software engineers. (Maybe it's because I'm in embedded systems.) Very few interview questions have been on algorithms - so few that it isn't worth my time to try to "keep current".

I read The Art of Computer Programming series in my spare time trying to solve the exercises, seems perfect for what you want or make a past time of going through competitive programming exercises https://contest.cs.cmu.edu/295/f18/
Spaced repetition: https://en.wikipedia.org/wiki/Spaced_repetition

If you don't actively review this material you're going to forget it. I created my own study guide for data structures/algorithms that I frequently review to prevent forgetting any concept. Every few days, or at least once a week, I'll take a blank sheet of paper and try to write down everything I possibly know about every fundamental data structure, including pseudocode and real code for operations such as searching/insertion/deletion. When I go through interviews I read my notes and do this active recall exercise at least once a day every day. Unfortunately there's no shortcut and you have to actively think about and code this material in order to remember it (if your day job doesn't involve knowing those things).

So the gist of it is keep practising atleast once or twice a week and more so when you have interviews. And for the rest of the time, learn things that interests you. Right?
Can you give some examples of Algo/DS questions you are struggling with? It is hard to give you any advice since you are asking about an incredibly broad topic. Something that always works, and has worked for me, is to learn by doing. That is, by coding up lots of Algorithms and Data Structures.
The other answers, especially going trough exercises a good book good advice!

You could also write an algorithm to optimize what you have to refresh and when based on your answers to a set of questions you have prepared.