Search
Lessons (40)
- Frontend Testing Strategy
What to test and how. The testing trophy, unit tests with Vitest, component tests with Testing Library, API β¦
- Hexagonal Architecture (Ports & Adapters)
β¦ Driving vs driven sides, a complete TypeScript example, testing with fake adapters, and how to structure the folders β¦
- Code Smells & Refactoring
β¦ nothing leaves, it just ends up in the right place. mermaid flowchart LR T1["β Tests pass"] -- S["Make β¦
- D β Dependency Inversion Principle
β¦ new SesMailer(awsConfig), }); // Tests: plain fakes, no network const sent = []; const testService = new OrderService({ orderRepository: { save: async () = {} }, mailer β¦
- Deploying & Operating Microservices
β¦ own tests and its own pipeline. mermaid flowchart LR C[π» Commit] -- B["π¨ Build<br/ + unit tests"] -- I["π³ Docker β¦
- Onion Architecture & Clean vs Hexagonal vs Onion
β¦ infrastructure, UI, tests Implementations of the interfaces, web framework, DB, external APIs SqlOrderRepository , controllers, EF Core / Prisma mermaid β¦
- Clean Architecture
β¦ No database, no network, milliseconds per test. js test("rejects duplicate emails", async () = { const userRepository = new InMemoryUserRepository([{ id β¦
- Clean Architecture in Depth
β¦ Entities, use cases, input and output ports, presenters, crossing boundaries with DTOs, "screaming" folder structure, testing, and common β¦
- MVC, MVP & MVVM
β¦ Keeping these three apart means you can redesign the screen without rewriting the news, and test the producer β¦
- YAGNI: You Aren't Gonna Need It
β¦ Clean, tested code is what lets you change safely later. - Do think ahead for decisions that are expensive β¦
- DRY: Don't Repeat Yourself
β¦ s]+\.[^@\s]+$/.test(email)) throw new Error("Invalid email"); // profile.js if (!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(email)) throw β¦
- O β Open/Closed Principle
β¦ is risky Every time you open a working, tested function to add an else if , you risk breaking β¦
- DSA Interview Patterns Cheat Sheet
β¦ Interviews test whether you can recognise the pattern from the wording, then apply its template. Pick a technique β¦
- What Is Software Architecture?
β¦ in under a week Testability Can we verify it quickly? Business rules testable without a database Security Is β¦
- Design a File Storage Service
β¦ Metadata-owned ACL/capability Device sync Versioned change feed/conflict policy Object-store durability still needs recovery testing.
- Capacity, Availability, Latency and CAP
β¦ A 99.9% monthly target allows about 43 minutes of downtime; redundancy and tested recovery make the target β¦
- Creational Patterns: How to Make Objects
β¦ they make testing harder (tests share state) and hide dependencies. Prefer creating one instance in your composition root β¦
- I β Interface Segregation Principle
β¦ Any change to User can affect it, // and it is hard to reuse or test. function Avatar({ user β¦
- Debug Latency Like an Investigator
β¦ img/system-design-l6/latency-investigation.svg) Symptom Test first --- --- p50 and p99 rise Broad capacity, network, deploy β¦
- Transactions, Indexes & Concurrency
β¦ Restore-tested independent backups remain necessary.
- KISS: Keep It Simple, Stupid
β¦ C -- O[Slower onboarding] C -- T[Harder to test] B & R & O & T -- Cost["πΈ Every change costs more β¦
- Storage Engines & Database Operations
β¦ Keep independent backups, define retention, encrypt them, and test restoring a realistic dataset into an isolated environment. Know β¦
- Layered (N-Tier) Architecture
β¦ So business rules end up shaped by database tables, and testing a service needs a real (or heavily β¦
- ACID, Transactions & Locks
β¦ constraints and short-lived locks. The bank-transfer test A transfer moves 100 from A to B. If β¦
- Choosing an Architecture
β¦ and driven sides Many entry points, swappable integrations, testability Ports for things that never change Onion Rings around β¦
- Behavioral Patterns II: Chain, Template, Iterator, Mediator, Memento, Visitor
β¦ ve used it: React class lifecycle methods, test frameworks ( beforeEach β test β afterEach ), NestJS lifecycle hooks. π‘ Modern alternative: pass β¦
- SOLID at a Glance
Five design principles that keep object-oriented and modular code easy to extend, test and change. One picture β¦
- S β Single Responsibility Principle
β¦ since {formatMemberSince(user.createdAt)}</p </div ; } How to test for SRP Ask these questions about any class or β¦
- What Is Clean Code?
β¦ Does each function or class do one thing? Tested Can I change it and quickly know if I β¦
- Which Pattern Do I Need?
β¦ function first Singleton abuse Global state everywhere, flaky tests Dependency injection God object One class that knows and β¦
- Comments & Formatting
β¦ Code is executed and tested; comments are not. Comments that help Type Example --- --- Why (a decision) // Use insertion β¦
- React vs Vue vs Angular
β¦ everything built in (router, forms, HTTP, DI, testing), with strong conventions. Great for large enterprise teams. ![React, Vue β¦
- Small Functions That Do One Thing
Short, focused functions are easy to name, test and reuse. Learn how to spot a function doing too β¦
- Binary Search
β¦ overflows on huge ints lo + (hi - lo) / 2 π‘ Test with tiny arrays: [] , [1] , [1, 2] , and a target β¦
- Monolith vs Microservices
β¦ Transactions β One ACID database transaction β Sagas, eventual consistency Testing end to end β Easy β Hard Ops cost β Low β High β¦
- Docker & Containers
β¦ shop } volumes: [pgdata:/var/lib/postgresql/data] healthcheck: test: ["CMD-SHELL", "pg isready -U app"] interval: 5s cache β¦
- API Gateway, BFF & Service Discovery
β¦ in YAML π¦ Traffic splitting Canary releases, A/B tests π Telemetry Golden-signal metrics and traces for every call β¦
- Microkernel (Plugin) Architecture
β¦ the ecosystem Plug-ins are small, focused and testable in isolation Plug-in interactions can be hard to β¦
- REST API Design
β¦ From it you get interactive docs, client SDK generation, request validation and contract tests. yaml paths: /users/{id β¦
- Services & Ingress
β¦ podβ¦ wget -qO- http://shop-api/health β¦to test from inside the cluster kubectl port-forward svc/shop β¦