Search
Lessons (31)
- Clean Architecture in Depth
… Use presenters when several UIs need the same use case formatted differently. "Screaming architecture" 📘 "Your architecture should scream …
- Onion Architecture & Clean vs Hexagonal vs Onion
… domain model → domain services → application services The Dependency Rule + named layers, use cases as first-class objects, crossing …
- Recursion & Backtracking
… Learn to think recursively, visualise the call stack, and use backtracking to explore all possibilities. The big idea …
- Clean Architecture
… new SendGridEmailSender(apiKey), }); app.post("/users", userController(registerUser)); Why bother? Testing becomes trivial Because the use case only …
- TypeScript Essentials
… RequestState<User[] ) { switch (state.status) { case "loading": return "Loading…"; case "error": return Error: ${state.error} ; // error exists only …
- YAGNI: You Aren't Gonna Need It
… suitcase and using 10% of it. mermaid flowchart LR subgraph Pack["🧳 Packing 'just in case'"] A[Snow …
- DSA Interview Patterns Cheat Sheet
… 2. Examples: work one normal example and one edge case by hand. 3. Brute force: say it out …
- Hexagonal Architecture (Ports & Adapters)
… domain model + use cases. No I/O, no frameworks Order , PlaceOrder Port An interface defined by the core …
- Linked Lists
… last points to first"] c1[A] -- c2[B] -- c3[C] -- c1 end Real uses: browser back/forward history …
- Domain-Driven Design: Tactical Patterns
… base; } } // Application service (a use case): load, act, save, publish; thin, no if-statements about business export class …
- CQRS & Event Sourcing
… 0 }; case "MoneyDeposited": return { ...state, balance: state.balance + event.amount }; case "MoneyWithdrawn": return { ...state, balance: state.balance - event …
- React Hooks in Practice
… case "clear": return { ...state, items: [] }; default: throw new Error( Unknown action ${action.type} ); } } const [cart, dispatch] = useReducer(cartReducer …
- Vertical Slice Architecture & the Modular Monolith
… one folder per use case, top to bottom; each slice picks its own level of complexity. - Slices pair …
- Code Smells & Refactoring
… return Math.PI shape.r 2; case "square": return shape.side 2; } } // ✅ Each shape knows how to compute …
- Trees & Binary Search Trees
… Databases use B-trees , wide trees with many keys per node, so a lookup touches only 3–4 …
- Big-O Notation Made Simple
… exceeded". Best, average and worst case Big-O usually describes the worst case , because that's the one …
- Sorting Algorithms
… O(n²) worst case . What does JavaScript's sort() use? V8 (Chrome, Node.js) uses TimSort : a hybrid …
- Dynamic Programming
… br/ How does dp[i] use smaller states?"] B -- C["3️⃣ Base cases<br/ The smallest answers you …
- O — Open/Closed Principle
… StudentDiscount : 🆕 added later OCP is everywhere you look Tool Extension point --- --- Express / Koa Middleware: app.use(myMiddleware) VS …
- Which Pattern Do I Need?
… for flexibility" Wait for the second use case Golden hammer "We use Observer for everything" Pick per problem …
- KISS: Keep It Simple, Stupid
… just in case"? ❌ remove it Is there a built-in / standard library function for this? ✅ use it Would …
- L — Liskov Substitution Principle
… swim() Red flag 2: instanceof checks js // ❌ The caller has to know about the special case function makeBirdsFly …
- Hash Maps & Sets
… The usual fix is chaining : each bucket holds a small list. mermaid flowchart LR B0["bucket 0"] -- x0 …
- What Is Apache Kafka?
… offset}: , order); }, }); What is Kafka used for? mermaid mindmap root((Kafka use cases)) Event-driven microservices OrderPlaced → many …
- Graphs: BFS & DFS
… DFS uses a stack , usually the call stack via recursion. js function dfs(graph, node, visited = new Set …
- MVC, MVP & MVVM
… UC["Use cases<br/ (application core)"] -- E[Domain model] Key takeaways - All three separate View (what users see …
- What Is Software Architecture?
… flexible schema, but weaker multi-document transactions for our use case - DynamoDB: great scale, but complex queries and …
- Serverless Architecture
… APIGatewayProxyEvent) = { const result = await placeOrder.execute(JSON.parse(event.body ?? "{}")); // plain use case return { statusCode: 201, body: JSON …
- Normalization & Denormalization
… For normal application schemas, reaching solid 3NF plus explicit constraints is usually the practical goal. Use BCNF when …
- Choosing an Architecture
… Only covers presentation Clean Circles; dependencies point inward; use cases Rich business logic, long-lived apps Ceremony for …
- Caching & Redis
… Its data types solve many real problems: Type Commands Use case --- --- --- String SET , GET , INCR , EXPIRE Cache, counters …