Programming Exercises
Practice with real problems and instant feedback.
Associative Array Counting
Use bash associative arrays to count occurrences of items in a list with proper key-value storage and iteration patterns.
Conditional Tests and File Checks
Use bash test operators for file existence, string comparison, and numeric conditions.
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.
Function Arguments and Return
Write bash functions that accept arguments and return values via echo and exit codes.
Getopts for CLI Options
Parse command-line options and arguments using bash getopts built-in with comprehensive examples and best practices for production use.
Heredoc for Multiline Templates
Use bash heredoc syntax for generating multiline text files and configuration templates.
Parallel Job Execution
Run multiple bash commands in parallel using background jobs and wait for completion.
Pipeline Text Filtering
Use bash pipelines with grep, sort, and uniq to filter and analyze text data streams.
String Manipulation Patterns
Use bash parameter expansion for substring extraction, replacement, and case conversion.
Trap for Cleanup on Exit
Use bash trap to run cleanup functions on script exit, interrupt, or error signals.
Keyframe Animations
Create smooth CSS animations using keyframes with timing functions and delays.
Container Queries for Components
Use CSS container queries for responsive components that adapt to their container size.
CSS Custom Properties Theming
Use CSS custom properties for dynamic theming with runtime variable updates.
Flexbox Navigation Bar
Create a responsive navigation bar using CSS flexbox with space-between alignment.
Fluid Typography with Clamp
Use CSS clamp function for fluid typography that scales smoothly between viewport sizes.
CSS Grid Dashboard Layout
Create a dashboard layout using CSS Grid with named template areas for responsive panels.
Pseudo-Elements for Decorations
Use CSS pseudo-elements ::before and ::after for decorative content and effects.
Media Query Breakpoints
Use CSS media queries for responsive design with mobile-first breakpoint strategy.
Scroll Snap for Carousels
Use CSS scroll-snap properties for touch-friendly carousel and gallery scrolling.
Smooth CSS Transitions
Use CSS transitions for smooth state changes with custom timing and properties.
Go Channel Communication
Use Go channels for safe communication between goroutines with buffering and direction restrictions.
Channel Select Multiplexing
Use Go select statement to multiplex across multiple channels for concurrent communication.
Go Concurrent Pipeline
Build a multi-stage concurrent pipeline in Go using channels and goroutines for streaming data processing.
Go Context Cancellation
Use Go context package for cancellation propagation, timeouts, and request-scoped values across goroutines.
Context with Timeout
Use context.WithTimeout to cancel long-running operations and prevent resource leaks.
Defer for Resource Cleanup
Use Go defer statements to ensure resource cleanup runs even when errors occur.
Go Error Handling
Practice Go error handling patterns including checking errors, wrapping, and custom error types.
Error Wrapping and Unwrapping
Use Go 1.13+ error wrapping with fmt.Errorf and errors.Is for contextual error handling.
Go Generic Constraints
Use Go generics with custom type constraints to implement type-safe algorithms for ordered and numeric types.
Generic Min Function
Use Go 1.18+ generics to implement a type-safe min function for any ordered type.
Go Goroutine Basics
Use Go goroutines for concurrent execution with sync.WaitGroup to coordinate completion of parallel tasks.
Goroutine Worker Pool
Implement a worker pool using goroutines and channels for controlled concurrent task processing.
Go String Basics
Learn Go string operations including concatenation, length, and rune counting for Unicode support.
Go Interface Implementation
Define and implement Go interfaces with multiple implementations and polymorphic dispatch.
Interface Implementation
Define and implement Go interfaces for polymorphic behavior with implicit satisfaction.
Go Loop and Range
Use Go for loops with range to iterate over slices, maps, and strings with proper index and value handling.
Go Map Basics
Use Go maps for key-value storage with proper initialization, iteration, and existence checking.
Go Map-Reduce Pattern
Implement map and reduce higher-order functions in Go using generics for type-safe transformations.
Mutex for Shared State
Use sync.Mutex to protect shared state from concurrent access in goroutines.
Go Mutex Synchronization
Use Go sync.Mutex and RWMutex for safe concurrent access to shared state with proper locking patterns.
Go Recursive Factorial
Implement factorial in Go using recursion with proper base cases and overflow handling for large inputs.
Go Reflection Basics
Use Go reflect package to inspect struct fields, read tags, and set values dynamically at runtime.
Go Slice Operations
Practice Go slice operations including append, copy, slicing, and capacity management.
Go Custom Slice Sorting
Use Go sort package with custom less functions and sort.Slice for sorting structs by multiple criteria.
Slice Operations
Perform common slice operations including append, copy, and sub-slicing in Go.
Go String Formatting
Use Go fmt package for string formatting with verbs, width, precision, and struct printing.
Go Struct Basics
Define and use Go structs with methods, embedding, and tags for structured data modeling.
Go Struct Embedding
Use Go struct embedding to compose types and promote methods from embedded fields.
Struct Tags for JSON
Use Go struct tags to control JSON serialization with field names and omitempty options.
ARIA Labels for Accessibility
Use ARIA attributes to improve accessibility of interactive elements for screen readers.
Custom Elements API
Create custom HTML elements using the Web Components Custom Elements API.
Data Attributes for State
Use HTML5 data attributes to store custom data and state on elements for JavaScript access.
Native Dialog Element
Use the HTML dialog element for accessible modal dialogs with showModal and close methods.
HTML5 Form Validation Attributes
Use HTML5 built-in validation attributes for client-side form validation without JavaScript.
Lazy Loading Images
Use native loading=lazy attribute for deferred image loading to improve page performance.
Meta Tags for SEO
Use HTML meta tags for SEO optimization including Open Graph and Twitter Card tags.
Responsive Images with Srcset
Use srcset and sizes attributes for responsive image loading based on viewport width.
Semantic Article Structure
Build a semantically correct article using HTML5 sectioning elements for accessibility.
Accessible Data Table
Create an accessible data table with proper scope, captions, and header associations.
Java Array Sorting
Use Java Arrays.sort and custom comparators to sort arrays and collections in various orders.
Java ArrayList Operations
Use Java ArrayList for dynamic array operations including add, remove, filter, and conversion.
CompletableFuture Composition
Chain asynchronous operations using CompletableFuture with thenApply, thenCompose, and allOf.
Java Concurrent Locks
Use Java ReentrantLock and ReadWriteLock for fine-grained thread synchronization with tryLock and fairness.
Java Date-Time API
Use Java java.time API (LocalDate, Duration, Period) for modern date arithmetic and formatting.
Java Try-Catch Exception Handling
Use Java try-catch-finally blocks with multiple catch clauses and try-with-resources for auto-closing.
Generic Methods with Bounds
Write Java generic methods with bounded type parameters for reusable algorithms.
Java Generic Methods
Write Java generic methods with bounded type parameters for type-safe reusable algorithms.
Java HashMap Operations
Use Java HashMap for key-value storage with put, get, containsKey, and iteration patterns.
Java Interface Default Methods
Use Java interface default and static methods for backward-compatible API evolution and utility methods.
Java Lambda Comparators
Use Java lambda expressions with Comparator.comparing for multi-criteria sorting of objects.
Java Loop Control Flow
Use Java loop constructs with break, continue, and labeled loops for complex iteration control.
Java Math Operations
Use Java Math class methods for common mathematical operations including power, sqrt, and rounding.
Optional Chaining Methods
Use Java Optional for safe null handling with map, flatMap, and orElse methods.
Pattern Matching for Switch
Use Java 21+ pattern matching in switch expressions for type-based branching with guards.
Record Class for DTOs
Use Java 16+ record classes for concise data transfer objects with automatic equals and hashCode.
Java Reflection Field Access
Use Java reflection to inspect class fields, read annotations, and set values dynamically at runtime.
Java Regex Pattern Matching
Use Java Pattern and Matcher classes for regex matching, group extraction, and replacement operations.
Sealed Class Hierarchies
Use Java 17+ sealed classes and permits to create closed class hierarchies.
Java Stream Collect
Use Java Stream API with collect, groupingBy, and Collectors for functional data aggregation.
Stream Filter and Collect
Use Java Stream API to filter, map, and collect elements into various collection types.
Java Parallel Streams
Use Java parallel streams for concurrent data processing with fork-join pool and thread-safe collectors.
Java StringBuilder Operations
Use Java StringBuilder for efficient string concatenation, reversal, and mutation operations.
Text Blocks for Multiline Strings
Use Java 15+ text blocks for readable multiline string literals with formatted methods.
Java Thread Basics
Create and manage Java threads using Runnable, Thread, and join for basic concurrent execution.
Try-With-Resources
Use try-with-resources to automatically close AutoCloseable resources with proper exception handling.
Local Variable Type Inference
Use Java var keyword for local variable type inference while maintaining type safety.
Group Anagrams
Group an array of strings into sub-arrays where each group contains strings that are anagrams of each other.
Flatten Nested Array
Flatten a nested array of arbitrary depth into a single-level array using recursion to handle all nesting levels.
Array Sum Calculator
Write a function that calculates the sum of all numbers in an array using the reduce method for clean functional code.
Async Pool Executor
Implement a concurrency-limited async pool that runs promise-returning functions with a maximum number of concurrent executions.
Binary Search Algorithm
Implement binary search on a sorted array to find the index of a target value in O(log n) time complexity.
Binary to Decimal Converter
Convert a binary string representation to its decimal number equivalent using bit manipulation and iteration.
Bubble Sort Implementation
Implement the bubble sort algorithm to sort an array of numbers in ascending order with an early exit optimization.
Capitalize Words
Transform a string so that the first letter of each word is capitalized while the remaining letters are lowercase.
Character Frequency Map
Build a frequency map counting how many times each character appears in a given string using a plain object.
Vowel Counter
Count the number of vowels (a, e, i, o, u) in a given string, case-insensitively, using a regular expression.
Curry Function
Implement a curry function that transforms a multi-argument function into a sequence of single-argument functions.
Date Difference Calculator
Calculate the difference between two dates in various units (days, hours, minutes) with proper timezone handling.
Debounce Function
Implement a debounce function that delays invoking the provided function until after the specified wait time has elapsed.
Deep Clone Object
Create a deep clone of a nested object or array, recursively copying all levels to avoid shared references.
Event Emitter Class
Implement a custom Event Emitter class with on, off, emit, and once methods for publish-subscribe event handling.
Filter Even Numbers
Filter an array of numbers to return only the even values using the Array filter method and modulo operator.
Find Maximum Value
Find the maximum value in an array of numbers using the spread operator with Math.max for a concise solution.
FizzBuzz Classic
Implement the classic FizzBuzz problem: print Fizz for multiples of 3, Buzz for multiples of 5, and FizzBuzz for both.
Graph Breadth-First Search
Implement breadth-first search on a graph represented as an adjacency list, returning the order of visited nodes.
Graph Depth-First Search
Implement depth-first search on a graph using recursion, tracking visited nodes and returning the traversal order.
JSON Schema Validation
Validate a JavaScript object against a simple schema, checking required fields and their types for data integrity.
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.
Reverse Linked List
Reverse a singly linked list in place by iteratively reassigning next pointers to point to the previous node.
LRU Cache Implementation
Implement an LRU (Least Recently Used) cache with O(1) get and put operations using a Map for ordered storage.
Matrix Transpose
Transpose a 2D matrix by swapping rows and columns, converting element at position [i][j] to position [j][i].
Memoization Wrapper
Create a memoization wrapper that caches function results based on arguments to avoid redundant computations.
Merge Overlapping Intervals
Given an array of intervals, merge all overlapping intervals and return a sorted array of non-overlapping intervals.
Factorial Calculator
Compute the factorial of a non-negative integer using recursion, handling edge cases for zero and one.
Object Merge Utility
Merge two JavaScript objects into one, with properties from the second object overriding the first when keys overlap.
Palindrome Checker
Check whether a given string is a palindrome, ignoring case and non-alphanumeric characters for accurate detection.
Promise Chain Sequencer
Execute an array of functions returning promises sequentially, passing each result to the next function in the chain.
Queue Using Two Stacks
Implement a Queue data structure with enqueue and dequeue operations using only two internal stacks.
Quicksort Implementation
Implement the quicksort algorithm with in-place partitioning and median-of-three pivot selection for improved performance.
Email Regex Validator
Validate email addresses using a regular expression pattern that checks for proper format and structure.
Remove Array Duplicates
Remove duplicate values from an array while preserving the order of first occurrences using a Set for efficiency.
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.
Stack Implementation
Implement a Stack data structure with push, pop, peek, and isEmpty methods using a JavaScript array internally.
String Reversal
Reverse a given string using built-in JavaScript array and string methods for a clean and readable solution.
Sum of Digits
Calculate the sum of all individual digits in a non-negative integer using both iterative and string approaches.
Trie Data Structure
Implement a Trie (prefix tree) with insert, search, and startsWith methods for efficient string prefix operations.
Python Abstract Base Class
Use Python ABC module to define abstract base classes with abstract methods that enforce implementation in subclasses.
Async Gather Concurrent Tasks
Use asyncio.gather to run multiple async tasks concurrently and collect results in order.
Python Binary Search with Bisect
Use Python bisect module for efficient binary search and insertion in sorted lists.
Python Class Inheritance
Implement a class hierarchy with inheritance, method overriding, and super() calls in Python.
Python Collections Counter
Use Python collections.Counter for efficient frequency counting, most common elements, and arithmetic operations.
Custom Context Manager
Implement a custom context manager using __enter__ and __exit__ for resource management.
Python Coroutine Pipeline
Build a data processing pipeline using Python coroutines with send() for streaming data transformation.
Dataclass with Validation
Use Python dataclasses with __post_init__ for automatic field validation and default factories.
Python Datetime Arithmetic
Use Python datetime module to perform date arithmetic, calculate differences, and handle timezone-aware operations.
Decorator with LRU Cache
Combine custom decorators with functools.lru_cache for memoized function calls.
Python Decorator Pattern
Implement a Python decorator that measures and logs function execution time using functools.wraps for metadata preservation.
Python Descriptor Protocol
Implement a Python descriptor using __get__ and __set__ to create a validated attribute that enforces type constraints.
Dictionary Merge and Update
Merge dictionaries using Python 3.9+ merge operator and update method with conflict resolution.
Python Dictionary Operations
Perform common dictionary operations including merging, filtering, and transforming values in Python.
Python LCS Dynamic Programming
Implement the longest common subsequence algorithm using dynamic programming with a 2D table.
Python Exception Handling
Use Python try-except-else-finally blocks to handle different exception types and ensure cleanup code runs.
Python File Reading
Read a text file line by line in Python, processing each line and handling file not found errors gracefully.
Python Default Arguments
Use Python default parameter values and keyword arguments to create flexible and configurable functions.
Python Generator Functions
Use Python generator functions with yield to create memory-efficient lazy sequences for large data processing.
Generator Functions with Yield
Create generator functions using yield for memory-efficient lazy evaluation of large sequences.
Python Dijkstra Shortest Path
Implement Dijkstra algorithm for finding shortest paths in a weighted graph using a priority queue.
Python Itertools Chains
Use Python itertools module to chain, slice, and group iterables for efficient lazy data processing.
List Comprehension Patterns
Use Python list comprehensions with conditions and nested loops for concise data transformation.
Python Loop Patterns
Use Python enumerate, zip, and range patterns for common iteration tasks with proper unpacking.
Memoized Fibonacci
Implement memoized Fibonacci using functools.lru_cache for O(n) time complexity instead of exponential.
Python Metaclass Basics
Implement a custom metaclass that automatically adds validation methods to classes based on their field definitions.
Python NamedTuple Usage
Use Python namedtuple for creating lightweight immutable record types with named field access.
Python Recursive Descent Parser
Implement a recursive descent parser for simple arithmetic expressions with operator precedence and parentheses.
Regex Named Groups
Use Python regex named groups for extracting structured data from text patterns.
Python Regex Substitution
Use Python re module for pattern matching and substitution with capture groups and replacement functions.
Python Set Operations
Use Python set operations (union, intersection, difference) to compare and manipulate collections of unique elements.
Python Sorted with Key Function
Use Python sorted() with custom key functions for multi-criteria sorting and complex comparison logic.
SQL Parameterized Queries
Use parameterized queries with sqlite3 to prevent SQL injection and safely pass user input.
Python String Formatting
Use Python f-strings and format methods to create formatted output with variables, alignment, and number precision.
Python String Methods
Use Python string methods (split, join, strip, replace, find) for common text processing tasks.
Python Tuple Unpacking
Use Python tuple unpacking and the star expression to extract values from tuples of varying structures.
TypedDict for Structured Dicts
Use TypedDict to create type-checked dictionary structures with mypy static analysis.
Rust Async/Await
Use Rust async/await with tokio runtime for concurrent asynchronous operations and task spawning.
Closures and Capture
Use Rust closures with move semantics and Fn, FnMut, FnOnce traits for captured variables.
Rust Closures and Capture
Use Rust closures with different capture modes (by reference, by mutable reference, by value) and the move keyword.
HashMap Operations
Use Rust HashMap for key-value storage with insertion, lookup, and iteration patterns.
Thread Spawning with Channels
Use std::thread and mpsc channels for safe message passing between Rust threads.
Result Type Error Handling
Use Rust Result type for explicit error handling without exceptions using match and ? operator.
Rust Generic Traits
Define and implement generic traits in Rust with associated types and generic methods.
Rust Iterator Adapters
Chain Rust iterator adapters like map, filter, enumerate, and collect for functional data transformation.
Iterator Map and Filter
Use Rust iterator adaptors map, filter, and collect for functional data transformation.
Rust Lifetime Annotations
Use Rust lifetime annotations to express relationships between references in function signatures.
Explicit Lifetime Annotations
Use explicit lifetime annotations to tell the borrow checker about reference relationships.
Rust Declarative Macros
Write Rust declarative macros with macro_rules! for code generation and pattern-based syntax extension.
Ownership and Move Semantics
Demonstrate Rust ownership rules with move semantics and borrowing to prevent data races.
Rust Ownership Transfer
Learn Rust ownership rules by transferring ownership between functions and using references to borrow values.
Pattern Matching with Enums
Use Rust pattern matching on enums with exhaustive match arms and guard clauses.
Rust Pattern Matching
Use Rust match expressions with destructuring, guards, and binding for comprehensive pattern matching.
Smart Pointers Box and Rc
Use Box for heap allocation and Rc for reference counting in Rust programs.
Rust String Slices
Use Rust string slices (&str) for efficient substring access without copying string data.
Rust Struct Basics
Define Rust structs with fields, implement methods, and use derive macros for common traits.
Rust Trait Bounds
Use Rust trait bounds on generic functions to constrain type parameters to types implementing specific traits.
Traits with Generic Bounds
Define and implement traits with generic type bounds for polymorphic behavior in Rust.
Rust Unsafe and FFI
Use Rust unsafe blocks for raw pointer dereferencing and FFI to call C functions safely.
Rust Vector Iteration
Iterate over Rust vectors using various patterns: by value, by reference, and with iterator adaptors.
SQL CASE Expressions
Use SQL CASE expressions for conditional logic and value transformation within queries.
Recursive CTE for Hierarchy
Use recursive common table expressions to traverse hierarchical data like org charts.
SQL Common Table Expressions
Use SQL CTEs (WITH clause) for readable query decomposition and reusable intermediate result sets.
Date Truncation for Grouping
Use date_trunc and extract functions to group time series data by various time periods.
EXISTS vs IN Subqueries
Compare EXISTS and IN subquery performance and use appropriate pattern for each case.
SQL GROUP BY with Aggregates
Use SQL GROUP BY with aggregate functions like COUNT, SUM, AVG, MIN, and MAX for data summarization.
SQL HAVING Clause
Use SQL HAVING clause to filter groups after aggregation, complementing WHERE for pre-aggregation filtering.
SQL INSERT and UPDATE
Use SQL INSERT to add rows and UPDATE to modify existing rows with WHERE conditions.
Join with Aggregation
Combine table joins with GROUP BY aggregation for reporting queries with multiple tables.
SQL INNER JOIN
Use SQL INNER JOIN to combine rows from two tables based on a related column between them.
JSON Data Querying
Query and extract data from JSON columns using PostgreSQL JSON operators and functions.
NULL Handling with COALESCE
Use COALESCE, NULLIF, and IS NULL for robust NULL value handling in SQL queries.
SQL ORDER BY and LIMIT
Use SQL ORDER BY for sorting and LIMIT/OFFSET for pagination to control result set size and order.
Pivot Data with CASE
Transform rows to columns using CASE expressions for pivot-style data reshaping in SQL.
SQL Recursive CTE
Use SQL recursive CTEs to traverse hierarchical data like org charts, trees, and graph structures.
SQL SELECT with WHERE
Write SQL SELECT queries with WHERE clauses to filter rows by various conditions and comparison operators.
SQL Subqueries
Use SQL subqueries in WHERE, FROM, and SELECT clauses for nested data retrieval and filtering.
SQL UNION and UNION ALL
Use SQL UNION and UNION ALL to combine result sets from multiple queries into a single result.
UPSERT with ON CONFLICT
Use INSERT ON CONFLICT for atomic upsert operations in PostgreSQL with comprehensive examples and best practices for production use.
SQL Window Functions
Use SQL window functions like ROW_NUMBER, RANK, and LAG for analytics without collapsing rows.
Window Function Ranking
Use SQL window functions with RANK, DENSE_RANK, and ROW_NUMBER for analytical queries.
Running Total with Window
Calculate running totals and moving averages using SQL window functions with frame clauses.
Typed Array Map Operation
Use the Array.map method with proper TypeScript generics to transform an array of numbers into an array of strings.
Async/Await Error Handling
Write an async function with proper TypeScript error handling using try-catch and typed error responses.
Async Iterable Class
Implement an async iterable class using Symbol.asyncIterator for streaming data processing.
TypeScript Basic Type Annotations
Practice declaring variables with explicit TypeScript type annotations for numbers, strings, and booleans.
Branded Types for Nominal Typing
Implement branded types to achieve nominal typing in TypeScript structural type system for safer domain types.
Type-Safe Builder Pattern
Implement a type-safe builder pattern using method chaining with TypeScript return types.
Conditional Types
Use conditional types to create type-level logic that selects types based on conditions.
Generic Curried Function Types
Create a fully typed curry function with TypeScript generics that preserves parameter types through partial application.
Method Decorator Logging
Implement a method decorator that logs function calls with arguments and return values for debugging purposes.
Method Decorators
Implement method decorators for logging, timing, and access control in TypeScript classes.
Discriminated Union Patterns
Use discriminated unions to model different action types with exhaustive switch handling in a reducer pattern.
Distributive Conditional Types
Explore distributive conditional types that distribute over union types for type-level computations.
Enum Iteration and Reverse Mapping
Iterate over TypeScript enum values and handle reverse mapping for numeric enums.
Enum Type Usage
Define and use a TypeScript enum to represent order status values with a function to check if an order is complete.
Function Overload Signatures
Use TypeScript function overload signatures to provide different return types based on input parameter types.
Generic Stack Class
Implement a type-safe generic stack class in TypeScript with push, pop, and peek methods.
Generic Type Inference
Write a generic identity function and a generic pair factory, demonstrating TypeScript automatic type inference.
Type Inference in Conditional Types
Use the infer keyword in conditional types to extract and manipulate types from complex generic structures.
Interface Definition Basics
Define a TypeScript interface for a User object with required and optional properties, then create a function to display user info.
Iterator Protocol Implementation
Implement a custom iterator using the Symbol.iterator protocol for a range class that yields numbers.
Mapped Types
Create mapped types that transform existing type properties into new type structures.
Phantom Types for Safety
Use phantom types to create type-level tags that distinguish values at compile time without runtime overhead.
Typed Promise.all
Use Promise.all with proper TypeScript typing to run multiple async operations in parallel and collect typed results.
Readonly Array Types
Use TypeScript readonly array types to prevent mutation of array parameters in functions.
Record Type for Maps
Use the Record utility type to create type-safe map objects with specific key and value types.
Recursive Type Definitions
Define a recursive TypeScript type for a tree structure and write a function to traverse it depth-first.
Result Type for Error Handling
Implement a Result type for explicit error handling without exceptions in TypeScript.
Template Literal Types
Use TypeScript template literal types to create type-safe string patterns for HTTP method and path combinations.
Template Literal Type Inference
Use infer in template literal types to extract parts of type-safe string patterns at the type level.
Advanced Template Literal Types
Use template literal types to create type-safe event names and CSS property selectors with string interpolation.
Tuple Type Operations
Use TypeScript tuple types to represent fixed-length arrays with specific element types at each position.
Type Assertion Safety
Use TypeScript type assertions to narrow an unknown value to a specific type with runtime validation.
Custom Type Guard Functions
Write custom type guard functions using the is operator to narrow unknown data to specific types at runtime.
Custom Type Guards
Write custom type guard functions to narrow union types at runtime in TypeScript.
Union Type Handling
Use TypeScript union types to handle values that can be one of several types, with proper type narrowing.
Custom Utility Types
Create custom utility types for deep partial, deep readonly, and path-based property access.
Variance in Generic Types
Explore TypeScript variance rules with covariant arrays and contravariant function parameters.