Search

Lessons (27)

  • D — Dependency Inversion Principle

    … dependencies Function parameter placeOrder(order, { mailer }) Functional code DI container NestJS @Injectable() , InversifyJS Large apps with many dependencies …

  • DBMS Foundations, Keys & Normalization

    … Start from functional dependencies, split tables only when the split preserves necessary relationships, and stop when the design …

  • Resilience Patterns

    … Fallbacks and graceful degradation When a non-critical dependency fails, degrade instead of erroring: Failed dependency Fallback --- --- Recommendations …

  • SOLID at a Glance

    … TypeScript adds real interfaces. - Functions are first-class, so you can often pass a function where Java would …

  • I — Interface Segregation Principle

    Don't force code to depend on methods it doesn't use. Split fat interfaces into small, focused …

  • Clean Architecture in Depth

    … ports How can a use case save an order without knowing about Postgres? It depends on an interface …

  • Graphs: BFS & DFS

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

  • React Hooks in Practice

    … never inside if , loops or nested functions. 2. Only call hooks from React functions (components or custom hooks …

  • Hexagonal Architecture (Ports & Adapters)

    … the ways in ts // adapters/driving/http.ts — REST export function loanRoutes(app: Express, borrowing: ForBorrowingBooks) { app.post …

  • Which Pattern Do I Need?

    … one-off task Plain function first Singleton abuse Global state everywhere, flaky tests Dependency injection God object One …

  • Creational Patterns: How to Make Objects

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

  • Choosing an Architecture

    … Future extraction becomes cheap Fitness functions : automated checks for architecture rules (dependency rules, latency budgets) Guard the architecture …

  • Microkernel (Plugin) Architecture

    … the only thing plug-ins may depend on Registry Knows which plug-ins exist, their versions, and how …

  • React vs Vue vs Angular

    … function runs again] -- R3[diff virtual DOM] -- R4[patch real DOM] end subgraph Vue["Vue: tracked dependencies"] V1 …

  • Behavioral Patterns I: Observer, Strategy, Command, State

    … depends on its state, and you're drowning in if (status === ...) checks. js // ❌ Status checks everywhere function cancel …

  • Authentication, Authorization & API Security

    … user.role }, process.env.JWT SECRET, { expiresIn: "15m" }); function authenticate(req, res, next) { const token = req.headers.authorization …

  • Small Functions That Do One Thing

    … many things. - Returning different types depending on a flag. Key takeaways - One function = one job. No "and" in …

  • JavaScript Essentials: Event Loop, Closures & this

    … functions to avoid stale closures in React. - this depends on how a function is called; arrow functions inherit …

  • React Fundamentals

    … When state changes, React re-renders that component (and its children). jsx import { useState } from "react"; function Counter …

  • Serverless Architecture

    … jobs need Step Functions, containers or batching Cold starts 100 ms to several seconds, depending on runtime and …

  • Big-O Notation Made Simple

    … same work no matter how big the array is function first(arr) { return arr[0]; } // O(n): one …

  • DSA Interview Patterns Cheat Sheet

    … intervals (merge overlapping meetings) js function mergeIntervals(intervals) { const sorted = intervals.toSorted((a, b) = a[0] - b[0 …

  • Service Communication: Sync vs Async

    … flows, many independent reactions Tools Temporal, AWS Step Functions, Camunda Kafka, RabbitMQ, SNS/SQS Choosing a style mermaid …

  • Next.js Rendering: CSR, SSR, SSG, ISR & Server Components

    … the default when a page uses no request-specific data export default async function Page() { / … / } // ISR: regenerate at …

  • Dynamic Programming

    … 5. Answer: dp[target] . js function coinChange(coins, amount) { const dp = new Array(amount + 1).fill(Infinity); dp …

  • Kafka Producers

    … 5 }); await producer.connect(); export async function publishOrderPlaced(order) { await producer.send({ topic: "shop.orders.placed", acks: -1 …

  • Vertical Slice Architecture & the Modular Monolith

    … simple, direct SQL export async function getOrderHistory(db: Pool, customerId: string) { const { rows } = await db.query( SELECT id …