Hacker News new | ask | show | jobs
by sk11001 804 days ago
> How can I improve my ability to write data structure/algo code in python?

You don't need a book on Python, you need to practice solving data structures and algorithms problems.

Completely disagree with the recommendation to read Fluent Python, that book has nothing to do with your goals.

> understanding of what is "fast"

Do you mean in terms of performance? Depending on the problem fastest is usually to use libraries instead of native Python code. But that's not really relevant to DS&A interviews.

2 comments

Hmm doing data structures and algorithms in pure python as fast as possible will teach you about the environment's gotchas and limitations.

The answer if it's performance critical is probably "write it in C" but you want to be aware enough to not end up accidentally quadratic in trivial code.

I do think there is something to reading Fluent Python. Knowing how to write elegant solutions in python is part of what I have been missing when using python and this book is very good at illustrating this.
The book doesn’t teach you how to write elegant solutions.