<?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"><channel><title><![CDATA[Saksham's Blog on Learning]]></title><description><![CDATA[Always a Learner | Never saying "It's not my work" - My Father]]></description><link>https://blog.0xsaksham.live</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 13:12:09 GMT</lastBuildDate><atom:link href="https://blog.0xsaksham.live/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Day 7: Tackling Mic Gain Problems and Exploring High-Frequency Trading]]></title><description><![CDATA[Let’s be real: some days of development are 10% coding and 90% fighting your tools. Day 7 was exactly that—a mix of OBS audio tuning, "Day 1" algorithm logic, and deep-level C++ concurrency.
Check the live session here: Watch on YouTube

🎙️ The "Pre...]]></description><link>https://blog.0xsaksham.live/day-7-tackling-mic-gain-problems-and-exploring-high-frequency-trading</link><guid isPermaLink="true">https://blog.0xsaksham.live/day-7-tackling-mic-gain-problems-and-exploring-high-frequency-trading</guid><dc:creator><![CDATA[Saksham Gupta]]></dc:creator><pubDate>Sat, 14 Feb 2026 11:34:23 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1771068841671/f9869362-8e7b-41fd-924e-cf346bca98f8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p> Let’s be real: some days of development are 10% coding and 90% fighting your tools. Day 7 was exactly that—a mix of OBS audio tuning, "Day 1" algorithm logic, and deep-level C++ concurrency.</p>
<p>Check the live session here: <strong><a target="_blank" href="https://youtu.be/BjZvN737Qzw?si=kiar_-MKD4yecoxp">Watch on YouTube</a></strong></p>
<hr />
<h2 id="heading-the-pre-game-struggle-audio-is-hard">🎙️ The "Pre-Game" Struggle: Audio is Hard</h2>
<p>Before hitting a single line of C++, I spent the first 10 minutes fighting <strong>OBS Studio</strong>. If your mic gain is too low, nobody listens. If it’s too high, you’re clipping and blowing out eardrums.</p>
<ul>
<li><strong>The Fix:</strong> Added a Gain Filter in OBS, settling between <strong>13 dB and 19 dB</strong>.</li>
<li><strong>Pro-tip:</strong> Use Noise Suppression (RNNoise) if you’re coding in a room with a loud fan or Indian street traffic.</li>
</ul>
<hr />
<h2 id="heading-algorithmic-evolution-the-sliding-window">🧠 Algorithmic Evolution: The Sliding Window</h2>
<p>We tackled the <strong>Maximum Average Subarray</strong> problem. The naive way to find the average of  elements in an array of size  is . That's garbage.</p>
<h3 id="heading-the-sliding-window-optimization">The "Sliding Window" Optimization</h3>
<p>Instead of re-summing  elements every time, you just:</p>
<ol>
<li><strong>Subtract</strong> the element leaving the window.</li>
<li><strong>Add</strong> the element entering the window.</li>
</ol>
<p><strong>Performance Hack:</strong> Don’t calculate the average inside the loop. Division is expensive for a CPU. Compare the <strong>sums</strong> instead, and do a single division at the very end.</p>
<pre><code class="lang-cpp"><span class="hljs-comment">// Optimized Logic</span>
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = k; i &lt; nums.size(); ++i) {
    currentSum += nums[i] - nums[i - k];
    maxSum = <span class="hljs-built_in">std</span>::max(maxSum, currentSum);
}
<span class="hljs-keyword">return</span> (<span class="hljs-keyword">double</span>)maxSum / k; <span class="hljs-comment">// Single division = Win</span>
</code></pre>
<hr />
<h2 id="heading-c-micro-optimizations-for-hft">🏎️ C++ Micro-Optimizations for HFT</h2>
<p>When building a <strong>Trading Terminal</strong> (which I’ve renamed to <strong>Hir Trader</strong> to avoid trademark drama), every clock cycle is a liability.</p>
<h3 id="heading-1-prefix-vs-postfix">1. Prefix vs. Postfix</h3>
<p>Stop using <code>i++</code>. Use <code>++i</code>.</p>
<ul>
<li><code>i++</code> (Postfix) creates a temporary copy of the object before incrementing.</li>
<li><code>++i</code> (Prefix) increments in place. In a loop running millions of times, those temporary objects add up to a performance tax you don't want to pay.</li>
</ul>
<h3 id="heading-2-false-sharing-amp-cache-alignment">2. False Sharing &amp; Cache Alignment</h3>
<p>In multithreaded trading engines, two threads can fight over the same <strong>Cache Line</strong> even if they are touching different variables.</p>
<ul>
<li><strong>The Solution:</strong> Use <code>alignas(64)</code> to ensure your atomic variables stay on their own cache lines. This prevents "False Sharing," which can destroy your throughput faster than a bad algorithm.</li>
</ul>
<hr />
<h2 id="heading-the-workflow-discipline-gt-motivation">📅 The Workflow: Discipline &gt; Motivation</h2>
<p>I’m keeping a strict work log and using <strong>WinGet</strong> for package management to keep the environment clean. Most of the heavy lifting is in <strong>C++ and CMake</strong>, with a focus on benchmarking the matching engine to handle 100+ orders with sub-millisecond latency.</p>
<h3 id="heading-cultural-note">Cultural Note</h3>
<p>While the West worries about Friday the 13th, we’re out here celebrating <strong>Sankranti and Ekadashi</strong>. It's a good reminder that perspective changes everything—whether in life or in code.</p>
<hr />
<h3 id="heading-whats-next">What's Next?</h3>
<p>The benchmark results for the matching engine are coming next. I’ll be pushing the concurrency-safe structures to GitHub soon.</p>
<p>#CPlusPlus #HFT #CodingLife #SoftwareEngineering #Optimization #SlidingWindow</p>
]]></content:encoded></item><item><title><![CDATA[Developer's Challenge: Code and Compilers on Day 6 of 90]]></title><description><![CDATA[In the world of software development, we often talk about "clean code" and "optimal algorithms" in a vacuum. But for many developers, coding doesn't happen in a sterile lab; it happens amidst system crashes, environmental frustrations, and the weight...]]></description><link>https://blog.0xsaksham.live/developers-challenge-code-and-compilers-on-day-6-of-90</link><guid isPermaLink="true">https://blog.0xsaksham.live/developers-challenge-code-and-compilers-on-day-6-of-90</guid><dc:creator><![CDATA[Saksham Gupta]]></dc:creator><pubDate>Fri, 13 Feb 2026 17:43:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1771004600615/4210bd94-e33d-44e2-b395-e544b67dacd9.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the world of software development, we often talk about "clean code" and "optimal algorithms" in a vacuum. But for many developers, coding doesn't happen in a sterile lab; it happens amidst system crashes, environmental frustrations, and the weight of socio-political realities.</p>
<p>In a recent deep-dive session, I explored the intersection of technical problem-solving—specifically tackling the <strong>Triplet Sum to Zero</strong> problem—and the broader challenges of being a creator and developer in India today.</p>
<p>You can watch the full journey here: <strong><a target="_blank" href="https://youtu.be/BjZvN737Qzw?si=kiar_-MKD4yecoxp">Watch on YouTube</a></strong></p>
<hr />
<h2 id="heading-the-technical-struggle-from-fedora-to-windows">🛠 The Technical Struggle: From Fedora to Windows</h2>
<p>Every Linux enthusiast knows the struggle: the power of customization vs. the need for stability. My session began with a deep dive into <strong>Fedora</strong>, <strong>ZSH</strong>, and <strong>GCC</strong> setups. However, when you’re trying to record and stream, tools like <strong>OBS Studio</strong> can be temperamental on Linux distributions.</p>
<p>Ultimately, the need for a seamless workflow led to a shift back to Windows to ensure performance optimizations and profile imports went smoothly. We also explored setting up <strong>VS Codium</strong> (the telemetry-free alternative to VS Code) to keep the development environment lean and privacy-focused.</p>
<hr />
<h2 id="heading-algorithmic-deep-dive-solving-triplet-sum-to-zero">🧠 Algorithmic Deep Dive: Solving "Triplet Sum to Zero"</h2>
<p>The core of the technical segment focused on a classic competitive programming challenge: finding all unique triplets in an array that sum up to zero.</p>
<h3 id="heading-the-evolution-of-the-solution">The Evolution of the Solution:</h3>
<ol>
<li><strong>The Brute Force Approach ():</strong>
Initially, using three nested loops is the most intuitive way to find triplets. However, this quickly leads to "Time Limit Exceeded" (TLE) errors on most platforms because the complexity grows cubically with the input size.</li>
<li><strong>The Optimization ():</strong>
By <strong>sorting</strong> the array first (), we unlock the ability to use the <strong>Two-Pointer Technique</strong>.</li>
<li><strong>Refining with Hash Sets:</strong>
To handle the "unique" constraint and avoid duplicate triplets, we implemented Hash Sets and clever pointer increments. This reduced the runtime significantly, moving the solution from "rejected" to "accepted."</li>
</ol>
<h3 id="heading-key-takeaways-for-your-next-interview">Key Takeaways for Your Next Interview:</h3>
<ul>
<li><strong>Sort First:</strong> Sorting is often the "cheat code" for array-based sum problems.</li>
<li><strong>Two-Pointers:</strong> When you have a target sum, two pointers (start and end) moving toward each other can turn an  problem into .</li>
<li><strong>Space-Time Tradeoff:</strong> Using a Hash Set costs memory but saves precious execution time.</li>
</ul>
<hr />
<h2 id="heading-beyond-the-code-the-reality-of-talent-in-india">🇮🇳 Beyond the Code: The Reality of Talent in India</h2>
<p>While solving for  is satisfying, the video also touches on the "systemic complexity" of being a student and professional in India. We had a candid discussion about:</p>
<ul>
<li><strong>The Talent Drain:</strong> Why many of India's brightest minds feel compelled to move abroad due to a lack of local recognition and systemic barriers.</li>
<li><strong>Education Costs:</strong> The disparity between high-cost private colleges and the extreme competition of government institutions.</li>
<li><strong>Quality of Life:</strong> From air quality concerns to food safety issues (like E.coli levels in milk), the "environment" a developer lives in is just as important as the IDE they use.</li>
</ul>
<p>Despite these frustrations, there is a recurring theme of <strong>hope and faith</strong>. Invoking the spirit of Shri Krishna, the discussion reflects a desire for divine intervention and a better future for the next generation of Indian builders.</p>
<hr />
<h2 id="heading-tools-amp-concepts-mentioned">📚 Tools &amp; Concepts Mentioned</h2>
<ul>
<li><strong>GCC &amp; ZSH:</strong> The backbone of the terminal experience.</li>
<li><strong>Sliding Window:</strong> Briefly discussed for subarray problems.</li>
<li><strong>Segment Trees:</strong> A look into more advanced data structures for range queries.</li>
<li><strong>OBS Studio:</strong> The go-to for recording, despite its Linux quirks.</li>
</ul>
<hr />
<h3 id="heading-final-thoughts">Final Thoughts</h3>
<p>Being a developer is more than just writing syntax; it's about navigating the tools we use and the world we live in. Whether you're debugging a C++ triplet sum or debugging the society around you, persistence is the only way forward.</p>
<p><strong>Check out the full video for the code walkthrough and the commentary:</strong>
👉 <a target="_blank" href="https://youtu.be/BjZvN737Qzw?si=kiar_-MKD4yecoxp">Evolution of an Algorithm &amp; Life Reflections</a></p>
<p>#Programming #Algorithms #WebDev #India #Linux #OpenSource #Career #CodingLife</p>
]]></content:encoded></item><item><title><![CDATA[Day 5 of 90: Effective HFT Prep with the Two-Pointer Technique and Overcoming Difficulties]]></title><description><![CDATA[Watch the Day 5 raw log here: https://youtu.be/Kh3lQ0drC8Y
The Pursuit of Discipline
I’ll be honest: today was a rough day and my mood was quite off. I faced setbacks with two Online Assessments (OAs)—one for Milliman that didn't go well and another ...]]></description><link>https://blog.0xsaksham.live/day-5-of-90-effective-hft-prep-with-the-two-pointer-technique-and-overcoming-difficulties</link><guid isPermaLink="true">https://blog.0xsaksham.live/day-5-of-90-effective-hft-prep-with-the-two-pointer-technique-and-overcoming-difficulties</guid><dc:creator><![CDATA[Saksham Gupta]]></dc:creator><pubDate>Tue, 10 Feb 2026 17:34:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1770744869157/9193db38-082a-45b0-a10c-b93589ae9d88.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Watch the Day 5 raw log here:</strong> <a target="_blank" href="https://www.google.com/search?q=https://youtu.be/Kh3lQ0drC8Y">https://youtu.be/Kh3lQ0drC8Y</a></p>
<h3 id="heading-the-pursuit-of-discipline"><strong>The Pursuit of Discipline</strong></h3>
<p>I’ll be honest: today was a rough day and my mood was quite off. I faced setbacks with two Online Assessments (OAs)—one for Milliman that didn't go well and another for Salesforce that featured complex DP and Graph questions. However, in HFT, discipline means showing up and documenting the grind even when things aren't going your way.</p>
<p><strong>The Internship Grind</strong></p>
<p>Despite the personal setbacks, I maintained my professional momentum. I put in over 3 hours of work on my remote internship, successfully completing three TypeScript tasks and getting my Pull Request merged.</p>
<hr />
<h3 id="heading-technical-deep-dive-two-sum-ii-sorted-array"><strong>Technical Deep Dive: Two Sum II (Sorted Array)</strong></h3>
<p>Today's focus was on <strong>LeetCode 167</strong>, which is a more constrained version of the classic Two Sum problem.</p>
<p><strong>1. The Problem Statement</strong></p>
<p>Given a 1-indexed array of integers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number.</p>
<ul>
<li><strong>Brute Force (<code>O(N²)</code>):</strong> A nested loop approach checking every possible pair—too slow for high-performance requirements.</li>
<li><strong>HFT Optimized (<code>O(N)</code>):</strong> Since the array is already sorted, we can use a <strong>Two-Pointer</strong> approach to find the target in a single pass.</li>
</ul>
<p><strong>2. The Logic</strong></p>
<ul>
<li><strong>Initialize Pointers:</strong> Place one pointer (<code>left</code>) at the beginning of the array and another (<code>right</code>) at the end.</li>
<li><strong>Sum Comparison:</strong> If the current sum is greater than the target, decrement the <code>right</code> pointer to decrease the sum. If the sum is less than the target, increment the <code>left</code> pointer.</li>
<li><strong>Memory Optimization:</strong> I initially used <code>long long</code> for the sum but realized a standard <code>int</code> was sufficient given the input constraints, avoiding unnecessary memory overhead.</li>
</ul>
<p><strong>3. Results</strong></p>
<ul>
<li><strong>Time Complexity:</strong> <code>O(N)</code></li>
<li><strong>Space Complexity:</strong> <code>O(1)</code></li>
<li><strong>Index Adjustment:</strong> Because the problem uses 1-based indexing, I adjusted the final indices by adding 1 to the result pointers.</li>
</ul>
<hr />
<p><strong>Current Status: 5/90 Days Complete</strong></p>
<p>Today was a "reality check" day, but the 90-day grind doesn't stop for bad moods or failed OAs. I'll be back tomorrow to pick up the pace, likely moving toward <strong>Three Sum</strong> problems.</p>
<p>#HFT #CPP #TwoPointers #90DayChallenge #MAIT #TypeScript #Discipline</p>
]]></content:encoded></item><item><title><![CDATA[Day 4/90: HFT Prep – Navigating Rotated Arrays & Memory Reallocations]]></title><description><![CDATA[Watch the Day 4 raw log here: https://youtu.be/TNzKKlwQrYM
The Pursuit of Discipline
Day 4 is about refining the "Signal." In high-frequency trading, every nanosecond counts, and today I focused on how both our algorithms and our choice of data struc...]]></description><link>https://blog.0xsaksham.live/day-490-hft-prep-navigating-rotated-arrays-and-memory-reallocations</link><guid isPermaLink="true">https://blog.0xsaksham.live/day-490-hft-prep-navigating-rotated-arrays-and-memory-reallocations</guid><dc:creator><![CDATA[Saksham Gupta]]></dc:creator><pubDate>Mon, 09 Feb 2026 17:10:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1770656941524/0697bd1f-0140-4094-9e13-fcebe74ea3d9.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Watch the Day 4 raw log here:</strong> <a target="_blank" href="https://www.google.com/search?q=https://youtu.be/TNzKKlwQrYM">https://youtu.be/TNzKKlwQrYM</a></p>
<h3 id="heading-the-pursuit-of-discipline"><strong>The Pursuit of Discipline</strong></h3>
<p>Day 4 is about refining the "Signal." In high-frequency trading, every nanosecond counts, and today I focused on how both our algorithms and our choice of data structure management impact latency. I’m continuing to use my digital tablet setup to practice "whiteboarding" my thought process—it’s a raw way to ensure I can communicate complex logic clearly under pressure.</p>
<p><strong>The "Rubber Duck" Breakthrough</strong></p>
<p>As always, <strong>Mr. Pengu</strong> was there to "interview" me as I worked through the logic. I spent some time troubleshooting my recording setup to ensure a steady frame rate for the live coding segments.</p>
<hr />
<h3 id="heading-technical-deep-dive-search-in-rotated-sorted-array"><strong>Technical Deep Dive: Search in Rotated Sorted Array</strong></h3>
<p>I tackled the <strong>Search in Rotated Sorted Array</strong> problem (LeetCode 33).</p>
<p><strong>1. The Problem Statement</strong></p>
<p>Given an integer array <code>nums</code> sorted in ascending order with distinct values, which is then possibly rotated at an unknown pivot index <code>k</code>, find the index of a target value.</p>
<ul>
<li><strong>Brute Force (<code>O(N)</code>):</strong> A linear search checking every element.</li>
<li><strong>HFT Optimized (<code>O(log N)</code>):</strong> Even in a rotated array, one half (either left or right of the midpoint) is always sorted. By identifying the sorted half and checking if the target lies within its range, we maintain binary search efficiency.</li>
</ul>
<p><strong>2. The Logic</strong></p>
<ul>
<li>We calculate the midpoint using the overflow-safe formula: <code>low + (high - low) / 2</code>.</li>
<li>Identify which half is sorted by comparing <code>nums[low]</code> with <code>nums[mid]</code>.</li>
<li>If the left half is sorted, check if the target is within that range to decide where to move the pointers.</li>
<li>Repeat the logic for the right half if the left isn't sorted.</li>
</ul>
<p><strong>3. The HFT "Gotcha": `std::vector::reserve</strong>`</p>
<p>I spent about 30 minutes analyzing the hidden costs of <code>std::vector</code>.</p>
<ul>
<li><strong>The Problem:</strong> Dynamic resizing (vector doubling) is expensive because it requires reallocating memory and <strong>copying</strong> all existing elements.</li>
<li><strong>The Solution:</strong> Use <code>v.reserve(n)</code> to allocate memory upfront. This prevents multiple reallocations and unnecessary data movement during <code>push_back</code> operations, which is critical for low-latency systems.</li>
</ul>
<hr />
<p><strong>Current Status: 4/90 Days Complete</strong></p>
<p>I'm starting to see the connections between basic DSA and hardware-level performance. Mastering these reallocations and boundary conditions is the only way to handle the high-pressure questions asked by firms like <strong>Graviton</strong> or <strong>Tower Research</strong>.</p>
<p>#HFT #CPP #BinarySearch #90DayChallenge #MAIT #FedoraLinux</p>
]]></content:encoded></item><item><title><![CDATA[Day 3/90: HFT Prep – Digital Whiteboarding & Binary Search Precision]]></title><description><![CDATA[Watch the Day 3 raw log here: https://youtu.be/Mcia2gwFWfA
The Pursuit of Discipline
I’ll be honest: I struggled with procrastination yesterday. I realized my previous 40-minute videos were too long to be sustainable logs, so I'm shifting to more foc...]]></description><link>https://blog.0xsaksham.live/day-390-hft-prep-digital-whiteboarding-and-binary-search-precision</link><guid isPermaLink="true">https://blog.0xsaksham.live/day-390-hft-prep-digital-whiteboarding-and-binary-search-precision</guid><dc:creator><![CDATA[Saksham Gupta]]></dc:creator><pubDate>Sun, 08 Feb 2026 18:25:46 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1770575111709/5b2140f8-2f1a-4af5-a902-dd72f694bf4c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Watch the Day 3 raw log here:</strong> <a target="_blank" href="https://www.google.com/search?q=https://youtu.be/Mcia2gwFWfA&amp;authuser=1">https://youtu.be/Mcia2gwFWfA</a></p>
<h3 id="heading-the-pursuit-of-discipline"><strong>The Pursuit of Discipline</strong></h3>
<p>I’ll be honest: I struggled with procrastination yesterday. I realized my previous 40-minute videos were too long to be sustainable logs, so I'm shifting to more focused updates. In HFT, efficiency is everything—not just in the code, but in how you manage your time.</p>
<p><strong>The "Tablet Setup" Breakthrough</strong></p>
<p>To become better at technical interviews, I needed a way to draw logic in real-time. I spent a good portion of today setting up <code>scrcpy</code> on my <strong>Fedora Linux</strong> system to mirror my Motorola tablet.</p>
<ul>
<li><p><strong>The Engineer's Choice:</strong> I opted for a USB cable connection over Wi-Fi to ensure the lowest possible latency and best performance while sketching.</p>
</li>
<li><p><strong>The "Rubber Duck":</strong> As always, <strong>Mr. Pengu</strong> was there to "interview" me as I worked through the setup and the code.</p>
</li>
</ul>
<hr />
<h3 id="heading-technical-deep-dive-floor-in-a-sorted-array"><strong>Technical Deep Dive: Floor in a Sorted Array</strong></h3>
<p>While I’m logging this today (February 8th), this progress is for yesterday (February 7th). I tackled the <strong>Floor in a Sorted Array</strong> problem.</p>
<p><strong>1. The Problem Statement</strong></p>
<p>Given a sorted array and an integer X, find the index of the largest element in the array that is less than or equal to X.</p>
<ul>
<li><p><strong>Brute Force (</strong><code>O(N)</code><strong>):</strong> A simple linear search where you check every element until you find one larger than X.</p>
</li>
<li><p><strong>HFT Optimized (</strong><code>O(log N)</code><strong>):</strong> Since the array is sorted, we must use <strong>Binary Search</strong>.</p>
</li>
</ul>
<p><strong>2. The Logic</strong></p>
<ul>
<li><p>We calculate the midpoint using <code>left + (right - left) / 2</code> to prevent integer overflow—a small but critical detail for high-performance systems.</p>
</li>
<li><p>If <code>array[mid] &lt;= X</code>, we store this index as a potential answer and move to the right half (<code>left = mid + 1</code>) to see if a larger "floor" exists.</p>
</li>
<li><p>If <code>array[mid] &gt; X</code>, we move to the left half (<code>right = mid - 1</code>).</p>
</li>
</ul>
<p><strong>3. Results</strong></p>
<ul>
<li><p><strong>Time Complexity:</strong> <code>O(log N)</code></p>
</li>
<li><p><strong>Space Complexity:</strong> <code>O(1)</code></p>
</li>
<li><p><strong>Performance:</strong> The solution passed all cases with a runtime of <strong>0.454s</strong>.</p>
</li>
</ul>
<hr />
<p><strong>Current Status: 3/90 Days Complete</strong></p>
<p>I know I've been a bit slow, but I'm picking up the pace. Mastering these fundamental boundary conditions is the only way to handle the high-pressure questions asked by firms like <strong>Graviton</strong> or <strong>Tower Research</strong>.</p>
<p>#HFT #CPP #BinarySearch #90DayChallenge #MAIT #FedoraLinux</p>
]]></content:encoded></item><item><title><![CDATA[Day 2 of 90: HFT Prep – Memory Alignment & Binary Search Variants]]></title><description><![CDATA[The Mission & Philosophy
Watch Day 2 on Youtube here
I’ve officially kicked off a 90-day challenge to break into top HFT firms like Graviton, Tower Research, and Jane Street. My goal isn't content creation; it’s about maintaining discipline and impro...]]></description><link>https://blog.0xsaksham.live/day-2-of-90-hft-prep-memory-alignment-and-binary-search-variants</link><guid isPermaLink="true">https://blog.0xsaksham.live/day-2-of-90-hft-prep-memory-alignment-and-binary-search-variants</guid><dc:creator><![CDATA[Saksham Gupta]]></dc:creator><pubDate>Sat, 07 Feb 2026 17:50:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/I_pOqP6kCOI/upload/3f26a89b87449b6fb7242b17159336c8.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-the-mission-amp-philosophy"><strong>The Mission &amp; Philosophy</strong></h2>
<p><a target="_blank" href="https://youtu.be/QfMksoek_EI?si=zhAYqug52hE8Z2rn">Watch Day 2 on Youtube here</a></p>
<p>I’ve officially kicked off a 90-day challenge to break into top HFT firms like <strong>Graviton</strong>, <strong>Tower Research</strong>, and <strong>Jane Street</strong>. My goal isn't content creation; it’s about maintaining discipline and improving my ability to explain complex code—a critical skill for high-stakes interviews. I’m keeping it raw: no editing, no flashy setups, just engineering focus.</p>
<p><strong>Finding Signal in the Noise</strong></p>
<ul>
<li><p><strong>The Environment</strong>: I'm recording this with a <em>Bhagavad Gita</em> path happening right outside my house—it's very loud, but the work doesn't stop.</p>
</li>
<li><p><strong>The "Rubber Duck"</strong>: Meet <strong>Mr. Pangu</strong>, my penguin interviewer who helps me talk through logic when I get stuck.</p>
</li>
<li><p><strong>The Tech</strong>: Running <strong>Fedora Linux</strong> with Hyperland on an Asus TUF gaming laptop. I’m an engineer first, so I’m using my built-in webcam to avoid wasting time on production.</p>
</li>
</ul>
<hr />
<h3 id="heading-technical-deep-dive-c-for-high-performance">Technical Deep Dive: C++ for High Performance</h3>
<p><strong>1. Struct Padding &amp; Memory Alignment</strong></p>
<p>I implemented a <code>MarketOrder</code> struct to demonstrate why memory layout is critical in high-frequency trading.</p>
<ul>
<li><p><strong>The Discovery</strong>: A struct with a <code>double</code>, <code>int</code>, <code>char</code>, and <code>bool</code> might seem like 14 bytes, but my system showed <strong>16 bytes</strong>.</p>
</li>
<li><p><strong>The Logic</strong>: On a 64-bit system, the compiler adds <strong>padding</strong> to ensure data is aligned to 8-byte boundaries.</p>
</li>
<li><p><strong>The Optimization</strong>: By reordering members to put the largest types first, I reduced a different struct version from <strong>24 bytes to 16 bytes</strong>.</p>
</li>
<li><p><strong>The HFT Impact</strong>: This saves 8 bytes of memory per order, which can prevent millions of CPU cache misses and reduce the memory footprint by 33%.</p>
</li>
</ul>
<p><strong>2. Production-Level Coding Standards</strong></p>
<ul>
<li><p><strong>No</strong> <code>bits/stdc++.h</code>: I'm moving away from competitive programming shortcuts and explicitly including headers like <code>&lt;iostream&gt;</code> for cleaner, production-ready code.</p>
</li>
<li><p><strong>Namespace Discipline</strong>: I've stopped using <code>using namespace std;</code> to avoid naming conflicts, which is standard practice in high-performance environments.</p>
</li>
<li><p><strong>Buffer Management</strong>: Using <code>\n</code> instead of <code>std::endl</code> to avoid unnecessary buffer flushes, which can be a performance bottleneck.</p>
</li>
</ul>
<hr />
<h3 id="heading-dsa-binary-search-mastery">DSA: Binary Search Mastery</h3>
<p>I tackled two fundamental problems that test precision with boundary conditions:</p>
<ul>
<li><p><strong>LeetCode 35 (Search Insert Position)</strong>: Implemented binary search using an overflow-safe midpoint calculation: <code>low + (high - low) / 2</code>.</p>
</li>
<li><p><strong>LeetCode 34 (First and Last Position in Sorted Array)</strong>: This involved running binary search logic to find the specific range of a target value in <code>O(log N)</code> time.</p>
</li>
</ul>
<p><strong>Current Status</strong>: Day 2/90 Complete.</p>
<p><strong>Next Steps</strong>: Continuing to strip away "content creator" habits and focus purely on nanosecond-level optimizations.</p>
<p>#HFT #C++ #90DayChallenge #LowLatency #QuantTrading #MAIT</p>
]]></content:encoded></item><item><title><![CDATA[Day 1 Highlights for 90-Day High-Frequency Trading Readiness]]></title><description><![CDATA[Learnt about Binary Search Lower Bound code and Upper Bound From Strivers Youtube Playlist

Implemented it on the Naukri Code 360 Platform

used lower_bound() function and upper_bound()
  lower_bound(arr.begin(),arr.end(),target) // O(log n) Time Com...]]></description><link>https://blog.0xsaksham.live/day-1-highlights-for-90-day-high-frequency-trading-readiness</link><guid isPermaLink="true">https://blog.0xsaksham.live/day-1-highlights-for-90-day-high-frequency-trading-readiness</guid><category><![CDATA[Programming Blogs]]></category><category><![CDATA[Sacrifice]]></category><category><![CDATA[hft]]></category><dc:creator><![CDATA[Saksham Gupta]]></dc:creator><pubDate>Fri, 06 Feb 2026 11:51:28 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/oXo6IvDnkqc/upload/3905d8e00e5d3963710092be64cb3caf.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<ul>
<li><p>Learnt about Binary Search Lower Bound code and Upper Bound From Strivers Youtube Playlist</p>
</li>
<li><p>Implemented it on the Naukri Code 360 Platform</p>
</li>
<li><p>used lower_bound() function and upper_bound()</p>
<pre><code class="lang-cpp">  lower_bound(arr.begin(),arr.end(),target) <span class="hljs-comment">// O(log n) Time Complexity STL function</span>
</code></pre>
</li>
<li><p>went to a wedding party but was satisfied I completed Leetcode 34: <a target="_blank" href="https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/description/">https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/</a></p>
</li>
<li><p>But I have to optimize it further</p>
</li>
</ul>
<h2 id="heading-i-will-improve-my-writing-here-and-keep-it-in-minimum-as-i-have-given-up">I will improve my writing here and keep it in minimum as I have given up</h2>
<ol>
<li><p>Instagram</p>
</li>
<li><p>Snapchat</p>
</li>
<li><p>Girls ( I am 23 and have no girlfriend )</p>
</li>
<li><p>Porn ( Yes, I was an addict, but I am improving Day-by-Day ) [It’s part of a mentality change]</p>
</li>
</ol>
<h1 id="heading-i-have-become-religious-and-follow-the-principles-of-the-bhagavad-gita">I have become religious and follow the principles of the Bhagavad Gita!</h1>
<p>Bye and thanks for Reading!</p>
]]></content:encoded></item><item><title><![CDATA[Republic Day Insights: Effective Vector Memory Management]]></title><description><![CDATA[vector memory management
#include <iostream>
#include <vector>
int main(){
    std::vector<int> v;
    std::cout<<"Initial Capacity: "<< v.capacity() <<"\n";

    for (int i = 0; i < 10; ++i){
        v.push_back(i);

        std::cout<<" Size: " << ...]]></description><link>https://blog.0xsaksham.live/republic-day-insights-effective-vector-memory-management</link><guid isPermaLink="true">https://blog.0xsaksham.live/republic-day-insights-effective-vector-memory-management</guid><category><![CDATA[C++]]></category><category><![CDATA[memory-management]]></category><category><![CDATA[high frequency trading]]></category><dc:creator><![CDATA[Saksham Gupta]]></dc:creator><pubDate>Mon, 26 Jan 2026 18:50:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769453221126/ea301502-f1ec-463d-833a-43cb29a45c1f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-vector-memory-management">vector memory management</h2>
<pre><code class="lang-cpp"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;iostream&gt;</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;vector&gt;</span></span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span>{
    <span class="hljs-built_in">std</span>::<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt; v;
    <span class="hljs-built_in">std</span>::<span class="hljs-built_in">cout</span>&lt;&lt;<span class="hljs-string">"Initial Capacity: "</span>&lt;&lt; v.capacity() &lt;&lt;<span class="hljs-string">"\n"</span>;

    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">10</span>; ++i){
        v.push_back(i);

        <span class="hljs-built_in">std</span>::<span class="hljs-built_in">cout</span>&lt;&lt;<span class="hljs-string">" Size: "</span> &lt;&lt; v.size()
                 &lt;&lt;<span class="hljs-string">" | Capacity: "</span>&lt;&lt; v.capacity()
                 &lt;&lt;<span class="hljs-string">" | Address of v[0]: "</span> &lt;&lt; &amp;v[<span class="hljs-number">0</span>] &lt;&lt; <span class="hljs-string">"\n"</span>;
    }
    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;
}
</code></pre>
<p>This code scales, but it has a problem known as the <strong><em>doubling strategy</em></strong>!</p>
<ul>
<li><p>but, it’s not a problem, basically we all know vector is a dynamic array</p>
</li>
<li><p>but what makes it dynamic is the doubling strategy</p>
</li>
<li><p>the vector starts with 0 initial capacity, then we add 1, so it increase it’s capacity by 1</p>
</li>
<li><p>basically the whole vector moves to new position of size: 1 , now we add another element: 2,</p>
</li>
<li><p>it resizes itself to 1×2 = 2 , not resize but move to a new space with size:2</p>
</li>
<li><p>now another element:3 (here) , it resizes 2×2=4, and so on,</p>
</li>
<li><p>the vector sizes become 0,1,2,4,8,16…</p>
</li>
<li><p>this is a problem for high frequency trading firm</p>
</li>
<li><p>THE SOLUTION(WRONG ONE: My thought) → we use v(10) at the starting of the vector while initializing</p>
</li>
</ul>
<pre><code class="lang-cpp"><span class="hljs-function"><span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt; <span class="hljs-title">v</span><span class="hljs-params">(<span class="hljs-number">10</span>)</span></span>;
</code></pre>
<ul>
<li><p>what’s wrong? it actually makes an array with 10 zeroes initialized</p>
</li>
<li><p>and the element to be added will go to 11th position where size of v: 10×2=20;</p>
</li>
<li><p>LOL</p>
</li>
<li><p>correct approach? <em>use reverse()</em></p>
</li>
</ul>
<pre><code class="lang-cpp"><span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt; v;
v.reserve(<span class="hljs-number">10</span>);
</code></pre>
<ul>
<li>it tells the compiler, we are expecting 10 values here, until then don’t resize!!!!!</li>
</ul>
<h2 id="heading-bye-and-jai-shree-ram">Bye and Jai Shree Ram!</h2>
]]></content:encoded></item><item><title><![CDATA[Falling in Love with ReactJS]]></title><description><![CDATA[TIL, ReactJS docs are really good and I am starting to get a better hang of how hooks really work.
useContext
The most important thing in daily life of a ReactJS developer maybe the context providers.
NextJS provides them pre written and ready to use...]]></description><link>https://blog.0xsaksham.live/falling-in-love-with-reactjs</link><guid isPermaLink="true">https://blog.0xsaksham.live/falling-in-love-with-reactjs</guid><category><![CDATA[React]]></category><category><![CDATA[react hooks]]></category><category><![CDATA[useContext]]></category><dc:creator><![CDATA[Saksham Gupta]]></dc:creator><pubDate>Tue, 06 Aug 2024 17:37:46 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/UYsBCu9RP3Y/upload/76183e7017f3325caeabade8d6cafde8.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>TIL, ReactJS docs are really good and I am starting to get a better hang of how hooks really work.</p>
<h1 id="heading-usecontext">useContext</h1>
<p>The most important thing in daily life of a ReactJS developer maybe the context providers.</p>
<p>NextJS provides them pre written and ready to use. But when I tried to understand them.</p>
<p>Man oh man, they are simply really good.</p>
<p><code>createContext</code> allows to make the parameters for the context provider.</p>
<p>This thing solves the problem of prop-drilling. Any ReactJS developer may tell you that how it is a pain in the 🌝.</p>
<p><code>useContext</code> allows you to pass the context in the top most file and use it anywhere.</p>
<p>Damnnnn!!!!!</p>
<p>Now I know why everyone loves React ecosystem.</p>
<p>Resources:</p>
<ul>
<li><p>Prop-drilling=&gt;</p>
<p>  https://react.dev/learn/passing-data-deeply-with-context</p>
</li>
<li><p>useContext=&gt; https://react.dev/reference/react/useContext</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Python is a scripting language?]]></title><description><![CDATA[I was introduced to Python very late in life, I considered it too easy to get over.
As I continued my internship at Summer of Bitcoin, I had some tasks related to python knowledge, I gave in and started finding resources for the same.
Luckily my favo...]]></description><link>https://blog.0xsaksham.live/python-is-a-scripting-language</link><guid isPermaLink="true">https://blog.0xsaksham.live/python-is-a-scripting-language</guid><category><![CDATA[Python]]></category><category><![CDATA[scripting languages]]></category><category><![CDATA[Script]]></category><category><![CDATA[virtual machine]]></category><dc:creator><![CDATA[Saksham Gupta]]></dc:creator><pubDate>Wed, 24 Jul 2024 15:55:40 GMT</pubDate><content:encoded><![CDATA[<p>I was introduced to Python very late in life, I considered it too easy to get over.</p>
<p>As I continued my internship at Summer of Bitcoin, I had some tasks related to python knowledge, I gave in and started finding resources for the same.</p>
<p>Luckily my favourite teacher, Hitesh Choudhary sir has a whole playlist on it, this blog is the assignment my guru has given to me.</p>
<h1 id="heading-why-python">Why Python?</h1>
<p>Python is the most strong contender in the number game, I mean it can calculate stuff really fast in it's <a target="_blank" href="https://www.python.org/shell/">shell</a>. Huh, I was astonished when Python was able to find power of 2^1000 in milliseconds.</p>
<pre><code class="lang-python"><span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-number">2</span> ** <span class="hljs-number">1000</span>
<span class="hljs-number">1071508607186267320948425049060001810561404811705533607443750388370351051124936122493198378815695858127594</span>
<span class="hljs-number">6729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474</span>
<span class="hljs-number">983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>WOW!!
</code></pre>
<h1 id="heading-inner-working-of-python">Inner working of Python</h1>
<p>How is Python able to do it so fast, the secret lies in the concept of Virtual Machines.</p>
<p>That was introduced by the old faithful Java language, this concept of creating a byte code before running the actual code is really life changing and introduction of a SHELL combines python to be a super power in the number game.</p>
<p>Hitesh Sir taught me:</p>
<blockquote>
<p>Shell and Virtual Machine keep on working in background when we save the file and shows us results and keeps checking for error.</p>
</blockquote>
<pre><code class="lang-python">number = int(input(<span class="hljs-string">"Please Enter any Number: "</span>))

print(<span class="hljs-string">"The List of Natural Numbers from 1 to {0} are"</span>.format(number)) 

<span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> range(<span class="hljs-number">1</span>, number + <span class="hljs-number">1</span>):
    <span class="hljs-keyword">print</span> (i, end = <span class="hljs-string">'  '</span>)
</code></pre>
<p>This .py code will get go to interpreter that consists of 2 things:</p>
<ol>
<li><p>Compiler</p>
</li>
<li><p>Virtual Machine</p>
</li>
</ol>
<p>Compiler compiles the code to Bytecode, with a .pyc extension name and this file is passed on to virtual machine that runs it and we get out put on the screen.</p>
<p><img src="https://media.geeksforgeeks.org/wp-content/uploads/20230809115142/Internal-working-of-Python-(1).gif" alt="Internal-working-of-Python-(1)" /></p>
<p>Thanks to GFG for this picture.</p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>I am pretty new to blogging, please cope with me but I really love teaching people new stuff.</p>
<p>I'll deep dive more into python and share what I learn.</p>
<p>Thanks for Reading.</p>
<p>If you reached till here: Here's a <a target="_blank" href="https://www.mediafire.com/file/tt0ki3n89sawxsb/Inner_Working_of_Python.pdf/file">Gift</a> for you.</p>
<h1 id="heading-resources-used">Resources Used</h1>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=3HTKc-ZgZbg&amp;list=PLu71SKxNbfoBsMugTFALhdLlZ5VOqCg2s&amp;index=4">https://www.youtube.com/watch?v=3HTKc-ZgZbg&amp;list=PLu71SKxNbfoBsMugTFALhdLlZ5VOqCg2s&amp;index=4</a></div>
<p> </p>
<p><a target="_blank" href="https://www.geeksforgeeks.org/internal-working-of-python/">Thanks to GFG</a></p>
]]></content:encoded></item><item><title><![CDATA[Typescript: Rust's non-biological brother]]></title><description><![CDATA[Why did I start learning it?
I embarked on my journey with TypeScript on May 28, 2024, to contribute to the Jam Project as part of the Summer of Bitcoin Internship program.
What do I mean by brother?

Strong typing: Both languages emphasize static ty...]]></description><link>https://blog.0xsaksham.live/typescript-rusts-non-biological-brother</link><guid isPermaLink="true">https://blog.0xsaksham.live/typescript-rusts-non-biological-brother</guid><category><![CDATA[TypeScript]]></category><category><![CDATA[Rust]]></category><category><![CDATA[TypeSafety]]></category><dc:creator><![CDATA[Saksham Gupta]]></dc:creator><pubDate>Thu, 18 Jul 2024 15:14:27 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-why-did-i-start-learning-it">Why did I start learning it?</h2>
<p>I embarked on my journey with TypeScript on May 28, 2024, to contribute to the <a target="_blank" href="https://jamapp.org/">Jam Project</a> as part of the <a target="_blank" href="https://www.summerofbitcoin.org/">Summer of Bitcoin</a> Internship program.</p>
<h2 id="heading-what-do-i-mean-by-brother">What do I mean by brother?</h2>
<ol>
<li><p>Strong typing: Both languages emphasize static typing to catch errors at compile-time.</p>
</li>
<li><p>Modern language features: They both incorporate modern programming concepts and syntax.</p>
</li>
<li><p>Tooling and ecosystem: Both have robust tooling support and growing ecosystems.</p>
</li>
<li><p>Safety focus: TypeScript and Rust prioritize writing safer code, albeit in different ways.</p>
</li>
<li><p>Compiled languages: Both compile to a target language/format (TypeScript to JavaScript, Rust to machine code).</p>
</li>
</ol>
<p>Huh, They are pretty similar in some traits and also share pretty much same syntax.</p>
<p>Here's a Basic Function using Generics in both languages!</p>
<pre><code class="lang-typescript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">identity</span>&lt;<span class="hljs-title">T</span>&gt;(<span class="hljs-params">arg: T</span>): <span class="hljs-title">T</span> </span>{
    <span class="hljs-keyword">return</span> arg;
}

<span class="hljs-keyword">let</span> output = identity&lt;<span class="hljs-built_in">string</span>&gt;(<span class="hljs-string">"myString"</span>);
<span class="hljs-keyword">let</span> output2 = identity(<span class="hljs-string">"myString"</span>);  <span class="hljs-comment">// Type inference</span>
</code></pre>
<pre><code class="lang-rust"><span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">identity</span></span>&lt;T&gt;(arg: T) -&gt; T {
    arg
}

<span class="hljs-keyword">let</span> output = identity::&lt;<span class="hljs-built_in">String</span>&gt;(<span class="hljs-built_in">String</span>::from(<span class="hljs-string">"myString"</span>));
<span class="hljs-keyword">let</span> output2 = identity(<span class="hljs-string">"myString"</span>);  <span class="hljs-comment">// Type inference</span>
</code></pre>
<p>Can you notice the similarities? I mean WOW!  </p>
<p>As a person coming from Rust and Typesafe languages, I was able to pickup Typescript very quickly and absolutely love it now.  </p>
<hr />
<p>Thanks for Reading my blog, this is the first one in series and I hope to continue it.</p>
<p>If you have come this far? Here's a gift for you 🎁</p>
<p><a target="_blank" href="https://www.mediafire.com/file/0reeprz26clp3ok/Typescript_Cheat_Sheets.pdf/file">Typescript Cheat Sheet</a></p>
]]></content:encoded></item></channel></rss>