Search
Lessons (40)
- Interfaces vs Abstract Classes
… Record<string, unknown []): string; } class CsvExporter extends DataExporter { protected readonly extension = "csv"; protected serialize(rows: Record<string, unknown …
- Arrays & Strings
… a brand-new string ⚠️ Building a string with += inside a big loop may copy the string again and …
- Rust: Ownership, Borrowing and Lifetimes
… every value has one owner rust let a = String::from("hello"); // a owns the heap string let b …
- TypeScript in Practice
… Use a brand : ts type UserId = string & { readonly brand: "UserId" }; type OrderId = string & { readonly brand: "OrderId" }; declare function …
- Abstraction
… Promise<string ; // returns a payment ID refund(paymentId: string): Promise<void ; } Any class that promises to follow the …
- TypeScript Essentials
… string number Date) { if (typeof value === "string") return value.toUpperCase(); // value: string here if (typeof value === "number") return …
- Go Fundamentals
… fmt.Println("int", x+1) case string: fmt.Println("string", strings.ToUpper(x)) default: fmt.Println("something else …
- Composition over Inheritance
… interface Movement { move(name: string): string; } class Fly implements Movement { move(name: string) { return ${name} flies through the …
- Hexagonal Architecture (Ports & Adapters)
… ts export class Loan { constructor(readonly bookId: string, readonly memberId: string, readonly dueDate: Date) {} isOverdue(today: Date) { return …
- Advanced TypeScript for Frontend
… z.string(), status: z.enum(["draft", "paid", "cancelled"]), totalCents: z.number().int().nonnegative(), }); type Order = z.infer<typeof …
- Inheritance
… Animal { // Dog inherits from Animal constructor(name: string, public breed: string) { super(name); // call the parent constructor FIRST …
- I — Interface Segregation Principle
… it uses function Avatar({ src, name }: { src: string; name: string }) { return <img src={src} alt={name} / ; } <Avatar src …
- Clean Architecture in Depth
… view model (formatted strings, dates, currency) In many web apps, returning a response DTO from the use case …
- Prompting and Structured Outputs
… if (!value typeof value !== "object") throw new Error("Invalid response"); const ticket = value as Record<string, unknown ; if …
- REST vs GraphQL vs gRPC
… string order id = 1; } message Order { string id = 1; string customer id = 2; double total = 3; repeated string …
- Microkernel (Plugin) Architecture
… MarkdownPlugin { name: string; version: string; / Transform raw markdown before parsing (optional hook) / beforeParse?(markdown: string): string; / Transform the …
- Encapsulation
… and subclasses public name: string; // everyone constructor(id: string, name: string, passwordHash: string) { this.id = id; this.name …
- Go Web Services with Gin
… Auth(verify func(string) (string, error)) gin.HandlerFunc { return func(c gin.Context) { token := strings.TrimPrefix(c.GetHeader …
- Polymorphism
… T) {} get() { return this.value; } } new Box(42).get(); // number new Box("hello").get(); // string One class, many …
- Classes and Objects
… string; age: number; // 2. Constructor: runs once when you create a dog with new constructor(name: string, age …
- Go Concurrency: Goroutines, Channels and Context
… nobody ever receives from ch func fetchWithTimeout(url string) (string, error) { ch := make(chan string) go func() { ch …
- Practical Lab: S3 File Upload and CloudFront Delivery with NestJS
… string string[]) { const fullKey = Array.isArray(key) ? key.join('/') : key; if (!fullKey.startsWith('uploads/')) { throw new BadRequestException('Invalid …
- Rust: Types, Errors and Concurrency
… String }, Cancelled(String), // reason } impl Order { fn new(id: u64) - Self { // associated function (constructor by convention) Self { id …
- Domain-Driven Design: Tactical Patterns
… No more re-validating strings all over the code. Aggregates: the consistency boundary ⭐ An aggregate is a group …
- Object Relationships: Association, Aggregation and Composition
… Player { constructor(public name: string) {} } class Team { private players: Player[] = []; constructor(public name: string) {} sign(player: Player) { this …
- Extending Kubernetes: CRDs, Operators and Admission
… string } target: { type: string } retention: type: integer minimum: 1 default: 7 status: type: object properties: lastRun: { type: string …
- Topics, Partitions & Offsets
… JSON.stringify({ type: "OrderPlaced" }) }, { key: "order-42", value: JSON.stringify({ type: "OrderPaid" }) }, // same partition, after Placed { key: "order …
- MVC, MVP & MVVM
… string): void; goToDashboard(): void; } class LoginPresenter { constructor(private view: LoginView, private auth: AuthService) {} async onLoginClicked(email: string, password …
- Domain-Driven Design: Strategic Design
… us this… type ErpCustomerRecord = { CUST NO: string; NM1: string; NM2: string; STAT CD: "A" "I" "B" }; // …our Billing …
- NestJS Core Concepts
… boolean { const required = this.reflector.get<string[] ("roles", ctx.getHandler()); if (!required) return true; const { user } = ctx.switchToHttp …
- Dynamic Programming
… a 2D table, longest common subsequence Longest sequence of characters appearing in the same order in both strings …
- Variables, Locals, Outputs, and Validation
… Retain its terraform block, replace the original resource and output, and add: hcl variable "project" { type = string description …
- JavaScript Language Fundamentals
… A primitive (a number, a string) is like writing a number on a sticky note: copy the note …
- Production Capstone and Interview Practice
… private-storage/variables.tf variable "name prefix" { type = string validation { condition = can(regex("^[a-z][a-z0-9 …
- Reusable Modules and Clear Interfaces
… port }) } In variables.tf : hcl variable "name" { type = string } variable "port" { type = number validation { condition = var.port = 1 …
- Backend Languages: Node.js, Go, Python & Rust
… go results := make(chan string) for , url := range urls { go func(u string) { results <- fetch(u) }(url) // all …
- Kafka for Backend Services
… z.string(), customerId: z.string(), totalCents: z.number().int().nonnegative(), currency: z.string().length(3), }).passthrough(), // tolerant reader …
- Caching & Redis
… await redis.set("product:42", JSON.stringify(product)); // Safer: choose a freshness window that matches the data. await …
- Serverless Architecture
… JSON.stringify({ id: order.id }) }; }; ts // Triggered by an S3 upload: create a thumbnail export const handler = async …
- Event-Driven Architecture
… E) = Promise<void ; class EventBus { private handlers = new Map<string, Handler<any [] (); on<E extends { type: string } (type …