HTML Introduction
What HTML is, what a web page is made of, and your first complete HTML page that you…
Try: HTML forms, JavaScript loops, SQL joins, AI agents
Tutorials
Choose a learning path and follow the lessons in order. Mark each lesson complete as you go. Your progress is saved in this browser.
The language for building web pages. Start here if you are new to web development.
What HTML is, what a web page is made of, and your first complete HTML page that you…
Write HTML on your own computer: create your first .html file in Notepad or TextEdit, then set up…
The outline every HTML page shares: doctype, html, head, title, meta tags and body, what each one does…
How HTML elements work: opening and closing tags, content, nesting elements correctly, empty elements like br and img,…
Attributes give elements extra information: href for links, src and alt for images, lang, title, id and class,…
The six heading levels from h1 to h6, how to build a clear outline with them, and why…
How the p element works, why browsers ignore your extra spaces, and when to use line breaks, horizontal…
Bold, italic, highlighted, small, deleted, inserted, subscript and superscript text, and the difference between strong and b, em…
Create links with the a element: absolute and relative URLs, opening links in a new tab safely, linking…
Add images with the img element, write useful alt text, set width and height, choose the right file…
Unordered, ordered and description lists, nested lists, numbering options and why navigation menus are built from lists.
Build tables with table, tr, th and td; add headers, captions and sections; merge cells with colspan and…
Block and inline elements explained, and how the generic div and span containers group content for styling and…
Name elements with the class and id attributes, use them from CSS and JavaScript, and learn the naming…
How forms collect information: the form element, action and method, labels, text inputs, the name attribute and submit…
Every common input type, from email, number and date to checkboxes, radio buttons and dropdowns, plus built-in validation…
Describe the parts of a page with header, nav, main, article, section, aside and footer, and see why…
Play sound and video with the audio and video elements, offer several file formats, add captions, and embed…
Make pages everyone can use: who relies on accessibility, keyboard access, alt text, labels, contrast, headings, landmarks and…
Put the whole HTML course into practice by building a complete, accessible personal profile page step by step,…
The language for styling web pages: colours, layouts, Flexbox, Grid and responsive design.
What CSS is, how a CSS rule is built from a selector and declarations, and why separating style…
The three ways to add CSS (inline styles, internal style elements and external stylesheets), when to use each…
Element, class, id, group, descendant, child, attribute and pseudo-class selectors, plus specificity, the rule that decides which style…
Colour names, hex codes, rgb, hsl and transparency, how to pick a small colour palette, and how to…
Background colours, images, repeat, position, size, cover and contain, gradients and the background shorthand, with a hero banner…
Border width, style and colour, single sides, the border shorthand, rounded corners with border-radius, circles, outlines and box…
The difference between padding (space inside) and margin (space outside), the one-to-four value shorthand, centring with auto, and…
Every element is a box of content, padding, border and margin. Learn how its size is calculated, why…
Set sizes with px, %, rem, vw and vh, use max-width and min-height for flexible layouts, and control…
Font families and fallbacks, web fonts, size, weight and line height, alignment, decoration, transform and spacing, plus rules…
How the display property controls layout: block, inline, inline-block, none, flex and grid, plus hiding elements correctly with…
Static, relative, absolute, fixed and sticky positioning explained with badges, overlays, sticky headers and back-to-top buttons, plus z-index…
Lay out items in a row or column with Flexbox: flex containers, direction, justify-content, align-items, gap and wrapping,…
Control flex items with flex-grow, flex-shrink, flex-basis and the flex shorthand, then build a sidebar layout, equal cards,…
Build two-dimensional layouts with CSS Grid: grid containers, columns and rows, the fr unit, repeat(), gap, and placing…
Build full page layouts with grid-template-areas, make responsive card grids with auto-fit and minmax(), and combine Grid with…
Make pages work on every screen: the viewport meta tag, mobile-first CSS, media queries and breakpoints, fluid type…
Animate changes smoothly with transition, move, scale and rotate elements with transform, choose easing, and add simple keyframe…
Store colours, spacing and fonts in custom properties, use var() with fallbacks, build a dark mode, and organise…
Turn the plain HTML profile page into a modern, responsive design with variables, Flexbox, Grid, cards, a dark…
The language that makes web pages interactive, from your first variable to working with the DOM.
What JavaScript is, what it can do in the browser and beyond, how it relates to HTML and…
Add JavaScript with script elements and external .js files, understand why placement matters, and load scripts correctly with…
Show results with console.log and its relatives, write into the page with textContent, use alert sparingly, and debug…
Store values in variables with let and const, learn naming rules, when to use each keyword, and why…
Strings, numbers, booleans, undefined, null, objects and arrays; checking types with typeof; and how JavaScript converts between types.
Arithmetic, assignment, comparison and logical operators, why to use === instead of ==, the ternary operator, and nullish…
Create and combine strings, read characters, and use the essential string methods to search, slice, change case, trim,…
Work with numbers: rounding, fixed decimals, converting from strings, NaN checks, the Math object, random numbers and formatting…
Make decisions with if, else if and else, combine conditions, use truthy checks, write guard clauses and avoid…
Choose between many exact values with switch, understand break and fall-through, use default, and know when an object…
Repeat code with for, while, do...while, for...of and for...in loops, control them with break and continue, and avoid…
Store ordered lists in arrays: create them, read and change items by index, add and remove with push,…
Transform and search data with forEach, map, filter, find, some, every and reduce, and chain them together to…
Group related data with objects: create them, read and update properties with dot and bracket notation, loop over…
Write reusable code with functions: declarations, parameters and arguments, return values, default and rest parameters, and functions as…
Write short functions with the arrow syntax, learn implicit returns and returning objects, and understand how arrow functions…
Global, function and block scope explained, why let and const beat var, how shadowing works, and a first…
What the DOM is, and how to find elements with getElementById, querySelector and querySelectorAll, loop over results, and…
Change text, HTML, attributes, classes and styles, create and insert new elements, remove elements, and render a list…
Respond to clicks, typing and keys with addEventListener, use the event object, prevent default actions, and handle many…
Read form values, handle submit, validate input with clear error messages, combine HTML validation with JavaScript, and use…
Save data in the browser with localStorage and sessionStorage, store objects with JSON, handle errors, and remember a…
Load data from APIs with fetch, understand JSON and HTTP status codes, handle errors, send data with POST,…
Understand asynchronous JavaScript, Promises and the event loop, then write clear async code with async/await, try/catch, and parallel…
Build a complete to-do list app step by step with state, rendering, events, delegation, filters and localStorage, using…
The language for storing and querying data in databases like MySQL and PostgreSQL.
What databases and SQL are, why almost every app uses them, the main database systems, and how to…
Create tables with CREATE TABLE, choose data types, understand primary keys and NULL, and load the practice shop…
Read data with SELECT: choose columns, avoid SELECT * in real code, rename columns with AS, calculate new…
Filter rows with WHERE using comparison operators, AND, OR and NOT, IN, BETWEEN, LIKE patterns and IS NULL,…
Sort query results with ORDER BY, ascending and descending, by several columns and by calculated values, handle NULLs,…
Add rows with INSERT INTO, list columns explicitly, insert several rows at once, use defaults and auto-generated ids,…
Change existing rows with UPDATE and SET, always target rows with WHERE, update several columns and calculated values,…
Remove rows with DELETE safely, understand how foreign keys protect related data, compare DELETE, TRUNCATE and DROP, and…
Summarise data with aggregate functions COUNT, SUM, AVG, MIN and MAX, understand how they treat NULL, and use…
Calculate totals per category, per customer and per month with GROUP BY, filter groups with HAVING, and understand…
Combine rows from related tables with INNER JOIN, use table aliases, join three or four tables, and build…
Keep every row from the first table with LEFT JOIN, find rows without matches, count zero values correctly,…
Protect data quality with PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, CHECK and DEFAULT constraints, choose ON DELETE…
How indexes make queries fast, when to create them, composite indexes and column order, reading EXPLAIN plans, and…
Design, build and query a complete library database with authors, books, members and loans, using tables, constraints, joins,…
A beginner-friendly language used for automation, data and AI.
What Python is, why it's the most popular first programming language, what people build with it, and your…
Install Python 3 on Windows, macOS or Linux, check it works, use the interactive shell, run your first…
The basic grammar of Python: statements, indentation and blocks, comments and docstrings, long lines, naming rules and reading…
Create variables with assignment, understand that names refer to objects, assign several values at once, swap values, use…
Python's built-in types (int, float, str, bool, None, list, tuple, dict and set), checking types, converting between them,…
Create strings, index and slice them, use the essential string methods, format text with f-strings, and loop over…
Integers and floats, all arithmetic operators, rounding, the math and random modules, exact money calculations with Decimal, and…
Create, index, slice and change lists; add, remove, sort and search items; copy lists safely; and write list…
Use tuples for fixed groups of values and unpacking, and sets for unique items, fast membership tests and…
Store key-value data in dictionaries: read safely with get, add, update and delete keys, loop over items, nest…
Make decisions with if, elif and else, combine conditions with and, or and not, use membership and identity…
Repeat code with for and while loops, use range, enumerate and zip, control loops with break, continue and…
Define functions with def, use parameters, return values, default and keyword arguments, *args and **kwargs, type hints, docstrings,…
Import modules, explore the standard library, write your own modules, understand if __name__ == "__main__", and organise code…
Read and write text files safely with open() and with, process files line by line, append data, work…
Handle errors with try, except, else and finally, catch specific exceptions, raise your own, create custom exception classes,…
Object-oriented programming in Python: define classes, create objects, use __init__, attributes and methods, class attributes, special methods, properties,…
Install third-party packages from PyPI with pip, isolate projects with virtual environments, record dependencies in requirements.txt, and choose…
Convert between Python and JSON, save and load JSON files, call web APIs with urllib and requests, send…
Build a command-line expense tracker step by step with a dataclass, functions, JSON storage, error handling, reports by…
What Java is, why it powers banks, Android and big companies, how the JDK, JRE and JVM fit…
Install the JDK on Windows, Mac or Linux, compile and run with javac and java, try code instantly…
Declare variables, learn Java's eight primitive types, String, var, constants with final, type casting, integer overflow and naming…
Arithmetic, assignment, comparison, logical, increment and ternary operators in Java, operator precedence, short-circuit evaluation and the Math class.
Create and use Strings in Java, the most useful String methods, why == fails and equals() works, the…
Read numbers and text from the keyboard with Scanner, avoid the nextInt/nextLine trap, validate input, and print neat…
Make decisions in Java with if, else if, else, nested conditions, the classic switch statement and the modern…
Repeat work with for, while, do-while and the enhanced for-each loop, control loops with break and continue, nested…
Store many values in one variable with Java arrays, loop over them, find max and average, use 2D…
Write reusable Java methods with parameters and return values, understand pass-by-value, overload methods, use varargs and watch recursion…
Use ArrayList, LinkedList, HashSet and TreeSet, understand how an ArrayList grows, generics, wrapper classes, autoboxing, iterating safely and…
Store key-value pairs with HashMap, LinkedHashMap and TreeMap, count frequencies with merge and getOrDefault, iterate entries, and see…
Data structures and algorithms, one pattern at a time, with live animations you can play, pause and replay.
What data structures and algorithms really are, why every big tech interview tests them, the 15 patterns that…
Measure how an algorithm's work grows with input size. Learn O(1), O(log n), O(n), O(n log n), O(n²)…
How arrays live in memory, why indexing is O(1) but inserting is O(n), linear search, in-place techniques, and…
The most useful tool in DSA. How hash maps and sets give O(1) lookups, and the patterns they…
Solve sorted-array and pair problems in one pass with O(1) memory. Opposite-end pointers, slow and fast writer pointers,…
Solve "best contiguous subarray or substring" problems in O(n). Fixed-size windows, growing and shrinking windows, and the template…
Precompute running totals once and answer any range sum in O(1). Then combine prefix sums with a hash…
Find the contiguous subarray with the biggest sum in one pass. The "extend or restart" idea behind Kadane's…
Halve the search space every step for O(log n). The bug-free template, first and last positions, search insert…
Bubble, selection and insertion sort animated step by step, what stable sorting means, Python's built-in sort with custom…
The two classic O(n log n) sorting algorithms, animated. Divide and conquer, merging sorted halves, partitioning around a…
Functions that call themselves, explained with a live call tree. Base cases, the call stack, the "trust the…
Explore every choice with choose, explore, un-choose. Subsets, permutations, combination sum, generate parentheses and word search, with a…
Nodes connected by pointers. Build a linked list in Python, traverse, insert and delete, reverse it with three…
The tortoise and hare technique. Find the middle of a linked list, detect cycles and where they start,…
Last in, first out. Use Python lists as stacks, match brackets (animated), build a min stack, evaluate expressions,…
A stack kept in sorted order answers "next greater" and "previous smaller" questions in O(n). Daily temperatures, stock…
First in, first out. Use collections.deque for O(1) queues, build a queue from two stacks, process things in…
Nodes with left and right children. Build trees in Python, watch inorder, preorder, postorder and level-order traversals, and…
Trees kept in sorted order. Search and insert in O(log n) (animated), validate a BST with bounds, find…
Always know the smallest item in O(1) and add or remove in O(log n). Python's heapq, max-heaps with…
Model networks of friends, cities and web pages. Adjacency lists, breadth-first and depth-first search animated, connected components, shortest…
Treat a 2D grid as a graph. Count islands with flood fill (animated), find the largest area, spread…
Order tasks so every prerequisite comes first. Kahn's algorithm with in-degrees (animated), the DFS version, detecting impossible cyclic…
Find the cheapest route in a weighted graph. Dijkstra's algorithm with a heap (animated), why it needs non-negative…
Dynamic programming without the fear. Remember answers instead of recomputing them. Memoization vs tabulation, climbing stairs and coin…
DP tables with rows and columns. Unique paths in a grid, longest common subsequence animated cell by cell,…
Make the best local choice and never look back. When greedy works (and when it fails), merging intervals…
Everything in one place. A pattern cheat sheet that maps problem clues to techniques, a 6-step method for…
Classic coding interview problems solved step by step: brute force first, then the optimal pattern, in Python.
Find two numbers that add up to a target. The most famous interview warm-up, solved in one pass…
Does any value appear twice? Three solutions from slow to fast, and why a set wins.
Are two words made of exactly the same letters? Count letters with a dictionary or Counter.
Put words with the same letters into groups. The trick is choosing a good dictionary key.
Return the k most common numbers. Count with a dictionary, then pick the top k with a heap…
For every position, multiply everything except that number, without using division. Prefix and suffix products make it O(n).
Find the longest run of consecutive numbers in an unsorted list in O(n), by only counting from the…
Does a sentence read the same backwards, ignoring spaces and punctuation? Two pointers walking towards each other.
Pick two walls that hold the most water. Start wide and always move the shorter wall inwards.
Find all unique triplets that sum to zero. Sort, fix one number, then run two pointers on the…
How much rain collects between bars of different heights? The water above each bar depends on the tallest…
Buy once, sell once, maximise profit. Track the cheapest price so far in a single pass.
The textbook sliding window problem. Grow the window to the right; when a letter repeats, shrink from the…
Find the smallest part of a string that contains every letter of another string. Expand until valid, then…
Count continuous subarrays that add up to k, even with negative numbers. Prefix sums plus a hash map…
Find the continuous part of a list with the biggest sum. Kadane's algorithm: keep going while the running…
Find a target in a sorted list in O(log n). The bug-free template, first and last position, and…
A sorted list was rotated at an unknown point. Binary search still works, because one half is always…
Binary search on the answer. Find the slowest eating speed that still finishes all bananas in time.
Are the brackets balanced and correctly nested? Push opening brackets on a stack; each closing bracket must match…
Design a stack that returns its minimum in O(1). Store the minimum-so-far alongside every item.
How many days until a warmer day? A monotonic stack of waiting days answers it in one pass.
The biggest rectangle that fits under a bar chart. For each bar, find how far it can stretch…
Flip the direction of every arrow in a linked list with three pointers. Iterative and recursive versions.
Zip two sorted linked lists into one sorted list. The dummy node trick removes every special case.
Does a linked list loop back on itself? A tortoise and a hare running at different speeds will…
Design a cache that throws out the least recently used item when full, with O(1) get and put.…
How many levels does a tree have? A three-line recursive answer, plus the level-by-level BFS version.
Mirror a binary tree by swapping every node's left and right children. Short, famous and a perfect recursion…
Return the tree's values level by level. BFS with a queue, processing one whole level per loop.
Is a tree a valid BST? Checking only parent and child is a trap; pass an allowed range…
Find the deepest node that has both p and q below it. One elegant recursion that reports what…
Find the k-th largest number without sorting everything. A min-heap of size k, plus quickselect for an average…
Merge many sorted linked lists into one. A min-heap always tells you which list has the next smallest…
Count groups of connected land in a grid. Each time you step on new land, count it and…
How many minutes until every orange rots? Multi-source BFS where each level of the queue is one minute.
Can you finish every course given the prerequisites? Only if there's no cycle. Kahn's algorithm takes courses as…
How long until a signal reaches every computer? Dijkstra's shortest paths, then take the slowest arrival.
Change one letter at a time to turn one word into another. Words are nodes, one-letter changes are…
List every possible subset. For each item, choose "take it" or "skip it"; backtracking explores both.
List every ordering of a set of numbers. Fill positions one by one with numbers not used yet,…
Find every combination of numbers (reusable) that adds up to a target. Backtracking with a start index and…
How many ways to climb n stairs taking 1 or 2 steps? The gentlest introduction to dynamic programming.
Take the most money without robbing two neighbouring houses. At each house, choose "rob it" or "skip it",…
The fewest coins that make an amount. Why greedy fails, and how a DP table builds every amount…
The longest rising sequence you can pick from a list (gaps allowed). An O(n²) DP, then a clever…
The longest sequence of letters two strings share in order. The doorway into 2D dynamic programming, with an…
The fewest insertions, deletions and replacements to turn one word into another. The algorithm behind spell-checkers and DNA…
Combine overlapping time ranges into one. Sort by start, then extend or start a new block in a…
How many meeting rooms do you need? Sort by start and keep a min-heap of end times, or…
Can you reach the last index if each number is your maximum jump? Track the farthest reachable point…
Get new lessons in your inbox
One email when we publish a new tutorial or guide. No spam, unsubscribe in one click.
Try it yourself
Code (edit me)
Result