Exercises

Browse All Exercises

Search and filter across the entire exercise library.

97 exercises

hardPython
RAG Text Retrieval with Cosine Similarity
Build a Retrieval-Augmented Generation (RAG) system that finds the most relevant text chunks for a given query. ## Requ...
rag
information-retrieval
cosine-similarity
+7
mediumPython
LLM Structured Output with Schema Validation
Build a function that enforces structured JSON output from a language model by validating responses against a schema and...
jsonvalidationretry-logic+6
mediumPython
API Retry Wrapper with Exponential Backoff
Build a retry wrapper that handles failed API calls with intelligent retry logic. Your `RetryWrapper` class should: - A...
retry-logicexponential-backoffapi-resilience+7
mediumPython
Text Chunking Pipeline with Overlap and Metadata
Build a text chunking pipeline that intelligently splits documents into overlapping chunks while preserving sentence bou...
text-processingnlpchunking+7
mediumPython
Prompt Template Engine
Build a `PromptTemplate` class that renders template strings with variable substitution. Your class should: - Take a te...
templatesstring-processingvalidation+7
easyPython
Mock LLM API Client with Error Handling
Build a function that calls a mock LLM API with proper error handling for common API issues. Create a function `call_ll...
apierror-handlinghttp+7
mediumTypeScript
TypeScript Utility Types from Scratch
# Build Custom Utility Types Implement five essential TypeScript utility types from scratch without using the built-in...
typescriptutility-typesmapped-types+3
mediumTypeScript
Type-Safe Query Builder with Method Chaining
Build a type-safe QueryBuilder class that enforces method call order and prevents duplicate calls using TypeScript's typ...
typescriptbuilder-patterntype-safety+4
mediumTypeScript
Generic Result Type Implementation
Implement a generic `Result<T, E>` type similar to Rust's Result enum. This type represents either a successful value (`...
typescriptgenericsfunctional-programming+4
mediumTypeScript
Type-Safe Event Emitter
Build a generic `EventEmitter<Events>` class that provides full type safety for event handling. The `Events` type param...
typescriptgenericsevents+4
easyTypeScript
Generic Stack Implementation
Implement a generic `Stack<T>` class that provides last-in-first-out (LIFO) data structure functionality with full type...
typescriptgenericsdata-structures+4
hardPython
FastAPI WebSocket Chat Server
# FastAPI WebSocket Chat Server Build a real-time chat server using FastAPI WebSockets that supports multiple chat room...
fastapiwebsocketsreal-time+4
Page 1 of 9Next