React Rules to Remember

Rendering * A component re-renders when state or props change * Re-rendering a parent re-renders all children unless wrapped in React.memo * Re-renders are not the same as DOM updates — React diffs first * State updates are asynchronous — you won't see new value immediately after setState State * Never mutate state directly…

React Performance Cheat Sheet

Here's a quick reference to debug and fix common react performance issues * Production mode: Make sure deployed app is a production build, NOT a development build. * Keys: make sure every component mapped from an array has a unique and stable key * Check component hierarchy or state: first try…

Database Basics for System Design Interviews

What are Databases? Databases are programs that either use disk or memory to do 2 core things: * record data * query data In general, they are usually always-on servers that are long lived and interact with the rest of your application through network calls, with protocols on top of TCP or…

Latency and Throughput

Latency Latency is the time it takes for a certain operation to complete in a system. Most often this measure is a time duration, like milliseconds(ms) or seconds(s). Typical Software System Latency Numbers: * Reading 1 MB from RAM: 0.25 ms * Reading 1 MB from SSD: 1 ms…