Programming Exercises
Practice with real problems and instant feedback.
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 (JavaScript)
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.