Understanding Open-Close Principle
Software entities (classes, modules, functions, etc.) should be open for extension but closed for modification.
Software entities (classes, modules, functions, etc.) should be open for extension but closed for modification.
High-level modules should not depend on low-level modules. Both should depend on abstractions. Abstractions should not depend on details. Details should depend on abstractions.
Find the maximum sum contiguous subarray in O(n) with Kadane's algorithm: why the naive O(n^2) approach is slow, how the algorithm works, and code.
What combinations are and how to compute them: the binomial coefficient C(n, k), combinations vs permutations, and Python code with and without itertools.
Learn how to build a professional Chrome Extension using React, Tailwind CSS and Vite. This step-by-step guide covers setup, configuration, and implementation with practical code examples.
How to generate all permutations of a set: the P(n, r) formula, a recursive algorithm, and an in-place backtracking implementation in Python.
Objects of a superclass should be replaceable with objects of its subclasses without affecting the correctness of the program.
A useLocalStorage hook for React: works like useState but persists the value in the browser's local storage. Includes usage and implementation.
Lazy load components in React with React.lazy and Suspense to load code only when it is needed and show a fallback UI while the component loads.
Cancel requests and clean up in React with AbortController: the general pattern, plus examples for fetch, event listeners, and WebSocket connections.