Introduction Most companies, when recruiting new software engineers, include at least one coding interview as part of their selection process. And why not? We’re software engineers, after all; writing (and reading) code is what we do. Yet, even for the seasoned Pythonista, there is one coding interview that often feels disproportionately — and unnecessarily — stressful:… Continue reading Python Coding Interview Learning Path
Articles on data structures
Tips for clean code in Python
By Bob Belderbos on 8 November 2022
In this article I will give you 10 tips for cleaner code. Hope this helps improve your Python code. 1. Smaller units. Break long functions (methods) into multiple smaller ones that do one thing (SRP or “Single-responsibility principle”). This will make your code more modular and easier to test. For example, a function that parses… Continue reading Tips for clean code in Python
Naughts and Crosses Gets a Little Help
By Geoff Riley on 12 March 2021
Naughts and Crosses (Tic-Tac-Toe to some audiences) is a popular skill game often played by children. It can also be usefully employed to distract dial up computers, at NORAD for example, rather than allowing the ‘playing’ of Global Thermonuclear War. Would you like to play a game?
Abstract Syntax Trees in Python
By Alessandro Finamore on 20 February 2021
In this article Alessandro provides an overview of Abstract Syntax Trees (ASTs), introduces a few use-cases, and showcases the ast module in the Python Standard Library. The content is structured in a top-down fashion, starting from general notion about an AST, and digging deeper up to the point of artificially manipulating an AST to “randomize” the content of some instructions.
Watch Me Code – Solving Bite 21. Query a Nested Data Structure
By Bob Belderbos on 14 July 2018
I recorded a video solving Bite 21. Query a nested data structure. The exercise presents us with a dictionary of car manufacturers and their corresponding car models. We will extract various bits and pieces from it as well as sort the nested model lists. This is a common type of data structure so specially for a beginner it is important to have this become second nature. Prepare to learn more about looping, some string operations, and list / dict comprehensions.
Code Challenge 08 – House Inventory Tracker – Review
By PyBites Team on 5 March 2017
It’s end of the week again so we review the code challenge of this week. It’s never late to sign up, just fork our challenges repo and start coding.
5 tips to speed up your Python code
By Bob Belderbos on 21 February 2017
In this post I will give you 5 tips to speed up your code.
How to Order Dict Output in Python
By Julian Sequeira on 16 February 2017
Learn how to order the output of a Python Dict
A great book that makes algorithms accessible
By Bob Belderbos on 3 January 2017
I finished reading Grokking Algorithms, it’s a very accessible resource for learning algorithms / data structures, highly recommended.
Read the stdlib: deque
By Bob Belderbos on 20 December 2016
Use collections.deque to rotate letters in string (or elements in list). It has a native method which performs faster too.