<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://ayushdhardubey.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://ayushdhardubey.github.io/" rel="alternate" type="text/html" /><updated>2026-04-30T21:28:07+05:30</updated><id>https://ayushdhardubey.github.io/feed.xml</id><title type="html">Ayush Dhar Dubey</title><subtitle>Notes from a wandering mind. A small corner of the internet where I write about the things that keep me curious.
</subtitle><author><name>Ayush Dhar Dubey</name></author><entry><title type="html">बादल</title><link href="https://ayushdhardubey.github.io/kavita/2026/04/30/baadal/" rel="alternate" type="text/html" title="बादल" /><published>2026-04-30T21:26:00+05:30</published><updated>2026-04-30T21:26:00+05:30</updated><id>https://ayushdhardubey.github.io/kavita/2026/04/30/baadal</id><content type="html" xml:base="https://ayushdhardubey.github.io/kavita/2026/04/30/baadal/"><![CDATA[<p>इन भीगी भीगी बूँदों में एक जानी पहचानी सी छुअन है,
इस भीगती माटी में वही पुरानी महक है,
और रह रह कर सर्द हवा का कोई झोंका, कानों में कुछ कह जाता है।</p>

<p>दूर क्षितिज पर जहाँ उमड़ती है यह काली बदली,
उस शून्य में ताकता बस सोच रहा हूँ
क्या आज तुम्हारे आँगन में भी नभ छाया है?</p>]]></content><author><name>Ayush Dhar Dubey</name></author><category term="kavita" /><summary type="html"><![CDATA[इन भीगी भीगी बूँदों में एक जानी पहचानी सी छुअन है, इस भीगती माटी में वही पुरानी महक है, और रह रह कर सर्द हवा का कोई झोंका, कानों में कुछ कह जाता है।]]></summary></entry><entry><title type="html">कृतघ्नता</title><link href="https://ayushdhardubey.github.io/kavita/2026/04/21/kritaghnata/" rel="alternate" type="text/html" title="कृतघ्नता" /><published>2026-04-21T01:41:00+05:30</published><updated>2026-04-21T01:41:00+05:30</updated><id>https://ayushdhardubey.github.io/kavita/2026/04/21/kritaghnata</id><content type="html" xml:base="https://ayushdhardubey.github.io/kavita/2026/04/21/kritaghnata/"><![CDATA[<p>वह छाँव, जिसे मैने धूप से बचने को चुना था,
मेरे लिए उसका वजूद, बस मेरी तपिश का एक उधार था;
शाम ढली, तो वह अहसान मेरे लिए बेमानी हो गया।</p>

<p>मगर वह तरु-शिखर… जिसने बरसों निर्बाध धूप सही है,
आज फिर रात के सन्नाटे में, अपने ऊँचाई से झंकता हुआ मेरे बौने कद पर हंसता है।</p>]]></content><author><name>Ayush Dhar Dubey</name></author><category term="kavita" /><summary type="html"><![CDATA[वह छाँव, जिसे मैने धूप से बचने को चुना था, मेरे लिए उसका वजूद, बस मेरी तपिश का एक उधार था; शाम ढली, तो वह अहसान मेरे लिए बेमानी हो गया।]]></summary></entry><entry><title type="html">मूर्ख</title><link href="https://ayushdhardubey.github.io/kavita/2026/04/08/murkh/" rel="alternate" type="text/html" title="मूर्ख" /><published>2026-04-08T12:14:00+05:30</published><updated>2026-04-08T12:14:00+05:30</updated><id>https://ayushdhardubey.github.io/kavita/2026/04/08/murkh</id><content type="html" xml:base="https://ayushdhardubey.github.io/kavita/2026/04/08/murkh/"><![CDATA[<p>वह पुरानी लकड़ी के गुमसाए हुए किवाड़ और उनके झरोखों की जिद्द से छनकर आती वह छिटकी हुई चाँदनी।</p>

<p>लोभ जागा मुझमें की वह मेरे ही कमरे में रहे,
मगर किवाड़ बंद करते ही… कमरे से गायब थी वो।</p>

<p>और छोड़ गई थी अपने पीछे एक आदमकदम अंधेरा जो मेरे कानों में बुदबुदा रहा था “मूर्ख हो तुम”।</p>]]></content><author><name>Ayush Dhar Dubey</name></author><category term="kavita" /><summary type="html"><![CDATA[वह पुरानी लकड़ी के गुमसाए हुए किवाड़ और उनके झरोखों की जिद्द से छनकर आती वह छिटकी हुई चाँदनी।]]></summary></entry><entry><title type="html">मेरी कमाई</title><link href="https://ayushdhardubey.github.io/kavita/2026/04/02/kamai/" rel="alternate" type="text/html" title="मेरी कमाई" /><published>2026-04-02T02:48:00+05:30</published><updated>2026-04-02T02:48:00+05:30</updated><id>https://ayushdhardubey.github.io/kavita/2026/04/02/kamai</id><content type="html" xml:base="https://ayushdhardubey.github.io/kavita/2026/04/02/kamai/"><![CDATA[<p>कल उतरा था कुछ मंशा के साथ इस मेढ़ में,
मगर धीरे-धीरे कीचड़ इतना बढ़ चुका है,
कि अब उससे बच कर कहीं आ जा सकना,
मेरे बस का नहीं है।
​अब तो उसे झटकना भी मुमकिन नहीं।
मैं पांव फटकता हूं, उस कीचड़ को झटकारने।
मेरे हाथ लपकते हैं,
उसे पकड़ने, जो मुझे उपहार में नहीं मिला,
पर जो बस… सरक रहा है,
शायद किसी आहट से।
​अब डर लगता है
कि यदि यह कीचड़ सूख गया मुझ पर,
क्या फिर भी तुम मुझे पहचान सकोगे?</p>]]></content><author><name>Ayush Dhar Dubey</name></author><category term="kavita" /><summary type="html"><![CDATA[कल उतरा था कुछ मंशा के साथ इस मेढ़ में, मगर धीरे-धीरे कीचड़ इतना बढ़ चुका है, कि अब उससे बच कर कहीं आ जा सकना, मेरे बस का नहीं है। ​अब तो उसे झटकना भी मुमकिन नहीं। मैं पांव फटकता हूं, उस कीचड़ को झटकारने। मेरे हाथ लपकते हैं, उसे पकड़ने, जो मुझे उपहार में नहीं मिला, पर जो बस… सरक रहा है, शायद किसी आहट से। ​अब डर लगता है कि यदि यह कीचड़ सूख गया मुझ पर, क्या फिर भी तुम मुझे पहचान सकोगे?]]></summary></entry><entry><title type="html">अपयश</title><link href="https://ayushdhardubey.github.io/kavita/2026/02/25/apyash/" rel="alternate" type="text/html" title="अपयश" /><published>2026-02-25T20:16:00+05:30</published><updated>2026-02-25T20:16:00+05:30</updated><id>https://ayushdhardubey.github.io/kavita/2026/02/25/apyash</id><content type="html" xml:base="https://ayushdhardubey.github.io/kavita/2026/02/25/apyash/"><![CDATA[<p>निरावृत किये बगैर भला वीणा को,</p>

<p>किसने पाया यहाँ अप्राप्य ज्योत्स्ना को।</p>

<p>है रचना विरंचि की बड़ी विचित्र, निर्मोही,</p>

<p>यश का आसन दुर्लभ, अपयश क्षणिक आरोही।</p>]]></content><author><name>Ayush Dhar Dubey</name></author><category term="kavita" /><summary type="html"><![CDATA[निरावृत किये बगैर भला वीणा को,]]></summary></entry><entry><title type="html">स्थिति</title><link href="https://ayushdhardubey.github.io/kavita/2026/02/22/sthiti/" rel="alternate" type="text/html" title="स्थिति" /><published>2026-02-22T03:17:00+05:30</published><updated>2026-02-22T03:17:00+05:30</updated><id>https://ayushdhardubey.github.io/kavita/2026/02/22/sthiti</id><content type="html" xml:base="https://ayushdhardubey.github.io/kavita/2026/02/22/sthiti/"><![CDATA[<p>अभिमान था कि तृष्णा कभी छू न सकेगी,</p>

<p>कल्पना टूटी तो भान हुआ समुद्र ही जो खारा है।</p>]]></content><author><name>Ayush Dhar Dubey</name></author><category term="kavita" /><summary type="html"><![CDATA[अभिमान था कि तृष्णा कभी छू न सकेगी,]]></summary></entry><entry><title type="html">क्यों</title><link href="https://ayushdhardubey.github.io/kavita/2026/01/15/kyon/" rel="alternate" type="text/html" title="क्यों" /><published>2026-01-15T02:33:00+05:30</published><updated>2026-01-15T02:33:00+05:30</updated><id>https://ayushdhardubey.github.io/kavita/2026/01/15/kyon</id><content type="html" xml:base="https://ayushdhardubey.github.io/kavita/2026/01/15/kyon/"><![CDATA[<p>क्योंकि मैं उसे जानता हूं,</p>

<p>जिसने इस नीम के पत्ते खाए हैं,</p>

<p>और जो इसकी जड़ की
लकड़ी तक भक्ष सकता है।</p>

<p>क्यों कि वह मुझे प्यारा है,</p>

<p>इस लिए मैं नीम की
जड़ से आंख नहीं चुरा पाता,</p>

<p>ना उसकी कठोरता पर मुंह फेर सकता हूं;</p>

<p>बल्कि पत्ती को
प्यार भर करता हूँ,</p>

<p>और शायद करता रहूंगा।</p>

<p>क्योंकि शायद मैं सिर्फ खुद को ही जानता हूं!</p>]]></content><author><name>Ayush Dhar Dubey</name></author><category term="kavita" /><summary type="html"><![CDATA[क्योंकि मैं उसे जानता हूं,]]></summary></entry><entry><title type="html">What Competitive Programming Doesn’t Teach About Performance</title><link href="https://ayushdhardubey.github.io/blogs/2025/12/25/competitive-programmers-entering-production/" rel="alternate" type="text/html" title="What Competitive Programming Doesn’t Teach About Performance" /><published>2025-12-25T18:16:00+05:30</published><updated>2025-12-25T18:16:00+05:30</updated><id>https://ayushdhardubey.github.io/blogs/2025/12/25/competitive-programmers-entering-production</id><content type="html" xml:base="https://ayushdhardubey.github.io/blogs/2025/12/25/competitive-programmers-entering-production/"><![CDATA[<h1 id="competitive-programmers-entering-production">Competitive Programmers entering production</h1>

<p>Competitive Programming trains one to fear O(N²) like a mortal sin. Somewhere along the way, it became the ultimate marker of “bad code”. But in production, the real killers usually look far more innocent:</p>

<ul>
  <li>one N+1 query</li>
  <li>a handful of network or disk calls inside a “cheap” loop</li>
  <li>synchronous I/O hiding behind a clean abstraction</li>
</ul>

<p>In institutes, the Codeforces / LeetCode culture is so dominant that many engineers grow up optimizing toy problems in isolation, while staying largely unaware of how real systems behave under load.</p>

<p>To be clear, this training <em>is</em> useful. Competitive programming teaches fundamentals extremely well: algorithmic thinking, complexity analysis, edge cases, and discipline. But stopping there gives you a very skewed mental model. CP and DSA alone won’t take one very far once they start building production-ready systems.</p>

<h2 id="boundaries-are-expensive">Boundaries are expensive</h2>

<p>In production, every time your code crosses a boundary, the cost explodes.</p>

<ul>
  <li>process boundary</li>
  <li>network boundary</li>
  <li>database boundary</li>
  <li>disk boundary</li>
</ul>

<p>CP problems live entirely inside one process. Production code mostly exists to cope with the cost of boundaries, not pretend they don’t exist.</p>

<p>Production projects have a habit of forcing reality into the picture. They make you confront how expensive a read or write operation really is, even when the task itself looks trivial. A single ORM loop doing database queries can dwarf the cost of any “suboptimal” in-memory algorithm one was taught to fear.</p>

<h2 id="the-limits-of-big-o">The limits of Big-O</h2>

<p>Big-O, by design, abstracts away things that dominate real-world performance:</p>

<ul>
  <li>it ignores constants</li>
  <li>it assumes uniform cost per operation</li>
  <li>it ignores latency and blocking</li>
  <li>it ignores contention, queues, and backpressure</li>
</ul>

<p>In the hoard of DSA, CP problems, and script-level solutions, it’s easy to forget that Big-O is a theoretical tool. It was never meant to answer system-level questions. At the system level, we deal with network latency, disk I/O, thread contention, cache misses, and coordination costs. Big-O does not, and cannot, account for these.</p>

<p><strong>Big-O answers “what happens as <em>n</em> grows”.</strong><br />
<strong>Production asks “what happens when this runs 10,000 times per minute”.</strong></p>

<h2 id="the-n1-query-problem">The N+1 query problem</h2>

<p>If you’ve worked with databases and applications long enough, you’ve almost certainly met the N+1 query problem.</p>

<p>Imagine a list of users, where each user can have multiple uploaded models. This is a classic one-to-many relationship. Now suppose you need to fetch all users along with their models. A naive approach is to first query all users, and then, for each user, issue another query to fetch their models.</p>

<p>It looks harmless. It even feels clean.</p>

<p>That’s the N+1 query devil.</p>

<p>You run one query to get <em>N</em> users, then <em>N</em> additional queries to fetch their related data. With 100 users, that’s 101 queries.</p>

<p>That’s way too much for a single request. But in the CP world, it’s just O(1)*N operations, right? Now let’s say you serve 100 users per minute. That’s 10,100 queries per minute. Over an hour, that’s 606,000 queries. Over a day, that’s over 14 million queries. This is what’s gonna smoke your database server. No O(N²) here, just N+1, but the effect is multiplicative.</p>

<p>As the dataset grows, the latency quietly balloons. Test cases often don’t catch this because they run on small datasets where the overhead is negligible. In production, with real data and real traffic, this pattern can cripple performance.</p>

<p><em>Solution: Use joins to fetch data in one query, or use ORM batch loading to avoid N+1.</em></p>

<h2 id="real-world-performance-considerations">Real-world performance considerations</h2>

<p>One might carefully optimize a sorting algorithm from O(NlogN) to O(N), while overlooking that the data is fetched over a network with 200ms latency – making the sort time irrelevant.</p>

<p>Big-O still matters. Algorithmic thinking still matters. One just need to know when it stops being the dominant factor in the system.</p>

<p>I recently ran into a case in a large-scale project where we were performing disk I/O on every API call just to load environment variables. In an otherwise highly optimized ecosystem, this alone accounted for roughly 25–30% of the total request latency. At that scale, this wasn’t a micro-optimization. It was the bottleneck.</p>

<p>That’s the gap between algorithmic cleanliness and system reality. And it’s a gap one will only notice after something catches fire.</p>]]></content><author><name>Ayush Dhar Dubey</name></author><category term="blogs" /><summary type="html"><![CDATA[Competitive Programmers entering production]]></summary></entry><entry><title type="html">ह्रदय</title><link href="https://ayushdhardubey.github.io/kavita/2025/12/14/hriday/" rel="alternate" type="text/html" title="ह्रदय" /><published>2025-12-14T02:40:00+05:30</published><updated>2025-12-14T02:40:00+05:30</updated><id>https://ayushdhardubey.github.io/kavita/2025/12/14/hriday</id><content type="html" xml:base="https://ayushdhardubey.github.io/kavita/2025/12/14/hriday/"><![CDATA[<p>मै इन खेतों के सूखे की फटन में अपना हृदय गला कर भरता हूँ,</p>

<p>भरता आया हूँ,</p>

<p>पर जानता हूँ कि उसे पानी चाहिए,</p>

<p>जो मैं ला नहीं सकता।</p>]]></content><author><name>Ayush Dhar Dubey</name></author><category term="kavita" /><summary type="html"><![CDATA[मै इन खेतों के सूखे की फटन में अपना हृदय गला कर भरता हूँ,]]></summary></entry><entry><title type="html">विरह</title><link href="https://ayushdhardubey.github.io/kavita/2025/11/21/virah/" rel="alternate" type="text/html" title="विरह" /><published>2025-11-21T02:01:00+05:30</published><updated>2025-11-21T02:01:00+05:30</updated><id>https://ayushdhardubey.github.io/kavita/2025/11/21/virah</id><content type="html" xml:base="https://ayushdhardubey.github.io/kavita/2025/11/21/virah/"><![CDATA[<p>एक भी हाथ सम्भाला न गया,</p>

<p>ओ निर्दय कहाँ है तेरी दया।</p>]]></content><author><name>Ayush Dhar Dubey</name></author><category term="kavita" /><summary type="html"><![CDATA[एक भी हाथ सम्भाला न गया,]]></summary></entry></feed>