Revising Resources for Coding Interviews

For the past two weeks, I’ve been doing 1 Leetcode problem a day, by hitting the random problem button. This is a bad strategy, since it’s inefficient at figuring out my weaknesses. The optimal strategy seems to involve working through a list of representative problems, categorized by topic, like the Blind 75. You would basically go through the entire list several times, looking at answers if you need to, until you can easily recognize the patterns. I did this back in early 2020, then I forgot everything.

My main weaknesses are stuff with arrays and string manipulation. Basically the first chapter of most algorithms books and courses. For me it’s very easy to forget the early things I learn, because the brain hasn’t made dense connections yet with other topics. Another problem is that string manipulation stuff is very verbose in C++ compared to Python.

I could go through CTCI again but being a book, I’m tempted to just read it cover to cover, and do the exercises in order once and done. Instead, it would be better to keep revisiting earlier topics and markings ones for review.

Here’s a revised plan:

  1. Interview Cake, one week, 40-50 hours (using GitHub Education gives you 3 weeks free)
  2. AlgoExpert or random Youtube videos, two weeks, 80-100 hours (lots of coupons online)
  3. Blind 75, writing down at least 1 pattern per question

At this point, I should be able to solve pretty much every Easy or Medium question without much effort. This is getting 80% of the results.

Any more than that, then I would go through CTCI, EPI, Algorithm Design Manual, but only for specific chapters and topics.

To battle test it, I sign up for mock interviews on interviewing.io, or with my friends. Or interview with companies that are using myworkdayjobs. By end of July, I should then start applying to the big ones.

As an aside, I’m committing to doing all my interviews in Python, because C++ is verbose and has too many footguns. I’ve actually been collecting a private repository of the interview questions I get, and I implement the same thing in C++ and Python. Consistently, the C++ solution is at least double the length of Python.

To review Python from scratch, I’m using only two resources: the official tutorial and Fluent Python. The official tutorial gets overlooked so often because it doesn’t look cool or friendly. So newbies go to Youtube videos or “Automate the Boring Stuff” (I made this same mistake 7 years ago). These are good resources, but sometimes they can be deceptively simple, and give you an inflated sense of competency, because of how simple Python is. For example, I had no idea you could do an else statement in a for loop, that executes when the loop is exhausted, or the while condition is False. Or, that you can force positional and keyword arguments like def f(pos_only, /, standard, *, kwd_only).

This sentiment is covered in the introduction of Fluent Python:

As a teacher introducing Python to programmers experienced in other languages, I see another problem that this book tries to address: we only miss stuff we know about. Coming from another language, anyone may guess that Python supports regular expressions, and look that up in the docs. But if you’ve never seen tuple unpacking or descriptors before, you will probably not search for them, and may end up not using those features just because they are specific to Python.

The Python tutorial is also filled with Monty Python references. And eels.