Help improve SovranCode?

Google Analytics can measure anonymous usage after you choose Allow. Essential account and progress features work either way.

SovranCode
Learn
Learn on SovranCodeCourses5 free learning paths→ExercisesPractice with live challenges→GuidesDirect answers for developers→E-booksFocused field guides→
Build
Build on SovranCodeProjectsPortfolio-ready builds→TemplatesSovranCode team marketplace→Developer toolsFast browser utilities
CODING EXERCISES

Small problems. Strong instincts.

Choose a language and build confidence with focused exercises, helpful tests, and explanations that teach the underlying pattern.

Practice library
Short feedback loops that turn concepts into fluency.
39exercises
6languages
Practice by languageCCCSSJSJavaScriptPythonSQLReact

Practice deliberately

Read the requirement, predict the edge cases, then use the test feedback to improve one decision at a time.

39 exercises available
01
CCadvanced

Audit a multi-file build

Given app.c, inventory.c, inventory.h, and Makefile, explain and write the dependency rules needed so changing inventory.h recompiles both relevant object files before linking.

02
CCadvanced

Parse one CSV inventory record

Parse a simple inventory record in the form id,name,quantity into a struct. Reject missing fields, extra commas, an empty name, and a quantity outside 0..100000.

03
CCadvanced

Push into a bounded ring queue

Implement queue_push for a fixed-capacity circular queue. Return 0 when the queue is full or invalid; otherwise store the value, advance tail with wraparound, and increase size.

04
CSSadvanced

Design a theme token system

Define semantic color tokens for a card and support a dark theme without repeating component declarations.

05
CSSadvanced

Respect reduced-motion preferences

Add an entrance transition for a notification panel, then make the experience calm and usable for visitors who request reduced motion.

06
JSJavaScriptadvanced

Detect conflicting calendar slots

Return true when a proposed time slot overlaps an existing slot. Time ranges use half-open intervals: an event ending at 10:00 does not conflict with one starting at 10:00.

07
JSJavaScriptadvanced

Limit concurrent async tasks

Implement a scheduler that starts at most limit promise-returning tasks at a time and resolves results in input order.

08
JSJavaScriptadvanced

Model async request states

Implement a reducer for idle, loading, success, and error request states. Ignore stale response actions whose requestId does not match the active request.

09
Pythonadvanced

Model a retry result contract

Call an operation up to attempts times and return a result dictionary containing ok, value or error, and attempts_used. Do not retry KeyboardInterrupt or SystemExit.

10
Pythonadvanced

Summarize a text file safely

Design summarize_file so it reads UTF-8 text, returns line and word counts, and gives the caller a useful error result for a missing or undecodable file instead of crashing.

11
SQLadvanced

Build a complete department enrollment summary

Create an operations report that keeps every department—even departments with no courses—while counting its published courses and active enrollments. The joins must not inflate the course count, unpublished courses and cancelled enrollments must not contribute, and the final rows must be ordered by active demand.

12
CCbeginner

Count vowels in a C string

Return the number of English vowels in a null-terminated string. Count upper- and lower-case letters, and treat a null pointer as an empty string.

13
CCbeginner

Find the maximum safely

Implement find_max to write the greatest array value into out. Return 1 on success and 0 when the array is empty, the pointer is null, or out is null.

14
CCbeginner

Sum an integer array safely

Implement sum_array so it returns the sum of exactly length elements. The caller owns the array; handle a null pointer or zero length without dereferencing it.

15
CCbeginner

Swap two integers through pointers

Implement swap_ints so the caller's two integer variables exchange values. It must do nothing when either pointer is null.

16
CSSbeginner

Build a keyboard-friendly button

Style a primary button with clear hover, active, disabled, and keyboard focus states without relying on color alone.

17
CSSbeginner

Style a readable profile card

Turn the provided profile markup into a readable card with predictable spacing, a visible keyboard focus state, and a layout that stays usable at narrow widths.

18
JSJavaScriptbeginner

Group orders by status

Return an object whose keys are order statuses and whose values preserve the matching orders in their original order.

19
JSJavaScriptbeginner

Mask an email address for display

Return a privacy-friendly display value for a valid email: retain the first local-part character, replace the remaining local characters with asterisks, and keep the domain unchanged. Return null for malformed input.

20
JSJavaScriptbeginner

Normalize a list of tags

Return a new list of lower-case, trimmed tags with empty values removed and duplicates discarded while preserving first-seen order.

21
JSJavaScriptbeginner

Reverse the words

Return the words in a sentence in reverse order without reversing each word.

22
Pythonbeginner

Count unique words

Return a dictionary of lower-case word counts for a sentence, ignoring repeated whitespace and simple punctuation at word edges.

23
Pythonbeginner

Find duplicates

Return the repeated values from a list while preserving their first repeated order.

24
Pythonbeginner

Normalize an email address

Return a normalized email address by trimming surrounding whitespace and lower-casing its local and domain parts. Reject strings without exactly one @ and non-string input with None.

25
SQLbeginner

Build a filtered workshop availability report

A learning platform needs an accurate report of published workshops that students can still book. Complete the final SELECT so the report returns each workshop ID, title, level, and calculated remaining_seats. Exclude drafts and full workshops, then sort the smallest availability first and use the title to make ties deterministic.

26
CCintermediate

Copy a string with a capacity contract

Write copy_string that copies source into destination when capacity is non-zero, always terminates the destination, and reports failure if the source will not fit.

27
CCintermediate

Deduplicate a sorted integer array

Remove duplicates in-place from an ascending integer array and return the number of unique values. The retained prefix must preserve ascending order.

28
CCintermediate

Grow a dynamic integer buffer

Implement append_int so a heap-backed buffer grows geometrically, checks multiplication overflow, and leaves the original allocation untouched if realloc fails.

29
CCintermediate

Validate a command-line integer

Implement parse_quantity using strtol. Accept only a complete base-10 integer in range 0..100000, reject whitespace-only or trailing characters, and report success through the return value.

30
CSSintermediate

Build a responsive pricing grid

Create a card grid that moves from one column on small screens to as many balanced columns as will fit, without hard-coding a device breakpoint.

31
CSSintermediate

Create a fluid reading layout

Make an article layout whose type scales gently with the viewport while line length remains readable on wide displays.

32
JSJavaScriptintermediate

Build a safe query string

Convert a filter object into a query string, omitting null, undefined, empty strings, and false values while keeping zero.

33
JSJavaScriptintermediate

Calculate a cart total in cents

Return the total price in cents for cart lines. Ignore non-positive quantities and avoid floating-point money calculations.

34
JSJavaScriptintermediate

Group transactions

Group transactions by category and calculate an exact total for every category.

35
JSJavaScriptintermediate

Merge two sorted result lists

Merge two ascending arrays of numbers into one ascending array without sorting the final result and without changing either input array.

36
Pythonintermediate

Merge default settings safely

Merge user settings over defaults, but accept only known keys and return a new dictionary. Unknown user keys must be ignored.

37
Pythonintermediate

Valid parentheses

Determine whether every opening bracket in the input closes in the correct order.

38
Pythonintermediate

Validate structured records

Return only records with a non-empty name and a non-negative integer score. Do not modify the original dictionaries.

39
Reactintermediate

Build a filter hook

Implement a reusable hook for text search, category filters, and stable sorting.

→
Connect
Connect on SovranCodeForumQuestions and discussions→JournalPractical development notes→AboutWhy SovranCode exists→PricingFree, Plus, and Student Plus→
Services
SearchCreate account
Explore SovranCodeLearn, practice, and build.
LearnCourses5 free learning paths→ExercisesPractice with live challenges→GuidesDirect answers for developers→E-booksFocused field guides→
BuildProjectsPortfolio-ready builds→TemplatesSovranCode team marketplace→Developer toolsFast browser utilities→
ConnectForumQuestions and discussions→JournalPractical development notes→AboutWhy SovranCode exists→PricingFree, Plus, and Student Plus→
Search
THE SOVRANCODE PLATFORM

Learn enough to build something real.

Start learning
100Learning modules
39exercises
6projects
2templates
4E-books
4guides
SovranCode

A free-first programming platform for people who learn best by understanding, practicing, and building.

● Core learning content is free
FollowYouTubePinterestX
LearnHTML courseCSS courseJSJavaScript coursePython courseC courseSQL courseDeveloper guidesAll exercises
BuildProjectsTemplate marketBuyer libraryTemplate licensesDeveloper toolsE-books
CommunityForumJournalContact
CompanyPricing previewAboutServicesPrivacyEnglish edition. Additional languages will be published only after full editorial review.
© 2026 SovranCode · Built for curious minds.Next.js · Node.js · PostgreSQL