System Design
Importants 1. what is hashing? Ans. Hashing is the process of transforming input data (of any size) into a fixed-size value, usually a number or string, using a hash function . The result is called a hash value (or hash code, or digest). A hash function should be fast , deterministic (same input → same output), and should distribute outputs uniformly. Example: Suppose we have a simple hash function:- h ( x ) = (sum of ASCII values of characters in x) m o d 10 Input: "cat" ASCII: c=99, a=97, t=116 Sum = 99+97+116 = 312 Hash = 312 mod 10 = 2 So, "cat" maps to bucket 2 . Types of Hashing Usage Data structures : Hash tables / hash maps (fast lookups, insertions, deletions). Cryptography : Secure hashing (SHA-256, MD5) to protect data integrity. Databases : Indexing records using hash values. Password storage : Store only hashed passwords for security. Slang / Easy Explanation Hashing is like givi...