Search
Lessons (40)
- D — Dependency Inversion Principle
… dependencies Function parameter placeOrder(order, { mailer }) Functional code DI container NestJS @Injectable() , InversifyJS Large apps with many dependencies …
- React Hooks in Practice
… never inside if , loops or nested functions. 2. Only call hooks from React functions (components or custom hooks …
- I — Interface Segregation Principle
Don't force code to depend on methods it doesn't use. Split fat interfaces into small, focused …
- SOLID at a Glance
… TypeScript adds real interfaces. - Functions are first-class, so you can often pass a function where Java would …
- DBMS Foundations, Keys & Normalization
… Start from functional dependencies, split tables only when the split preserves necessary relationships, and stop when the design …
- Serverless: Lambda and API Gateway
… your API contract. Bound dependencies Choose the function timeout to exceed the intended dependency timeouts plus application work …
- Graphs: BFS & DFS
… JavaScript → TypeScript → React → Next.js. js function topoSort(graph) { // graph: node → nodes that depend on it const visited …
- Code Profiling
… A small function called a million times may be the real problem. What to measure Symptom Start by …
- Neural Networks and Deep Learning
… An activation function adds nonlinearity, allowing stacked layers to represent more than one linear transformation. The final layer …
- Creational Patterns: How to Make Objects
… one place that knows how to create notifiers function createNotifier(type) { const Notifier = notifiers[type]; if (!Notifier) throw …
- Python Web APIs: FastAPI and Django
… raise HTTPException(401, "Invalid token") return user DB = Annotated[Session, Depends(get db)] CurrentUser = Annotated[User, Depends(current …
- OOP Mistakes and Interview Questions
… Type checks instead of polymorphism ts // ❌ Every new shape means editing this function (and others like it) function …
- 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 …
- Small Functions That Do One Thing
… many things. - Returning different types depending on a flag. Key takeaways - One function = one job. No "and" in …
- Which Pattern Do I Need?
… one-off task Plain function first Singleton abuse Global state everywhere, flaky tests Dependency injection God object One …
- JavaScript Essentials: Event Loop, Closures & this
… functions to avoid stale closures in React. - this depends on how a function is called; arrow functions inherit …
- What Is Object-Oriented Programming?
… data and functions are separate const account = { owner: "Ana", balance: 100 }; function withdraw(acc: { balance: number }, amount: number …
- Go Fundamentals
… Maps are also not safe for concurrent writes (see the concurrency lesson). Functions A function can return several …
- Choosing an Architecture
… Future extraction becomes cheap Fitness functions : automated checks for architecture rules (dependency rules, latency budgets) Guard the architecture …
- Serverless Architecture
… jobs need Step Functions, containers or batching Cold starts 100 ms to several seconds, depending on runtime and …
- HCL, Resource Addresses, and Project Layout
… 1 Choose one of two expressions Function lower(var.project) Transform a value Terraform is declarative: moving a …
- Hexagonal Architecture (Ports & Adapters)
… the ways in ts // adapters/driving/http.ts — REST export function loanRoutes(app: Express, borrowing: ForBorrowingBooks) { app.post …
- React vs Vue vs Angular
… function runs again] -- R3[diff virtual DOM] -- R4[patch real DOM] end subgraph Vue["Vue: tracked dependencies"] V1 …
- Python Fundamentals
… virtual environments, types and mutability, lists/tuples/dicts/sets, comprehensions, functions with args and kwargs, classes and dataclasses …
- React Fundamentals
… When state changes, React re-renders that component (and its children). jsx import { useState } from "react"; function Counter …
- C4 Architecture Diagrams: Context, Container, Component and Code
… It can show classes, interfaces, functions, packages or aggregates, depending on the language and team conventions. Because code …
- Big-O Notation Made Simple
… same work no matter how big the array is function first(arr) { return arr[0]; } // O(n): one …
- Polymorphism
… number) {} area() { return 0.5 this.base this.height; } } // This function works with ANY shape, now and in …
- Resilience Patterns
… Fallbacks and graceful degradation When a non-critical dependency fails, degrade instead of erroring: Failed dependency Fallback --- --- Recommendations …
- 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 …
- Clean Architecture in Depth
… ports How can a use case save an order without knowing about Postgres? It depends on an interface …
- Dynamic Programming
… 5. Answer: dp[target] . js function coinChange(coins, amount) { const dp = new Array(amount + 1).fill(Infinity); dp …
- Composition over Inheritance
… the child depends on the parent's internals Loose: depends only on a part's interface Change at …
- Interfaces vs Abstract Classes
… string) { / post to Slack webhook / } } async function alertOnCall(notifier: Notifier) { await notifier.send("oncall", "Server is down!"); } 💡 In …
- Edge, Platform & Frontend Delivery
… It should not become an application server. ts export function middleware(request: NextRequest) { const session = request.cookies.get …
- Prompting and Structured Outputs
… It can improve consistency, but it cannot guarantee correctness or replace application-side validation. A dependable prompt shape …
- Microkernel (Plugin) Architecture
… the only thing plug-ins may depend on Registry Knows which plug-ins exist, their versions, and how …
- Bash Scripting & Scheduled Jobs
Write safe Bash scripts with variables, conditions, loops and functions, make them fail loudly with set -euo pipefail …
- DSA Interview Patterns Cheat Sheet
… intervals (merge overlapping meetings) js function mergeIntervals(intervals) { const sorted = intervals.toSorted((a, b) = a[0] - b[0 …
- Authentication, Authorization & API Security
… user.role }, process.env.JWT SECRET, { expiresIn: "15m" }); function authenticate(req, res, next) { const token = req.headers.authorization …