Programming Exercises

Practice with real problems and instant feedback.

Basic: 98Intermediate: 97Advanced: 50
intermediatebash

Associative Array Counting

Use bash associative arrays to count occurrences of items in a list with proper key-value storage and iteration patterns.

basicbash

Conditional Tests and File Checks

Use bash test operators for file existence, string comparison, and numeric conditions.

basicbash

Exit Codes and Error Handling

Use bash exit codes and set -e for robust error handling in scripts with proper fail-fast behavior and pipeline safety.

basicbash

Function Arguments and Return

Write bash functions that accept arguments and return values via echo and exit codes.

intermediatebash

Getopts for CLI Options

Parse command-line options and arguments using bash getopts built-in with comprehensive examples and best practices for production use.

basicbash

Heredoc for Multiline Templates

Use bash heredoc syntax for generating multiline text files and configuration templates.

intermediatebash

Parallel Job Execution

Run multiple bash commands in parallel using background jobs and wait for completion.

basicbash

Pipeline Text Filtering

Use bash pipelines with grep, sort, and uniq to filter and analyze text data streams.

basicbash

String Manipulation Patterns

Use bash parameter expansion for substring extraction, replacement, and case conversion.

intermediatebash

Trap for Cleanup on Exit

Use bash trap to run cleanup functions on script exit, interrupt, or error signals.

basiccss

Keyframe Animations

Create smooth CSS animations using keyframes with timing functions and delays.

advancedcss

Container Queries for Components

Use CSS container queries for responsive components that adapt to their container size.

intermediatecss

CSS Custom Properties Theming

Use CSS custom properties for dynamic theming with runtime variable updates.

basiccss

Flexbox Navigation Bar

Create a responsive navigation bar using CSS flexbox with space-between alignment.

intermediatecss

Fluid Typography with Clamp

Use CSS clamp function for fluid typography that scales smoothly between viewport sizes.

intermediatecss

CSS Grid Dashboard Layout

Create a dashboard layout using CSS Grid with named template areas for responsive panels.

basiccss

Pseudo-Elements for Decorations

Use CSS pseudo-elements ::before and ::after for decorative content and effects.

basiccss

Media Query Breakpoints

Use CSS media queries for responsive design with mobile-first breakpoint strategy.

intermediatecss

Scroll Snap for Carousels

Use CSS scroll-snap properties for touch-friendly carousel and gallery scrolling.

basiccss

Smooth CSS Transitions

Use CSS transitions for smooth state changes with custom timing and properties.

intermediatego

Go Channel Communication

Use Go channels for safe communication between goroutines with buffering and direction restrictions.

intermediatego

Channel Select Multiplexing

Use Go select statement to multiplex across multiple channels for concurrent communication.

advancedgo

Go Concurrent Pipeline

Build a multi-stage concurrent pipeline in Go using channels and goroutines for streaming data processing.

advancedgo

Go Context Cancellation

Use Go context package for cancellation propagation, timeouts, and request-scoped values across goroutines.

intermediatego

Context with Timeout

Use context.WithTimeout to cancel long-running operations and prevent resource leaks.

basicgo

Defer for Resource Cleanup

Use Go defer statements to ensure resource cleanup runs even when errors occur.

basicgo

Go Error Handling

Practice Go error handling patterns including checking errors, wrapping, and custom error types.

basicgo

Error Wrapping and Unwrapping

Use Go 1.13+ error wrapping with fmt.Errorf and errors.Is for contextual error handling.

advancedgo

Go Generic Constraints

Use Go generics with custom type constraints to implement type-safe algorithms for ordered and numeric types.

basicgo

Generic Min Function

Use Go 1.18+ generics to implement a type-safe min function for any ordered type.

intermediatego

Go Goroutine Basics

Use Go goroutines for concurrent execution with sync.WaitGroup to coordinate completion of parallel tasks.

intermediatego

Goroutine Worker Pool

Implement a worker pool using goroutines and channels for controlled concurrent task processing.

basicgo

Go String Basics

Learn Go string operations including concatenation, length, and rune counting for Unicode support.

intermediatego

Go Interface Implementation

Define and implement Go interfaces with multiple implementations and polymorphic dispatch.

basicgo

Interface Implementation

Define and implement Go interfaces for polymorphic behavior with implicit satisfaction.

basicgo

Go Loop and Range

Use Go for loops with range to iterate over slices, maps, and strings with proper index and value handling.

basicgo

Go Map Basics

Use Go maps for key-value storage with proper initialization, iteration, and existence checking.

intermediatego

Go Map-Reduce Pattern

Implement map and reduce higher-order functions in Go using generics for type-safe transformations.

intermediatego

Mutex for Shared State

Use sync.Mutex to protect shared state from concurrent access in goroutines.

advancedgo

Go Mutex Synchronization

Use Go sync.Mutex and RWMutex for safe concurrent access to shared state with proper locking patterns.

intermediatego

Go Recursive Factorial

Implement factorial in Go using recursion with proper base cases and overflow handling for large inputs.

advancedgo

Go Reflection Basics

Use Go reflect package to inspect struct fields, read tags, and set values dynamically at runtime.

basicgo

Go Slice Operations

Practice Go slice operations including append, copy, slicing, and capacity management.

intermediatego

Go Custom Slice Sorting

Use Go sort package with custom less functions and sort.Slice for sorting structs by multiple criteria.

basicgo

Slice Operations

Perform common slice operations including append, copy, and sub-slicing in Go.

basicgo

Go String Formatting

Use Go fmt package for string formatting with verbs, width, precision, and struct printing.

basicgo

Go Struct Basics

Define and use Go structs with methods, embedding, and tags for structured data modeling.

intermediatego

Go Struct Embedding

Use Go struct embedding to compose types and promote methods from embedded fields.

basicgo

Struct Tags for JSON

Use Go struct tags to control JSON serialization with field names and omitempty options.

intermediatehtml

ARIA Labels for Accessibility

Use ARIA attributes to improve accessibility of interactive elements for screen readers.

advancedhtml

Custom Elements API

Create custom HTML elements using the Web Components Custom Elements API.

basichtml

Data Attributes for State

Use HTML5 data attributes to store custom data and state on elements for JavaScript access.

intermediatehtml

Native Dialog Element

Use the HTML dialog element for accessible modal dialogs with showModal and close methods.

basichtml

HTML5 Form Validation Attributes

Use HTML5 built-in validation attributes for client-side form validation without JavaScript.

basichtml

Lazy Loading Images

Use native loading=lazy attribute for deferred image loading to improve page performance.

basichtml

Meta Tags for SEO

Use HTML meta tags for SEO optimization including Open Graph and Twitter Card tags.

intermediatehtml

Responsive Images with Srcset

Use srcset and sizes attributes for responsive image loading based on viewport width.

basichtml

Semantic Article Structure

Build a semantically correct article using HTML5 sectioning elements for accessibility.

basichtml

Accessible Data Table

Create an accessible data table with proper scope, captions, and header associations.

basicjava

Java Array Sorting

Use Java Arrays.sort and custom comparators to sort arrays and collections in various orders.

basicjava

Java ArrayList Operations

Use Java ArrayList for dynamic array operations including add, remove, filter, and conversion.

intermediatejava

CompletableFuture Composition

Chain asynchronous operations using CompletableFuture with thenApply, thenCompose, and allOf.

advancedjava

Java Concurrent Locks

Use Java ReentrantLock and ReadWriteLock for fine-grained thread synchronization with tryLock and fairness.

intermediatejava

Java Date-Time API

Use Java java.time API (LocalDate, Duration, Period) for modern date arithmetic and formatting.

basicjava

Java Try-Catch Exception Handling

Use Java try-catch-finally blocks with multiple catch clauses and try-with-resources for auto-closing.

intermediatejava

Generic Methods with Bounds

Write Java generic methods with bounded type parameters for reusable algorithms.

intermediatejava

Java Generic Methods

Write Java generic methods with bounded type parameters for type-safe reusable algorithms.

basicjava

Java HashMap Operations

Use Java HashMap for key-value storage with put, get, containsKey, and iteration patterns.

intermediatejava

Java Interface Default Methods

Use Java interface default and static methods for backward-compatible API evolution and utility methods.

intermediatejava

Java Lambda Comparators

Use Java lambda expressions with Comparator.comparing for multi-criteria sorting of objects.

basicjava

Java Loop Control Flow

Use Java loop constructs with break, continue, and labeled loops for complex iteration control.

basicjava

Java Math Operations

Use Java Math class methods for common mathematical operations including power, sqrt, and rounding.

basicjava

Optional Chaining Methods

Use Java Optional for safe null handling with map, flatMap, and orElse methods.

intermediatejava

Pattern Matching for Switch

Use Java 21+ pattern matching in switch expressions for type-based branching with guards.

basicjava

Record Class for DTOs

Use Java 16+ record classes for concise data transfer objects with automatic equals and hashCode.

advancedjava

Java Reflection Field Access

Use Java reflection to inspect class fields, read annotations, and set values dynamically at runtime.

intermediatejava

Java Regex Pattern Matching

Use Java Pattern and Matcher classes for regex matching, group extraction, and replacement operations.

intermediatejava

Sealed Class Hierarchies

Use Java 17+ sealed classes and permits to create closed class hierarchies.

intermediatejava

Java Stream Collect

Use Java Stream API with collect, groupingBy, and Collectors for functional data aggregation.

basicjava

Stream Filter and Collect

Use Java Stream API to filter, map, and collect elements into various collection types.

advancedjava

Java Parallel Streams

Use Java parallel streams for concurrent data processing with fork-join pool and thread-safe collectors.

basicjava

Java StringBuilder Operations

Use Java StringBuilder for efficient string concatenation, reversal, and mutation operations.

basicjava

Text Blocks for Multiline Strings

Use Java 15+ text blocks for readable multiline string literals with formatted methods.

intermediatejava

Java Thread Basics

Create and manage Java threads using Runnable, Thread, and join for basic concurrent execution.

basicjava

Try-With-Resources

Use try-with-resources to automatically close AutoCloseable resources with proper exception handling.

basicjava

Local Variable Type Inference

Use Java var keyword for local variable type inference while maintaining type safety.

intermediatejavascript

Group Anagrams

Group an array of strings into sub-arrays where each group contains strings that are anagrams of each other.

basicjavascript

Flatten Nested Array

Flatten a nested array of arbitrary depth into a single-level array using recursion to handle all nesting levels.

basicjavascript

Array Sum Calculator

Write a function that calculates the sum of all numbers in an array using the reduce method for clean functional code.

advancedjavascript

Async Pool Executor

Implement a concurrency-limited async pool that runs promise-returning functions with a maximum number of concurrent executions.

intermediatejavascript

Binary Search Algorithm

Implement binary search on a sorted array to find the index of a target value in O(log n) time complexity.

basicjavascript

Binary to Decimal Converter

Convert a binary string representation to its decimal number equivalent using bit manipulation and iteration.

intermediatejavascript

Bubble Sort Implementation

Implement the bubble sort algorithm to sort an array of numbers in ascending order with an early exit optimization.

basicjavascript

Capitalize Words

Transform a string so that the first letter of each word is capitalized while the remaining letters are lowercase.

basicjavascript

Character Frequency Map

Build a frequency map counting how many times each character appears in a given string using a plain object.

basicjavascript

Vowel Counter

Count the number of vowels (a, e, i, o, u) in a given string, case-insensitively, using a regular expression.

intermediatejavascript

Curry Function

Implement a curry function that transforms a multi-argument function into a sequence of single-argument functions.

advancedjavascript

Date Difference Calculator

Calculate the difference between two dates in various units (days, hours, minutes) with proper timezone handling.

intermediatejavascript

Debounce Function

Implement a debounce function that delays invoking the provided function until after the specified wait time has elapsed.

intermediatejavascript

Deep Clone Object

Create a deep clone of a nested object or array, recursively copying all levels to avoid shared references.

advancedjavascript

Event Emitter Class

Implement a custom Event Emitter class with on, off, emit, and once methods for publish-subscribe event handling.

basicjavascript

Filter Even Numbers

Filter an array of numbers to return only the even values using the Array filter method and modulo operator.

basicjavascript

Find Maximum Value

Find the maximum value in an array of numbers using the spread operator with Math.max for a concise solution.

basicjavascript

FizzBuzz Classic

Implement the classic FizzBuzz problem: print Fizz for multiples of 3, Buzz for multiples of 5, and FizzBuzz for both.

advancedjavascript

Graph Breadth-First Search

Implement breadth-first search on a graph represented as an adjacency list, returning the order of visited nodes.

advancedjavascript

Graph Depth-First Search

Implement depth-first search on a graph using recursion, tracking visited nodes and returning the traversal order.

intermediatejavascript

JSON Schema Validation

Validate a JavaScript object against a simple schema, checking required fields and their types for data integrity.

advancedjavascript

0/1 Knapsack Dynamic Programming

Solve the 0/1 knapsack problem using dynamic programming to find the maximum value that fits within a weight capacity.

intermediatejavascript

Reverse Linked List

Reverse a singly linked list in place by iteratively reassigning next pointers to point to the previous node.

advancedjavascript

LRU Cache Implementation

Implement an LRU (Least Recently Used) cache with O(1) get and put operations using a Map for ordered storage.

intermediatejavascript

Matrix Transpose

Transpose a 2D matrix by swapping rows and columns, converting element at position [i][j] to position [j][i].

intermediatejavascript

Memoization Wrapper

Create a memoization wrapper that caches function results based on arguments to avoid redundant computations.

intermediatejavascript

Merge Overlapping Intervals

Given an array of intervals, merge all overlapping intervals and return a sorted array of non-overlapping intervals.

basicjavascript

Factorial Calculator

Compute the factorial of a non-negative integer using recursion, handling edge cases for zero and one.

basicjavascript

Object Merge Utility

Merge two JavaScript objects into one, with properties from the second object overriding the first when keys overlap.

basicjavascript

Palindrome Checker

Check whether a given string is a palindrome, ignoring case and non-alphanumeric characters for accurate detection.

intermediatejavascript

Promise Chain Sequencer

Execute an array of functions returning promises sequentially, passing each result to the next function in the chain.

intermediatejavascript

Queue Using Two Stacks

Implement a Queue data structure with enqueue and dequeue operations using only two internal stacks.

advancedjavascript

Quicksort Implementation

Implement the quicksort algorithm with in-place partitioning and median-of-three pivot selection for improved performance.

intermediatejavascript

Email Regex Validator

Validate email addresses using a regular expression pattern that checks for proper format and structure.

basicjavascript

Remove Array Duplicates

Remove duplicate values from an array while preserving the order of first occurrences using a Set for efficiency.

advancedjavascript

Segment Tree Range Sum

Build a segment tree for efficient range sum queries and point updates on an array of numbers in O(log n) time.

intermediatejavascript

Stack Implementation

Implement a Stack data structure with push, pop, peek, and isEmpty methods using a JavaScript array internally.

basicjavascript

String Reversal

Reverse a given string using built-in JavaScript array and string methods for a clean and readable solution.

basicjavascript

Sum of Digits

Calculate the sum of all individual digits in a non-negative integer using both iterative and string approaches.

advancedjavascript

Trie Data Structure

Implement a Trie (prefix tree) with insert, search, and startsWith methods for efficient string prefix operations.

advancedpython

Python Abstract Base Class

Use Python ABC module to define abstract base classes with abstract methods that enforce implementation in subclasses.

advancedpython

Async Gather Concurrent Tasks

Use asyncio.gather to run multiple async tasks concurrently and collect results in order.

intermediatepython

Python Binary Search with Bisect

Use Python bisect module for efficient binary search and insertion in sorted lists.

intermediatepython

Python Class Inheritance

Implement a class hierarchy with inheritance, method overriding, and super() calls in Python.

intermediatepython

Python Collections Counter

Use Python collections.Counter for efficient frequency counting, most common elements, and arithmetic operations.

intermediatepython

Custom Context Manager

Implement a custom context manager using __enter__ and __exit__ for resource management.

advancedpython

Python Coroutine Pipeline

Build a data processing pipeline using Python coroutines with send() for streaming data transformation.

intermediatepython

Dataclass with Validation

Use Python dataclasses with __post_init__ for automatic field validation and default factories.

intermediatepython

Python Datetime Arithmetic

Use Python datetime module to perform date arithmetic, calculate differences, and handle timezone-aware operations.

intermediatepython

Decorator with LRU Cache

Combine custom decorators with functools.lru_cache for memoized function calls.

intermediatepython

Python Decorator Pattern

Implement a Python decorator that measures and logs function execution time using functools.wraps for metadata preservation.

advancedpython

Python Descriptor Protocol

Implement a Python descriptor using __get__ and __set__ to create a validated attribute that enforces type constraints.

basicpython

Dictionary Merge and Update

Merge dictionaries using Python 3.9+ merge operator and update method with conflict resolution.

basicpython

Python Dictionary Operations

Perform common dictionary operations including merging, filtering, and transforming values in Python.

advancedpython

Python LCS Dynamic Programming

Implement the longest common subsequence algorithm using dynamic programming with a 2D table.

basicpython

Python Exception Handling

Use Python try-except-else-finally blocks to handle different exception types and ensure cleanup code runs.

basicpython

Python File Reading

Read a text file line by line in Python, processing each line and handling file not found errors gracefully.

basicpython

Python Default Arguments

Use Python default parameter values and keyword arguments to create flexible and configurable functions.

intermediatepython

Python Generator Functions

Use Python generator functions with yield to create memory-efficient lazy sequences for large data processing.

intermediatepython

Generator Functions with Yield

Create generator functions using yield for memory-efficient lazy evaluation of large sequences.

advancedpython

Python Dijkstra Shortest Path

Implement Dijkstra algorithm for finding shortest paths in a weighted graph using a priority queue.

intermediatepython

Python Itertools Chains

Use Python itertools module to chain, slice, and group iterables for efficient lazy data processing.

basicpython

List Comprehension Patterns

Use Python list comprehensions with conditions and nested loops for concise data transformation.

basicpython

Python Loop Patterns

Use Python enumerate, zip, and range patterns for common iteration tasks with proper unpacking.

intermediatepython

Memoized Fibonacci

Implement memoized Fibonacci using functools.lru_cache for O(n) time complexity instead of exponential.

advancedpython

Python Metaclass Basics

Implement a custom metaclass that automatically adds validation methods to classes based on their field definitions.

intermediatepython

Python NamedTuple Usage

Use Python namedtuple for creating lightweight immutable record types with named field access.

advancedpython

Python Recursive Descent Parser

Implement a recursive descent parser for simple arithmetic expressions with operator precedence and parentheses.

basicpython

Regex Named Groups

Use Python regex named groups for extracting structured data from text patterns.

intermediatepython

Python Regex Substitution

Use Python re module for pattern matching and substitution with capture groups and replacement functions.

basicpython

Python Set Operations

Use Python set operations (union, intersection, difference) to compare and manipulate collections of unique elements.

intermediatepython

Python Sorted with Key Function

Use Python sorted() with custom key functions for multi-criteria sorting and complex comparison logic.

basicpython

SQL Parameterized Queries

Use parameterized queries with sqlite3 to prevent SQL injection and safely pass user input.

basicpython

Python String Formatting

Use Python f-strings and format methods to create formatted output with variables, alignment, and number precision.

basicpython

Python String Methods

Use Python string methods (split, join, strip, replace, find) for common text processing tasks.

basicpython

Python Tuple Unpacking

Use Python tuple unpacking and the star expression to extract values from tuples of varying structures.

intermediatepython

TypedDict for Structured Dicts

Use TypedDict to create type-checked dictionary structures with mypy static analysis.

advancedrust

Rust Async/Await

Use Rust async/await with tokio runtime for concurrent asynchronous operations and task spawning.

intermediaterust

Closures and Capture

Use Rust closures with move semantics and Fn, FnMut, FnOnce traits for captured variables.

intermediaterust

Rust Closures and Capture

Use Rust closures with different capture modes (by reference, by mutable reference, by value) and the move keyword.

basicrust

HashMap Operations

Use Rust HashMap for key-value storage with insertion, lookup, and iteration patterns.

advancedrust

Thread Spawning with Channels

Use std::thread and mpsc channels for safe message passing between Rust threads.

intermediaterust

Result Type Error Handling

Use Rust Result type for explicit error handling without exceptions using match and ? operator.

advancedrust

Rust Generic Traits

Define and implement generic traits in Rust with associated types and generic methods.

intermediaterust

Rust Iterator Adapters

Chain Rust iterator adapters like map, filter, enumerate, and collect for functional data transformation.

basicrust

Iterator Map and Filter

Use Rust iterator adaptors map, filter, and collect for functional data transformation.

intermediaterust

Rust Lifetime Annotations

Use Rust lifetime annotations to express relationships between references in function signatures.

advancedrust

Explicit Lifetime Annotations

Use explicit lifetime annotations to tell the borrow checker about reference relationships.

advancedrust

Rust Declarative Macros

Write Rust declarative macros with macro_rules! for code generation and pattern-based syntax extension.

basicrust

Ownership and Move Semantics

Demonstrate Rust ownership rules with move semantics and borrowing to prevent data races.

basicrust

Rust Ownership Transfer

Learn Rust ownership rules by transferring ownership between functions and using references to borrow values.

basicrust

Pattern Matching with Enums

Use Rust pattern matching on enums with exhaustive match arms and guard clauses.

intermediaterust

Rust Pattern Matching

Use Rust match expressions with destructuring, guards, and binding for comprehensive pattern matching.

intermediaterust

Smart Pointers Box and Rc

Use Box for heap allocation and Rc for reference counting in Rust programs.

basicrust

Rust String Slices

Use Rust string slices (&str) for efficient substring access without copying string data.

basicrust

Rust Struct Basics

Define Rust structs with fields, implement methods, and use derive macros for common traits.

intermediaterust

Rust Trait Bounds

Use Rust trait bounds on generic functions to constrain type parameters to types implementing specific traits.

intermediaterust

Traits with Generic Bounds

Define and implement traits with generic type bounds for polymorphic behavior in Rust.

advancedrust

Rust Unsafe and FFI

Use Rust unsafe blocks for raw pointer dereferencing and FFI to call C functions safely.

basicrust

Rust Vector Iteration

Iterate over Rust vectors using various patterns: by value, by reference, and with iterator adaptors.

intermediatesql

SQL CASE Expressions

Use SQL CASE expressions for conditional logic and value transformation within queries.

advancedsql

Recursive CTE for Hierarchy

Use recursive common table expressions to traverse hierarchical data like org charts.

intermediatesql

SQL Common Table Expressions

Use SQL CTEs (WITH clause) for readable query decomposition and reusable intermediate result sets.

basicsql

Date Truncation for Grouping

Use date_trunc and extract functions to group time series data by various time periods.

intermediatesql

EXISTS vs IN Subqueries

Compare EXISTS and IN subquery performance and use appropriate pattern for each case.

basicsql

SQL GROUP BY with Aggregates

Use SQL GROUP BY with aggregate functions like COUNT, SUM, AVG, MIN, and MAX for data summarization.

intermediatesql

SQL HAVING Clause

Use SQL HAVING clause to filter groups after aggregation, complementing WHERE for pre-aggregation filtering.

basicsql

SQL INSERT and UPDATE

Use SQL INSERT to add rows and UPDATE to modify existing rows with WHERE conditions.

basicsql

Join with Aggregation

Combine table joins with GROUP BY aggregation for reporting queries with multiple tables.

basicsql

SQL INNER JOIN

Use SQL INNER JOIN to combine rows from two tables based on a related column between them.

advancedsql

JSON Data Querying

Query and extract data from JSON columns using PostgreSQL JSON operators and functions.

basicsql

NULL Handling with COALESCE

Use COALESCE, NULLIF, and IS NULL for robust NULL value handling in SQL queries.

basicsql

SQL ORDER BY and LIMIT

Use SQL ORDER BY for sorting and LIMIT/OFFSET for pagination to control result set size and order.

intermediatesql

Pivot Data with CASE

Transform rows to columns using CASE expressions for pivot-style data reshaping in SQL.

advancedsql

SQL Recursive CTE

Use SQL recursive CTEs to traverse hierarchical data like org charts, trees, and graph structures.

basicsql

SQL SELECT with WHERE

Write SQL SELECT queries with WHERE clauses to filter rows by various conditions and comparison operators.

intermediatesql

SQL Subqueries

Use SQL subqueries in WHERE, FROM, and SELECT clauses for nested data retrieval and filtering.

intermediatesql

SQL UNION and UNION ALL

Use SQL UNION and UNION ALL to combine result sets from multiple queries into a single result.

intermediatesql

UPSERT with ON CONFLICT

Use INSERT ON CONFLICT for atomic upsert operations in PostgreSQL with comprehensive examples and best practices for production use.

intermediatesql

SQL Window Functions

Use SQL window functions like ROW_NUMBER, RANK, and LAG for analytics without collapsing rows.

intermediatesql

Window Function Ranking

Use SQL window functions with RANK, DENSE_RANK, and ROW_NUMBER for analytical queries.

intermediatesql

Running Total with Window

Calculate running totals and moving averages using SQL window functions with frame clauses.

basictypescript

Typed Array Map Operation

Use the Array.map method with proper TypeScript generics to transform an array of numbers into an array of strings.

intermediatetypescript

Async/Await Error Handling

Write an async function with proper TypeScript error handling using try-catch and typed error responses.

advancedtypescript

Async Iterable Class

Implement an async iterable class using Symbol.asyncIterator for streaming data processing.

basictypescript

TypeScript Basic Type Annotations

Practice declaring variables with explicit TypeScript type annotations for numbers, strings, and booleans.

advancedtypescript

Branded Types for Nominal Typing

Implement branded types to achieve nominal typing in TypeScript structural type system for safer domain types.

intermediatetypescript

Type-Safe Builder Pattern

Implement a type-safe builder pattern using method chaining with TypeScript return types.

advancedtypescript

Conditional Types

Use conditional types to create type-level logic that selects types based on conditions.

advancedtypescript

Generic Curried Function Types

Create a fully typed curry function with TypeScript generics that preserves parameter types through partial application.

intermediatetypescript

Method Decorator Logging

Implement a method decorator that logs function calls with arguments and return values for debugging purposes.

advancedtypescript

Method Decorators

Implement method decorators for logging, timing, and access control in TypeScript classes.

intermediatetypescript

Discriminated Union Patterns

Use discriminated unions to model different action types with exhaustive switch handling in a reducer pattern.

advancedtypescript

Distributive Conditional Types

Explore distributive conditional types that distribute over union types for type-level computations.

basictypescript

Enum Iteration and Reverse Mapping

Iterate over TypeScript enum values and handle reverse mapping for numeric enums.

basictypescript

Enum Type Usage

Define and use a TypeScript enum to represent order status values with a function to check if an order is complete.

basictypescript

Function Overload Signatures

Use TypeScript function overload signatures to provide different return types based on input parameter types.

intermediatetypescript

Generic Stack Class

Implement a type-safe generic stack class in TypeScript with push, pop, and peek methods.

intermediatetypescript

Generic Type Inference

Write a generic identity function and a generic pair factory, demonstrating TypeScript automatic type inference.

advancedtypescript

Type Inference in Conditional Types

Use the infer keyword in conditional types to extract and manipulate types from complex generic structures.

basictypescript

Interface Definition Basics

Define a TypeScript interface for a User object with required and optional properties, then create a function to display user info.

intermediatetypescript

Iterator Protocol Implementation

Implement a custom iterator using the Symbol.iterator protocol for a range class that yields numbers.

advancedtypescript

Mapped Types

Create mapped types that transform existing type properties into new type structures.

advancedtypescript

Phantom Types for Safety

Use phantom types to create type-level tags that distinguish values at compile time without runtime overhead.

intermediatetypescript

Typed Promise.all

Use Promise.all with proper TypeScript typing to run multiple async operations in parallel and collect typed results.

basictypescript

Readonly Array Types

Use TypeScript readonly array types to prevent mutation of array parameters in functions.

intermediatetypescript

Record Type for Maps

Use the Record utility type to create type-safe map objects with specific key and value types.

advancedtypescript

Recursive Type Definitions

Define a recursive TypeScript type for a tree structure and write a function to traverse it depth-first.

intermediatetypescript

Result Type for Error Handling

Implement a Result type for explicit error handling without exceptions in TypeScript.

basictypescript

Template Literal Types

Use TypeScript template literal types to create type-safe string patterns for HTTP method and path combinations.

advancedtypescript

Template Literal Type Inference

Use infer in template literal types to extract parts of type-safe string patterns at the type level.

intermediatetypescript

Advanced Template Literal Types

Use template literal types to create type-safe event names and CSS property selectors with string interpolation.

basictypescript

Tuple Type Operations

Use TypeScript tuple types to represent fixed-length arrays with specific element types at each position.

basictypescript

Type Assertion Safety

Use TypeScript type assertions to narrow an unknown value to a specific type with runtime validation.

intermediatetypescript

Custom Type Guard Functions

Write custom type guard functions using the is operator to narrow unknown data to specific types at runtime.

intermediatetypescript

Custom Type Guards

Write custom type guard functions to narrow union types at runtime in TypeScript.

basictypescript

Union Type Handling

Use TypeScript union types to handle values that can be one of several types, with proper type narrowing.

advancedtypescript

Custom Utility Types

Create custom utility types for deep partial, deep readonly, and path-based property access.

advancedtypescript

Variance in Generic Types

Explore TypeScript variance rules with covariant arrays and contravariant function parameters.