Exercises
Browse All Exercises
Search and filter across the entire exercise library.
Filters
97 exercises
hard
Python
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
medium
Python
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...
json
validation
retry-logic
+6
medium
Python
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-logic
exponential-backoff
api-resilience
+7
medium
Python
Text Chunking Pipeline with Overlap and Metadata
Build a text chunking pipeline that intelligently splits documents into overlapping chunks while preserving sentence bou...
text-processing
nlp
chunking
+7
medium
Python
Prompt Template Engine
Build a `PromptTemplate` class that renders template strings with variable substitution. Your class should: - Take a te...
templates
string-processing
validation
+7
easy
Python
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...
api
error-handling
http
+7
medium
TypeScript
TypeScript Utility Types from Scratch
# Build Custom Utility Types Implement five essential TypeScript utility types from scratch without using the built-in...
typescript
utility-types
mapped-types
+3
medium
TypeScript
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...
typescript
builder-pattern
type-safety
+4
medium
TypeScript
Generic Result Type Implementation
Implement a generic `Result<T, E>` type similar to Rust's Result enum. This type represents either a successful value (`...
typescript
generics
functional-programming
+4
medium
TypeScript
Type-Safe Event Emitter
Build a generic `EventEmitter<Events>` class that provides full type safety for event handling. The `Events` type param...
typescript
generics
events
+4
easy
TypeScript
Generic Stack Implementation
Implement a generic `Stack<T>` class that provides last-in-first-out (LIFO) data structure functionality with full type...
typescript
generics
data-structures
+4
hard
Python
FastAPI WebSocket Chat Server
# FastAPI WebSocket Chat Server Build a real-time chat server using FastAPI WebSockets that supports multiple chat room...
fastapi
websockets
real-time
+4
Page 1 of 9
Next