Practice Arena

Python Coding Challenges

Write real Python in the browser. Instant feedback. From beginner to expert.

467 challenges 330 easy 120 medium 17 hard
Dicts & Sets medium

Group anagrams

Group words that are anagrams of each other.

dict sorting strings
+22 pts 20m
Dicts & Sets easy

Keys Sorted by Value Descending

Given a dictionary mapping strings to integers, return a list of keys sorted by value descending, and when values tie, alphabetically ascending.

sorting dictionaries ordering
+8 pts 10m
Dicts & Sets easy

Common Keys of Two Dictionaries

Implement a function that finds keys shared by two dictionaries and returns them sorted.

dict set sorting
+8 pts 10m
Dicts & Sets easy

Union of Many Sets

Implement a function that takes any number of sets and returns a sorted list of their union.

sets union flatten
+10 pts 10m
Dicts & Sets easy

Top k keys by count

Given a dictionary mapping keys to counts, return the top k keys with the highest counts, breaking ties alphabetically.

dictionary sorting frequency
+10 pts 15m
Dicts & Sets easy

Anagram Groups by Size

Group a list of words into anagram groups and return them sorted by group size and lexicographically.

dicts sets sorting
+10 pts 10m
Dicts & Sets easy

Top K Frequent Words

Given a list of words, return the k most frequent words sorted by frequency (descending) and then alphabetically.

dictionary sorting frequency
+10 pts 15m
Dicts & Sets easy

Sort by frequency

Sort a list by element frequency descending, with ties broken by order of first occurrence.

sorting frequency dictionaries
+10 pts 15m
Dicts & Sets easy

Frequency sort descending

Write a function that sorts a list by frequency descending while preserving original order for ties.

frequency sorting dict
+10 pts 15m

Showing 9 challenges · Dicts & Sets

Dicts & Sets — Python coding challenges

What you will find here

This page lists dicts & sets challenges — real Python problems you solve in the browser IDE with instant test feedback. Each challenge includes a clear brief, starter code, and automated checks.

Challenges vs tutorials and quizzes

Challenges test what you can build under constraints. For guided teaching, use our Python tutorials. For quick checks, try quizzes or copy snippets from code samples.