Ask HN: How best to prepare for Python interviews starting in 3 months?

70 points by Takizawamura ↗ HN
My friend works in a bank and for a long time has wanted to make the switch to Python. To date, he has read a few books and knows some intermediate concepts, such as closures, generators, etc.. Outside of Python, he has built workflows in Alteryx and knows some SQL.

His teenage son challenged him to start applying for roles in 3 calendar months from now. He figures he can dedicate a max of 3 hours per day. How should he best use his time?

Should he drill on Leetcode? Build a small portfolio? Gain a specialization within Python? How best would you allocate his hours?

38 comments

[ 9.4 ms ] story [ 436 ms ] thread
I like the Python course on HackerRank.

I did all the problems. I had some Python experience already but I learned a lot. It felt like climbing a mountain but I found it was frictionless and fun the whole way. I printed out the completion certificate I got.

(I did the Java course and some other courses and they were not as good.)

If your friend wants to keep doing work like the work your friend has been doing in Alteryx, your friend should learn Jupyter, Pandas, and scikit-learn.

Climbing a frictionless mountain sounds really difficult. ;0)
There's a contradiction there I grant, but by "frictionless" I mean I didn't fight with the environment at all.

I'd contrast that to the Java course where you learn the strange dialect of "single file Java" where you might write a single main() method or write only static methods. If you need to you can write as many classes in a single file, but only one can be public, unless they are inner methods. You probably don't need public methods.

It's a strange enough world and distant from ordinary Java coding, yet kinda fun and helpful for mastering whiteboard interviews.

Off topic to OP. I already use Python. I would love to learn Go or Rust this way. Do you know if Hackerrank or any other sites like it have similar for Go/Rust?

I know the docs of the language and the primary books are excellent, but I am lacking in the motivation department. If it was hacker rank style stuff with mini challenges, I think I might pull myself together better.

what's the python course? link? I can only find challenges in python..
Study with your son and you'll both learn it in a jiffy.
I did the Udacity courses on full stack web-dev in ~2 months. Really good though I have a CS background so I knew some of the concepts (haven't coded in 20 years though). The very first intro CS course is really well done and all exercises are in python. The rest are not as good but still worth going through.
It's heavily domain dependent IMO.

Leetcode only gets you pass the first round of interviews and not every company does them. I consider these useless textbook problems but you'll need them to get the job. They won't help you much in the job.

More importantly (imo) he needs domain specific knowledge. I.e. if it's going to be web development then he needs to start a web project with the backend in python. If it's stats/analysis he needs to start on analysis projects. Etc.

My advice is on making small projects that cover topics he'll be working on in the jobs he applies for to build a small portfolio. And brush up on the leetcode like a month before.

I don't think there is much of a way to study. They always seem to be really stupid with some off the wall question that has zero to do with the job

Personally I think tech interviews should be talking about the implementation of a solution, even to a stupid question rather than coding

Like others wrote here, first thing to do is probably to narrow down the python skills he needs to practice (web ? data science ? ... ).

But as we are about to get in December, if he wants to practice general python skills in a fun way, I'd recommend having a look at the advent of code (https://adventofcode.com/2021).

Solving the problems on your own provides only a fraction of the learning opportunity, though. To capture it all, you need to read others' solutions on the related sub reddit. There are a few people out there documenting their solutions super effectively. Last year, for instance, I learned a lot from https://github.com/mebeim/aoc/tree/master/2020

If you have 3-months - https://pythonmorsels.com has been a godsend for me when drilling on the fundamentals of the python language. I guarantee that if you are relatively new to the language, that you won't run out of (A) Interesting exercises, (B) Fundamental language concepts in less than 30-45 days, even spending 2-3 hours/day. Just knock off 1 or 2 a day, and then come back a couple days later, and, without checking into the hints/guidance, try and recall how you solved the exercise the first time - with zero checking into SO/exercise hints. I got 10x more out of the second solve, doing it from only my knowledge. If you can keep that cadence up for even a month - you will have at least the language fundamentals down really, really solid - then you can pivot to various algorithmic solves in the language, or, if there is a particular front-end/back-end/etc.. framework that you need to know - drilling into the characteristics of that.

Trey Hunner is one of the more gifted speakers - and he's really laid out a great exercise and test-coverage plan.

The best thing I can say about pythonmorsels is that, every 15-20 exercises, I look back and realize how little I actually knew. Going through all the exercises is easily the equivalent of a full-semester "Introduction to language" course at a college (minus the algorithmic elements - this is a "language concepts" site)

I assume you're talking about the pro plan and not the lite plan?
Yeah - whatever plan lets you draw from his full library. Best education money I've ever spent in my life.
Few questions to get started:

  -  __init__ vs __new__
  -  Difference between list and set
  -  Abstract classes use
  -  Generators vs iterators
  -  How yield works
  -  Is python call by ref/val or both. How to implement each
  -  How python list allocates space, how it is implemented
  -  what is cpython, pypy
I'd be surprised if #1, #4, #7, #8 were ever asked in an interview, let alone for someone just learning the language.
Take an interview now and see what questions they ask you so you know how better to prepare in those 3 months. If you know closures and generators you're probably already fine to work it's just passing an interview. Maybe you'll get lucky early on, more than likely it will take a little bit, but you'll "learn as you go."
develop few simple games using [pygame](https://www.pygame.org). It will create a portfolio and will give a chance to explore some of the lesser used python concepts.
Depends on the goal... Does he want to work at Google or just some local software shop as a junior engineer?
Depends, if you want to work for big tech companies, leetcode will give you the biggest bang for your buck, smaller companies/non tech companies generally favor skills on a certain stack, so learning python django etc... can pay off here.
Work on a small project and do some practice problems
Pramp also offers mock interview challenges
Some excellent suggestions here.

For learning, exercism.io is amazing: they assign people as mentors to review your code, and I've had really good experiences while learning Rust, with feedback calibrated nicely to my level of expertise.

For how to think about algorithmic interviews, I always recommend this short set of notes: http://courses.csail.mit.edu/iap/interview/materials.php

For fun, try Advent of Code this year and see how far you get, and whether you like it. As @analog31 suggested, this might be a fun thing to do with his son.

I registered at exercism.io as a mentor to help other people. Thank you for sharing!
https://exercism.org/ has been amazing for learning programming languages, I've taken the rust, golang and elixir tracks and they are very good at getting immersion into the language by getting tests pass. Especially the new version that was launched in September is really slick and you no longer have to wait for mentors.
If you're just looking to drill problems, I think adventofcode.com is more fun than Leetcode.

What's worked best for me in learning new languages and such is trying to solve small problems I've had or just working on something I'm interested in. I get so burnt out just grinding generic programming problems.

Lots of other great suggestions here.

Grind Leetcode (in Python) and build a small full-stack project with his son. Django is written in Python so they could build a functioning web app with that. I recommend paying for Leetcode Premium - $35 a month - because it'll teach data structures/algorithms and have problems from big high paying companies.
1. Choose three companies now to apply to in three months 2. Research their interview style and focus on that 2.a If they are algo/ds heavy, do algoexpert; leetcode is a hit or miss 2.b If they are programming heavy, no suggestions from me but making apps in Python 2.c Probably not enough time for design but the boar book ( designig data intensive applications by martin kleppmann)
Build a site like hacker news using flask. I say flask instead of Django because it’s more light weight. I would also recommend doing something math heavy like following the stock market (even if you don’t spend actual money) just to learn the ins and outs and what’s slow/etc in python (spoiler: use numpy.)

Those are the two things I did, I came from PHP and until a 2.5 years ago I never touched python but I work with it full time (also react, which I didn’t know at all when I started.)

What you build isn’t all that important, or the language. Most languages can be picked up on the job. But doing some personal projects + a couple leet code or project Euler problems a week will make one a good programmer in 3 months. You want the personal projects to act as a portfolio you can show off to recruiters though.

(comment deleted)
> ...How should he best use his time?

Making switch to Python is rather a broad goal. It's just a tool, and as any tool it's used for a purpose and often along with other tools.

If he aims at any entry level coding position, then likely it'd be more about entry level, than proficiency. Basically, testing the discipline and analytical thinking (thus all puzzle and algo problems, dreadful leetcode etc).

If he plans to leverage his present skillset and experience, then in that alloted time I'd try to implement some aspects of his present job projects in Python (if such aspects are mappable, of course). General goal is to try and fuse his present experience with the newly acquired knowledge of Python (a known problem and solution, just a new tool).

Again, it does not need to be grand, just some specific aspect, say, parsing args or a configuation file, or grabbing something from a database, or triggering some process based on some config, logging something, wrapping his code for reuse or installation etc. Whatever he is familiar with in his job responsibilities.

The goal is to get used to the new tool, know what it takes for it to become useful at his level of experience.

Eventually, he could (in a stretch, perhaps) claim of trying to apply or evaluate the use of Python in his current job scope. This could count more, than just leetcoding ability, which may still be a barrier to get through, however, depending on the chosen companies.

Good luck to him!