Python intermediate challenges
You solve realistic workplace challenges without guidance, combining files, networking, concurrency and testing.
Level 301 · 16 lessons · 15 practice labs
Lessons
Data and file challenges
- Challenge: find duplicate files on disk
- Challenge: find unusual hours in a log
- Challenge: the configuration difference between two servers
- Challenge: merge an inventory from three sources
- Short task: separate and report broken records
Network and web challenges
- Challenge: a service map of the lab network
- Challenge: sync records between two APIs
- Challenge: a client that respects rate limits
- Challenge: a signed webhook receiver
- Short task: a monitor that records outages
Design challenges
- Challenge: an application that loads plugins
- Challenge: retries with exponential backoff
- Challenge: a cache layer with expiry
- Challenge: refactor an old script while keeping its tests green
- Short task: wrap an old tool in a modern command-line interface
Capstone
- Capstone: a live operations dashboard in the terminal
Practice labs
- Diffing two inventory lists: Write a function that compares yesterday's and today's server inventory and returns added, removed and changed records as three lists.
- Renaming photos by date: Move photos into year-month folders by modification time and name them with a sequence number, never overwriting on a clash.
- Finding login bursts in a log: Find the intervals with more than ten failed logins from one user in a five-minute window using a sliding window.
- Comparing the scheduled jobs of two servers: Parse two crontab dumps and report jobs present on only one side and jobs whose schedule differs.
- Merging near-duplicate customer records: Match customer records with spelling differences by normalisation and similarity ratio, listing merged and undecided ones separately.
- Checking the status of lab pages in bulk: Request each lab web page in an address list and print status code and response time as a table.
- Avoiding needless downloads with ETag: Add ETag and If-None-Match support to a client of the lab API so unchanged data is not downloaded again.
- Blocking replays on a webhook: Reject webhook requests whose signature is valid but that are old or already seen, using a timestamp and a one-time id.
- Syncing only the difference between two systems: Compare records in the source and target lab APIs and write a syncer that applies only the added, changed and deleted ones.
- Keeping a command registry with a decorator: Write a decorator that registers functions by name and complete a dispatcher that calls the right one for a command name.
- Splitting a long script into testable pieces: Split a two-hundred-line report script into read, compute and print functions with byte-identical output.
- Gathering scattered global settings into one object: Gather global settings spread across modules into an immutable settings object passed to functions, with tests passing.
- Computing wait times with jitter: Write a function that produces capped exponential wait times by attempt number and adds random jitter.
- Preventing a stampede on cache expiry: Lock a cache per key so a value that expires is computed only once instead of dozens of times.
- Putting a circuit breaker on a failing service: Write a circuit breaker class that stops calls for thirty seconds after five failures in a row and reopens with a trial call.
About this course
You solve realistic workplace challenges without guidance, combining files, networking, concurrency and testing.
What you will learn
- Data and file challenges
- Network and web challenges
- Design challenges
- Capstone
Prerequisites
You should be comfortable with the level 101 and 201 topics of the same path.
Lab environment
Lessons run in your own Kali Linux terminal in the browser, connected to a private lab network. Nothing to install.
Frequently asked questions
- Is this course right for my level?
- The course is at level 301; it assumes you know the topics of the lower-level courses.
- Is there anything to install?
- No. Every lesson runs in your own lab environment that opens in the browser.
- How do lessons work?
- Each lesson has 8 to 10 steps and a short quiz. Early steps show the command to type, later steps give less help; if two attempts fail, the solution opens.
- Can I try it for free?
- Yes. The first three lessons of every course are free.