25

Online Assessment Prep: Data Structures and Algorithms in Python

Python reference kit for technical interviews and online assessments: 33 runnable scripts on graphs, trees, heaps, tries, union-find, dynamic programming and concurrency, plus a DSA handbook.

Overview

A reference for data structures and algorithms, built while preparing for online assessments and maintained since (most recently in 2026). It has two parts: 33 runnable Python scripts, each implementing one technique end to end, and dsa.md, a handbook with comparison tables, code snippets, and longer sections on dynamic programming and greedy algorithms. INDEX.md lays out a daily competitive-programming routine, with a matching calendar file.

Contents

Graphs

BFS, DFS and general traversal (including an itertools-based variant), shortest paths, minimum spanning trees, union-find (disjoint set), topological sort and a travelling-salesman implementation.

Data structures

Trie, binary search tree, stack and queue, min and max heaps, segment tree, and singly, doubly and circular linked lists.

Dynamic programming

Memoisation, the 0/1 knapsack, a collection of common DP patterns, and longest palindromic substring.

Searching, sorting and strings

A suite of sorting algorithms, binary search, array and hashing techniques, text-search algorithms and multiplication algorithms, plus a set of general optimisation tricks.

Concurrency

Three scripts go beyond the usual interview syllabus, because concurrency questions come up in senior interviews: a multi-threaded chat room, a meeting scheduler, and the dining philosophers problem solved with locks. They use threading and concurrent.futures with explicit locking.

Tooling

Packaged with pyproject.toml (setuptools, Python 3.8+), linted with Ruff (pycodestyle, pyflakes and import sorting at 100 columns), with markdownlint for the Markdown. Output uses termcolor so an algorithm's steps are readable in a terminal. There are no tests yet. Each script has an obvious property-based test (sorted output, valid MST weight, shortest path matching a brute-force check).

Built with

  • Python 3 (standard library: heapq, collections, itertools, threading, concurrent.futures)
  • Ruff, markdownlint, termcolor
Home
About
Projects
Blog
Journal
Contact
Fun
Certifications
Copy email address
Open interactive résumé
Open GitHub
Open LinkedIn
Subscribe to the blog