Search

Lessons (40)

  • TypeScript Essentials

    TypeScript is JavaScript with types that catch bugs before your code runs. Learn the core types, interfaces, unions …

  • SQL Language, Identifiers & Data Types

    Interview answers for DDL/DML/DCL, generated IDs, UNION, static/dynamic SQL and CHAR/VARCHAR. Covers PDF questions …

  • Event-Driven Architecture

    … string } (type: E["type"], handler: Handler<E ) { this.handlers.set(type, [...(this.handlers.get(type) ?? []), handler]); } async publish …

  • Frontend Testing Strategy

    … most value comes from integration tests](/img/frontend/testing-trophy.svg) Layer Tests Tools Speed Confidence --- --- --- --- --- Static Types …

  • DRY: Don't Repeat Yourself

    … z.number().int().min(18), }); export type User = z.infer<typeof userSchema ; ⚠️ The trap: wrong abstraction Two pieces …

  • Behavioral Patterns II: Chain, Template, Iterator, Mediator, Memento, Visitor

    … this. cursor } = memento); } get content() { return this. content; } } const editor = new Editor(); const history = []; editor.type("Hello"); history …

  • REST vs GraphQL vs gRPC

    … Int = 10): [Post!]! } type Query { user(id: ID!): User } type Mutation { createPost(title: String!, body: String!): Post! } js …

  • Creational Patterns: How to Make Objects

    … one place that knows how to create notifiers function createNotifier(type) { const Notifier = notifiers[type]; if (!Notifier) throw …

  • L — Liskov Substitution Principle

    If code works with a parent type, it must also work with any child type, with no surprises …

  • CQRS & Event Sourcing

    … 42 }, { type: "MoneyDeposited", amount: 100 }, { type: "MoneyWithdrawn", amount: 30 }, { type: "MoneyDeposited", amount: 50 }, ]; // Current state = a left fold …

  • Topics, Partitions & Offsets

    … JSON.stringify({ type: "OrderPlaced" }) }, { key: "order-42", value: JSON.stringify({ type: "OrderPaid" }) }, // same partition, after Placed { key: "order …

  • React Hooks in Practice

    … throw new Error( Unknown action ${action.type} ); } } const [cart, dispatch] = useReducer(cartReducer, { items: [] }); dispatch({ type: "add", item }); useEffect …

  • KISS: Keep It Simple, Stupid

    … for ONE email type class NotificationStrategyFactory { create(type) { return new (this.registry.get(type))(); } } class AbstractNotificationStrategy { send() { throw …

  • React vs Vue vs Angular

    … like Vue. Side-by-side React Vue Angular --- --- --- --- Type UI library Progressive framework Full framework Maintained by Meta …

  • Frontend Performance & Core Web Vitals

    … 2. "Can I use it?" Clicks and typing respond instantly. 3. "Is it stable?" Things don't jump …

  • Small Functions That Do One Thing

    … If you can't name it, it probably does too many things. - Returning different types depending on a …

  • React Fundamentals

    … element type ( <div → <section ) → throw away the old subtree and build a new one. - Same type → keep the …

  • API Contracts, Gateways and Security

    … JSON is common; Protobuf is compact and typed for gRPC. Version deliberately and evolve fields additively where possible …

  • Proxies, APIs and Real-Time Protocols

    … REST over HTTPS Familiar and cache-friendly Internal typed call gRPC/RPC Tighter coupling Slow work Queue Eventual …

  • Backend Languages: Node.js, Go, Python & Rust

    … NestJS (structured, TypeScript-first) NestJS adds modules, dependency injection and decorators on top of Express/Fastify, similar to …

  • SOLID at a Glance

    … it has duck typing : "if it has a send() method, it's a sender" . TypeScript adds real interfaces …

  • Database Internals, Replication and Scaling

    … Choose database types by access pattern: relational, document, key-value, wide-column, graph, time-series, search and vector …

  • Graphs: BFS & DFS

    … JavaScript → TypeScript → React → Next.js. js function topoSort(graph) { // graph: node → nodes that depend on it const visited …

  • ConfigMaps, Secrets & Storage

    … shop-api-secrets type: Opaque stringData: plain text here; stored base64-encoded DATABASE URL: "postgres://shop:s3cr3t@postgres …

  • Kafka Producers

    … event ID, type, schema version - [ ] A schema (Avro/Protobuf/JSON Schema) with compatibility rules - [ ] Flush and close the …

  • REST API Design

    … true, schema: { type: string } } responses: "200": { description: The user, content: { application/json: { schema: { $ref: " /components/schemas/User" } } } } "404 …

  • Services & Ingress

    … no IPs anywhere const res = await fetch("http://shop-api/products"); Service types mermaid flowchart TB subgraph CIP …

  • Views, Triggers & Stored Procedures

    … but has refresh work and can be stale. Type Read behavior Cost --- --- --- View Runs the base query Query …

  • Scaling & Health Probes

    … 30 metrics: - type: Resource resource: name: cpu target: { type: Utilization, averageUtilization: 60 } % of the CPU request behavior: scaleDown …

  • Domain-Driven Design: Tactical Patterns

    … past tense in the ubiquitous language. ts type OrderPlaced = { type: "OrderPlaced"; orderId: string; total: Money; occurredAt: Date; }; They …

  • Clean Architecture in Depth

    … string; } // src/application/PlaceOrder.ts export type PlaceOrderRequest = { customerId: string; lines: OrderLine[] }; // input DTO export type PlaceOrderResponse = { orderId …

  • O — Open/Closed Principle

    … new behaviour is plugged in, the core stays untouched](/img/solid/ocp-plugins.svg) With classes and TypeScript …

  • Meaningful Names

    … Your editor already knows the type. - Noise words like data , info , object , manager . UserData and UserInfo mean nothing …

  • Structural Patterns: How to Connect Objects

    … Math.random() 1000, type: getTreeType("oak", "oak.png"), // all share ONE object })); You've used it: string interning …

  • DBMS Foundations, Keys & Normalization

    … Explain key types Key Interview answer --- --- Superkey Any attributes that uniquely identify a row. Candidate key A minimal …

  • Clean Error Handling

    … Use specific error types Generic Error("something failed") forces callers to parse strings. Custom error classes let them …

  • Code Smells & Refactoring

    … Primitive with Object 7 Switch statements Same switch(type) in many places Replace Conditional with Polymorphism 8 Shotgun …

  • Domain-Driven Design: Strategic Design

    … It splits into subdomains , and not all of them are equally important. Type What it is Strategy Example …

  • Deployments, ReplicaSets & Rollouts

    … api } which pods belong to this Deployment strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 at most 1 extra pod …

  • Service Communication: Sync vs Async

    … 1 }] } } 💡 Give every event an ID (for idempotency), a type , a version (for schema evolution) and a timestamp …