<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Srijan on Medium]]></title>
        <description><![CDATA[Stories by Srijan on Medium]]></description>
        <link>https://medium.com/@srijansingh974?source=rss-bfacd96b5e44------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RgKjY9VP8wB1IZbhL5eUAg.jpeg</url>
            <title>Stories by Srijan on Medium</title>
            <link>https://medium.com/@srijansingh974?source=rss-bfacd96b5e44------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 14:15:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@srijansingh974/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What I actually realized about how hash tables work under the hood]]></title>
            <link>https://medium.com/@srijansingh974/what-i-actually-realized-about-how-hash-tables-work-under-the-hood-9030f82204b0?source=rss-bfacd96b5e44------2</link>
            <guid isPermaLink="false">https://medium.com/p/9030f82204b0</guid>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Srijan]]></dc:creator>
            <pubDate>Tue, 20 Oct 2026 18:20:26 GMT</pubDate>
            <atom:updated>2026-10-20T18:20:26.154Z</atom:updated>
            <content:encoded><![CDATA[<p>I used to think dictionaries in Python or HashMaps in Java were just built-in features that let you look up data instantly. You pass a key, you get a value, and you move on. But working through data structures this semester forced me to look at what’s actually happening in memory, and honestly, it’s way simpler — and a lot more clever — than I initially thought.</p><p>At the core of it, a hash table is just an array. That’s it. Underneath all the abstraction, computers don’t know what a string key like &quot;user_123&quot; is; they just store data in contiguous blocks of memory where you access things using an integer index like arr[4]. The entire trick of a hash table is figuring out how to turn an arbitrary key into a valid array index.</p><p>That’s where the hash function comes in. You feed it a string, it runs some math on the bytes, spits out a giant integer, and then a modulo operation cuts it down so it fits inside the array size. When I write data[&quot;Srijan&quot;] = 90, the code isn&#39;t looping through a list to find &quot;Srijan.&quot; It&#39;s just doing some quick arithmetic and dropping 90 straight into, say, index 7.</p><p>Of course, once you realize it’s just math mapping infinite possible keys into a finite array, you immediately hit a wall: what happens when two different keys map to the exact same index?</p><p>That’s a collision. And since you can’t just overwrite data, every hash table implementation needs a fallback. Some languages use <strong>chaining</strong> — meaning that array index actually holds a tiny linked list, so if “Srijan” and “Rahul” both land on index 7, they just hang out in that list together. Others use <strong>open addressing</strong>, where the program just checks the next available spot in the array.</p><p>It completely changed how I view that O(1) lookup time we always talk about in class. It’s not an absolute guarantee; it’s an <em>average</em>. If your hash function is poorly written and causes a ton of collisions, your hash table basically degrades into searching through a linked list.</p><p>The other thing that finally made sense to me is why hash tables sometimes lag during heavy writes. You can’t let them fill up completely, or collisions skyrocket. That’s what the load factor measures — once a table hits around 75% capacity, it has to pause, build a brand-new array twice the size, and rehash every single item into its new home. It’s an expensive O(N) operation when it happens, but it’s the price you pay to keep everyday lookups fast.</p><p>Anyway, that’s how it clicked for me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9030f82204b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>