Adam Johnson is a Django core developer who writes practical posts on Django, Python, Git, and testing.
Commenters cite his Git rebase and Django versus Flask articles as clear and useful, and recommend his Django books.
> Via its incr and decr commands, memcached provides a built-in way to atomically add k to a number. But it doesn’t provide other arithmetic operations; in particular, there is no “atomic multiply by” operation.
Your programming challenge: Add a mult command to memcached.
Protip for people in junior roles: if you're interviewing for a more senior position, the correct answer would *not* be to jump in straight and waste 3 hours implementing something that then you have to maintain forever.
The best answer, from an *engineering*[1] perspective, would instead be noticing (or knowing) that memcached supports a CAS command (https://github.com/memcached/memcached/wiki/Commands#cas) that would allow to implement equivalent functionality without changes in memcached, and try to confirm why that would not be a viable solution. If, and only if, CAS is confirmed not to be a viable solution (e.g. excessive contention, unacceptable pX latency, ...) then you should spend the 3 hours (+ all the maintenance effort required until the end of life for that solution).
The risk, in case you jump acritically on the solution, is to show you did not spend any time trying to actually understand the problem and you did not consider the pros and cons of viable alternatives (and this is a problem both during an interview, as well and especially when you're doing actual work), something that is normally frowned upon in senior roles.
Obviously, being an interview, it's all play pretend so you'll…
This article is a few years old but it compares both really well:
https://adamj.eu/tech/2019/04/03/django-versus-flask-with-single-file-applications/
Flask works for simple projects but as your needs grow, the built-in and extensive Django ecosystem will have you covered. And as seen above, Django in its simplest form is no more complex.
Some people really don't like the Django ORM, so in this case you might avoid Django altogether. It's possible to use Django without its data layer but it's a big part of its value.
Also if you are building a pure API project, FastAPI is worth checking out for a streamlined process. Django Rest Framework works too, but is an extension.
If you're interested in some of these concepts (i.e. smaller, more incremental PRs and stacked branches) but don't want to jump whole-hog into using a new product or tool, I highly recommend taking a look at `git rebase --update-refs`[0] to grease the wheels so to speak of implementing a similar approach with stock tooling. There's a great write-up on the feature and how it can help you here[1].
[0]: https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---update-refs
[1]: https://adamj.eu/tech/2022/10/15/how-to-rebase-stacked-git-branches/
I don't think there is a moral justification for circular dependency scopes to always be individual files, especially given that import statements count as circular. The same issue in other languages where circular scopes are individual files leads to some horrible workarounds:
* Python TYPE_CHECKING https://adamj.eu/tech/2021/05/13/python-type-hints-how-to-fix-circular-imports/
* C/C++ header files
But regardless, there is too much Rust code in existence to change this now.
OP here. Thanks.
Yeah, profilers are very varied in Python, and none are super easy. I often use either cProfile + pstats (per this post: https://adamj.eu/tech/2025/05/20/python-quick-cprofile-recipe-pstats/), cProfile + gprof2dot (per this post: https://adamj.eu/tech/2024/03/23/django-optimizing-system-checks/#profiling-the-checks ) or py-spy. I'm excited for "tachyon", the sampling profiler coming in Python 3.15.
While it is a bit of a pain, it can be made a lot easier with the --keep-base option. This article is a great example https://adamj.eu/tech/2022/03/25/how-to-squash-and-rebase-a-git-branch/ of how to make rebasing with merge conflicts significantly easier. Like you said though, it's not super user-friendly but at least there are options out there.