<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Vijay Pagare</title><link>https://www.vijaypagare.in/</link><description>Recent content on Vijay Pagare</description><generator>Hugo</generator><language>en-US</language><atom:link href="https://www.vijaypagare.in/index.xml" rel="self" type="application/rss+xml"/><item><title>Critical Rendering Path: The Foundation of Web Performance [Part 1]</title><link>https://www.vijaypagare.in/blog/critical-rendering-path-foundations/</link><pubDate>Fri, 31 Jul 2026 00:00:00 +0000</pubDate><guid>https://www.vijaypagare.in/blog/critical-rendering-path-foundations/</guid><description>&lt;blockquote>
&lt;p>Note: Handcrafted article&lt;/p>&lt;/blockquote>
&lt;p>Most frontend performance problems arise due to lack of understanding of how the browser renders a page. When you deeply understand this process, you stop guessing what’s going wrong? You know why a page is slow, which part of the rendering pipeline is expensive, and which optimisation will actually make a difference.&lt;/p>
&lt;p>I&amp;rsquo;ve spent a fair amount of time debugging slow pages, improving Core Web Vitals, and chasing Lighthouse regressions. Almost every issue eventually led back to one thing: the browser&amp;rsquo;s rendering pipeline.&lt;/p></description></item><item><title>DSA - 3 new - DP, Hashmap</title><link>https://www.vijaypagare.in/diary/2026-04-28-dp-houserobber-decode-ways-duplicate/</link><pubDate>Tue, 28 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.vijaypagare.in/diary/2026-04-28-dp-houserobber-decode-ways-duplicate/</guid><description>&lt;hr>
&lt;h3 id="213-house-robber-ii">213. House Robber II&lt;/h3>
&lt;p>Insight: Same as House Robber (iterative DP). Since first &amp;amp; last are adjacent, split into 2 cases:&lt;/p>
&lt;ul>
&lt;li>Rob from index 0 → n-2&lt;/li>
&lt;li>Rob from index 1 → n-1&lt;br>
Take max of both.&lt;/li>
&lt;/ul>
&lt;p>Comment: Brain fog. Couldn&amp;rsquo;t even recall/formulate base House Robber logic.&lt;/p>
&lt;hr>
&lt;h3 id="217-contains-duplicate">217. Contains Duplicate&lt;/h3>
&lt;p>Insight:&lt;/p>
&lt;ol>
&lt;li>Convert to Set → if size reduces → duplicate exists&lt;/li>
&lt;li>Use HashMap → check while inserting&lt;/li>
&lt;/ol>
&lt;p>Comment: Straightforward. Can do in O(n) using set/hash.&lt;/p></description></item><item><title>DSA - 1 new - Word Search II</title><link>https://www.vijaypagare.in/diary/dsa-1-new-word-search-ii/</link><pubDate>Sat, 25 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.vijaypagare.in/diary/dsa-1-new-word-search-ii/</guid><description>&lt;hr>
&lt;h2 id="todays-diary">Today’s Diary&lt;/h2>
&lt;p>&lt;strong>212. Word Search II&lt;/strong>&lt;/p>
&lt;p>&lt;strong>Insight:&lt;/strong>&lt;br>
Store all words in a Trie. Run DFS from each cell. Prune early using Trie (stop if prefix not found). Mark visited cells and backtrack properly.&lt;/p>
&lt;p>&lt;strong>Comment:&lt;/strong>&lt;br>
Could think of brute force + DFS. Hit TLE. Trie optimization was the missing piece.&lt;/p>
&lt;hr>
&lt;p>Couldn&amp;rsquo;t do much, due to guests at home.&lt;/p></description></item><item><title>DSA - 2 Problems - Counting Bits, Trie Design</title><link>https://www.vijaypagare.in/diary/2026-04-24-counting-bits-trie-design/</link><pubDate>Fri, 24 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.vijaypagare.in/diary/2026-04-24-counting-bits-trie-design/</guid><description>&lt;hr>
&lt;h2 id="338-counting-bits">338. Counting Bits&lt;/h2>
&lt;p>&lt;strong>Insight&lt;/strong>: For each i, use bit manipulation — check last bit using &amp;amp;, right shift &amp;raquo;, increment count. Can be written in one line. Use memoization to avoid repeated calculations.&lt;/p>
&lt;p>&lt;strong>Comment&lt;/strong>: Thought of 2 solutions — bit manipulation and JS inbuilt (string conversion).&lt;/p>
&lt;hr>
&lt;h2 id="221-design-add-and-search-words-data-structure">221. Design Add and Search Words Data Structure&lt;/h2>
&lt;p>&lt;strong>Insight&lt;/strong>: Standard Trie. For &amp;lsquo;.&amp;rsquo;, assume any char → DFS + backtracking.&lt;/p>
&lt;p>&lt;strong>Comment&lt;/strong>: Logic was clear, almost solved. Hesitated on implementing &amp;lsquo;.&amp;rsquo; DFS (passing root vs node), though idea was there.&lt;/p></description></item><item><title>DSA - 2 new (Course Schedule + Implement Trie)</title><link>https://www.vijaypagare.in/diary/2026-04-23-course-schedule-trie/</link><pubDate>Thu, 23 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.vijaypagare.in/diary/2026-04-23-course-schedule-trie/</guid><description>&lt;hr>
&lt;h3 id="207-course-schedule">207. Course Schedule&lt;/h3>
&lt;p>&lt;strong>Insight&lt;/strong>: Standard DFS/Topo sort, ensure no cycles, handle disconnected graph.&lt;/p>
&lt;p>&lt;strong>Comment&lt;/strong>: Logic was there, fumbled with cycle detection + DFS true/false meaning, missed disconnected graph case.&lt;/p>
&lt;h3 id="208-implement-trie">208. Implement Trie&lt;/h3>
&lt;p>&lt;strong>Insight&lt;/strong>: Have a TrieNode with children (map/object) + endOfWord boolean properties. Implement insert, search, startsWith by traversing each char.&lt;/p>
&lt;p>&lt;strong>Comment&lt;/strong>: Learnt how to implement Trie. (Was exciting, fun, and easy.)&lt;/p>
&lt;hr>
&lt;p>&lt;strong>Revised 3 problems&lt;/strong> - Maximum subarray; Minimum window substring; minimum of the rotated sorted array; and went through the theory/solution of valid graph tree.&lt;/p></description></item><item><title>DSA - 1 new - Word Search (DFS + Backtracking)</title><link>https://www.vijaypagare.in/diary/2026-04-22-word-search-dfs-backtracking/</link><pubDate>Wed, 22 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.vijaypagare.in/diary/2026-04-22-word-search-dfs-backtracking/</guid><description>&lt;hr>
&lt;h2 id="79-word-search">79. Word Search&lt;/h2>
&lt;p>Grid traversal + backtracking problem.&lt;/p>
&lt;h3 id="insight">Insight&lt;/h3>
&lt;ul>
&lt;li>Traverse the matrix using &lt;strong>DFS&lt;/strong>.&lt;/li>
&lt;li>At each cell:
&lt;ul>
&lt;li>Match current character.&lt;/li>
&lt;li>Explore all 4 directions (up, down, left, right).&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Use backtracking to revert state after exploring paths.&lt;/li>
&lt;li>Key Optimization: Instead of maintaining a separate &lt;code>visited&lt;/code> matrix:
&lt;ul>
&lt;li>Mark the current cell as &lt;code>'#'&lt;/code> (visited).&lt;/li>
&lt;li>Restore it after DFS call (backtrack).
This reduces extra space and keeps logic tight.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;p>⚡ JS Refreshers&lt;/p>
&lt;ul>
&lt;li>Strings are immutable → cannot modify in-place.&lt;/li>
&lt;li>splice() works only on arrays, not strings.&lt;/li>
&lt;li>Know CRUD operations by heart on these structures: Map, Set, Object, Array&lt;/li>
&lt;/ul></description></item><item><title>DSA - 2 new (sliding window, linked list)</title><link>https://www.vijaypagare.in/diary/2026-04-21-minimum-window-substring-reverse-linked-list/</link><pubDate>Tue, 21 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.vijaypagare.in/diary/2026-04-21-minimum-window-substring-reverse-linked-list/</guid><description>&lt;h2 id="-todays-problems">🧠 Today’s Problems&lt;/h2>
&lt;h3 id="76-minimum-window-substring">76. Minimum Window Substring&lt;/h3>
&lt;p>&lt;strong>Insight:&lt;/strong>&lt;br>
Use a hashmap to track the frequency of characters in &lt;code>t&lt;/code>. Expand the window until all required characters are covered. Once valid, try shrinking the window from the left to find the minimum substring.&lt;/p>
&lt;p>Key ideas:&lt;/p>
&lt;ul>
&lt;li>Maintain a frequency map of &lt;code>t&lt;/code>&lt;/li>
&lt;li>Use a counter to track how many characters are still needed&lt;/li>
&lt;li>Expand right pointer to satisfy condition&lt;/li>
&lt;li>Once valid → shrink from left as much as possible&lt;/li>
&lt;li>Handle edge cases where extra valid characters exist&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Important Learning:&lt;/strong>&lt;br>
When encountering extra characters beyond required frequency, they should NOT affect the valid count. This means:&lt;/p></description></item><item><title>DSA - 2 New, 2 revision (DFS, HashMap, Greedy)</title><link>https://www.vijaypagare.in/diary/2026-04-20-number-of-islands-set-matrix-zeroes-jump-game-anagrams/</link><pubDate>Mon, 20 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.vijaypagare.in/diary/2026-04-20-number-of-islands-set-matrix-zeroes-jump-game-anagrams/</guid><description>&lt;hr>
&lt;h2 id="2-new-problems">2 New Problems&lt;/h2>
&lt;h3 id="200-number-of-islands">200. Number of Islands&lt;/h3>
&lt;p>&lt;strong>Insight:&lt;/strong> Traverse the grid; whenever a cell is land, increment the island count and sink all connected land using DFS (or BFS).&lt;/p>
&lt;p>&lt;strong>Comment:&lt;/strong> Knew the core idea, but fumbled deciding where exactly to increment the island count (before vs after traversal).&lt;/p>
&lt;h3 id="73-set-matrix-zeroes">73. Set Matrix Zeroes&lt;/h3>
&lt;p>&lt;strong>Insight:&lt;/strong> Identify rows and columns that need to be zeroed, then update them. Basic solution uses O(m × n) space. Optimized solution uses the first row and column as markers to achieve O(1) space.&lt;/p></description></item><item><title>DSA - 1 new - House Robber (DP)</title><link>https://www.vijaypagare.in/diary/2026-04-19-house-robber-dp-take-skip/</link><pubDate>Sun, 19 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.vijaypagare.in/diary/2026-04-19-house-robber-dp-take-skip/</guid><description>&lt;hr>
&lt;h2 id="-problem-198-house-robber">🧠 Problem: 198. House Robber&lt;/h2>
&lt;h3 id="-insight">💡 Insight&lt;/h3>
&lt;p>Either:&lt;/p>
&lt;ul>
&lt;li>Select current house → move to &lt;code>i + 2&lt;/code>&lt;/li>
&lt;li>Skip current house → move to &lt;code>i + 1&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>Take the maximum of both choices.&lt;/p>
&lt;p>Recurrence:
dp[i] = max(nums[i] + dp[i+2], dp[i+1])&lt;/p>
&lt;hr>
&lt;h3 id="-comment">🧩 Comment&lt;/h3>
&lt;p>Had to think harder than expected. Derived using recursion + memoization, but initially missed the &lt;strong>skip case edge condition&lt;/strong>, so the formulation wasn’t clean at first.&lt;/p>
&lt;hr>
&lt;h3 id="-key-learning">⚡ Key Learning&lt;/h3>
&lt;p>Whenever:&lt;/p></description></item><item><title>DSA - 1 new - climbing stairs (DP)</title><link>https://www.vijaypagare.in/diary/2026-04-18-climbing-stairs-fibonacci-dp-pattern/</link><pubDate>Sat, 18 Apr 2026 09:46:24 +0530</pubDate><guid>https://www.vijaypagare.in/diary/2026-04-18-climbing-stairs-fibonacci-dp-pattern/</guid><description>&lt;hr>
&lt;h2 id="70-climbing-stairs--dp-fibonacci-pattern">70. Climbing Stairs — DP (Fibonacci pattern)&lt;/h2>
&lt;p>&lt;strong>Insight&lt;/strong> — Problem follows Fibonacci recurrence; solve via recursion + memoization (store intermediate states in hashmap)&lt;/p>
&lt;p>&lt;strong>Comment&lt;/strong> — Recognized pattern only after manually enumerating paths; without that, the recurrence wasn’t obvious&lt;/p>
&lt;h3 id="note">Note&lt;/h3>
&lt;p>Whenever you see a problem where:&lt;/p>
&lt;ul>
&lt;li>You are moving toward a target&lt;/li>
&lt;li>Your move choices are fixed constants (e.g., 1, 2, 5)&lt;/li>
&lt;li>The order of moves matters&lt;/li>
&lt;/ul>
&lt;p>→ It almost always reduces to a linear recurrence relation (Fibonacci-like DP)&lt;/p></description></item><item><title>Memory Caching 101</title><link>https://www.vijaypagare.in/blog/memory-caching-101/</link><pubDate>Fri, 17 Apr 2026 21:05:00 +0530</pubDate><guid>https://www.vijaypagare.in/blog/memory-caching-101/</guid><description>&lt;hr>
&lt;blockquote>
&lt;p>Note: Co-written with AI • Edited by Vijay&lt;/p>&lt;/blockquote>
&lt;h2 id="what-is-caching">What is Caching?&lt;/h2>
&lt;p>Caching is the practice of storing data in temporary storage to enable faster access.&lt;/p>
&lt;p>At a systems level, the speed difference is massive:&lt;/p>
&lt;ul>
&lt;li>Hard disk access: ~1 ms&lt;/li>
&lt;li>Memory (RAM) access: ~100 ns&lt;/li>
&lt;/ul>
&lt;p>That’s roughly &lt;strong>10,000x faster&lt;/strong>.&lt;/p>
&lt;p>The entire idea of caching is to avoid expensive operations (disk, DB, network, computation) by serving precomputed or previously fetched data.&lt;/p></description></item><item><title>DSA - 2 new (DP Formulation, Union-Find Revisit)</title><link>https://www.vijaypagare.in/diary/2026-04-17-coin-change-union-find/</link><pubDate>Fri, 17 Apr 2026 20:55:26 +0530</pubDate><guid>https://www.vijaypagare.in/diary/2026-04-17-coin-change-union-find/</guid><description>&lt;hr>
&lt;h2 id="322-coin-change">322. Coin Change&lt;/h2>
&lt;p>&lt;strong>Insight&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>dp[amount] = minimum coins needed;&lt;/li>
&lt;li>base case dp[0] = 0;&lt;/li>
&lt;li>transition: dp[a] = min(dp[a], 1 + dp[a - coin]) for all coins;&lt;/li>
&lt;li>solved via bottom-up DP (iterative state build, not actual BFS).&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Comment&lt;/strong>: Could brute force some cases using backtracking + greedy, but optimal DP formulation wasn’t immediate. Need stronger instinct for defining dp state and transitions.&lt;/p>
&lt;h2 id="323-number-of-connected-components-in-undirected-graph">323. Number of Connected Components in Undirected Graph&lt;/h2>
&lt;p>&lt;strong>Insight&lt;/strong>: Union-Find: union edges, then count unique roots using find (with path compression); ensure isolated nodes are counted as separate components.&lt;/p></description></item><item><title>DSA - 2 new (Bit Manipulation Fundamentals)</title><link>https://www.vijaypagare.in/diary/dsa-2-new-bit-manipulation-fundamentals/</link><pubDate>Thu, 16 Apr 2026 21:30:00 +0530</pubDate><guid>https://www.vijaypagare.in/diary/dsa-2-new-bit-manipulation-fundamentals/</guid><description>&lt;hr>
&lt;h3 id="190-reverse-bits">190. Reverse Bits&lt;/h3>
&lt;p>&lt;strong>Insight&lt;/strong>: Requires strong understanding of bitwise operators and shifts; iterate through 32 bits, extract last bit using AND, shift result left, and append&lt;/p>
&lt;p>&lt;strong>Comment&lt;/strong>: Couldn’t solve independently; highlighted a gap in bit manipulation fluency, especially combining shifts and bit extraction correctly&lt;/p>
&lt;h3 id="191-number-of-1-bits">191. Number of 1 Bits&lt;/h3>
&lt;p>&lt;strong>Insight&lt;/strong>: Check last bit using AND with 1, increment count if set, then right shift to process remaining bits&lt;/p>
&lt;p>&lt;strong>Comment&lt;/strong>:
After revising bitwise fundamentals, was able to solve comfortably.&lt;/p></description></item><item><title>DSA - 2 new (DFS Pattern, Recursion to DP Insight)</title><link>https://www.vijaypagare.in/diary/dsa-2-new-dfs-pattern-recursion-to-dp-insight/</link><pubDate>Wed, 15 Apr 2026 20:55:26 +0530</pubDate><guid>https://www.vijaypagare.in/diary/dsa-2-new-dfs-pattern-recursion-to-dp-insight/</guid><description>&lt;hr>
&lt;h2 id="572-subtree-of-another-tree">572. Subtree of Another Tree&lt;/h2>
&lt;p>&lt;strong>Insight&lt;/strong> — DFS (preorder) serialization: if subRoot traversal string is a substring of root traversal string, then it is a subtree (ensure null markers like &amp;ldquo;N&amp;rdquo; + delimiters for exact match).&lt;/p>
&lt;p>&lt;strong>Comment&lt;/strong> - Could solve. Core idea understood, but implementation still not smooth. Edge cases and clean serialization need more practice.&lt;/p>
&lt;h2 id="62-unique-paths">62. Unique Paths&lt;/h2>
&lt;p>&lt;strong>Insight&lt;/strong> — brute force = DFS on grid (only right &amp;amp; down), total paths = paths(right) + paths(down); then optimise using DP (memoization / tabulation)&lt;/p></description></item><item><title>Big-O Calculations</title><link>https://www.vijaypagare.in/blog/big-o-calculations/</link><pubDate>Wed, 15 Apr 2026 00:00:00 +0000</pubDate><guid>https://www.vijaypagare.in/blog/big-o-calculations/</guid><description>&lt;blockquote>
&lt;p>Note: Co-written with AI • Edited by Vijay&lt;/p>&lt;/blockquote>
&lt;p>Coming up with the brute-force time complexity of an algorithm is about identifying the &lt;strong>worst-case scenario&lt;/strong> by counting the total number of operations the computer must perform to reach a solution.&lt;/p>
&lt;p>Think of brute force as the &amp;ldquo;exhaustive&amp;rdquo; approach—it tries every single possibility until it finds the answer. To calculate its complexity, you generally follow these three steps:&lt;/p>
&lt;hr>
&lt;h2 id="1-identify-the-input-size-n">1. Identify the Input Size ($n$)&lt;/h2>
&lt;p>First, define what $n$ represents. In most cases:&lt;/p></description></item><item><title>For vs. While: Choosing Your Weapon in DSA</title><link>https://www.vijaypagare.in/blog/for-vs-while-loop/</link><pubDate>Tue, 14 Apr 2026 22:58:45 +0530</pubDate><guid>https://www.vijaypagare.in/blog/for-vs-while-loop/</guid><description>&lt;blockquote>
&lt;p>Note: Co-written with AI • Edited by Vijay&lt;/p>&lt;/blockquote>
&lt;p>In Data Structures and Algorithms (DSA), the choice between a &lt;code>for&lt;/code> loop and a &lt;code>while&lt;/code> loop isn&amp;rsquo;t just about syntax—it’s about &lt;strong>intent&lt;/strong>. While both can often achieve the same result, choosing the wrong one can lead to &amp;ldquo;logic friction,&amp;rdquo; forcing you to use messy boolean flags and complex &lt;code>if-else&lt;/code> trees.&lt;/p>
&lt;h2 id="the-fundamental-distinction">The Fundamental Distinction&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>&lt;code>for&lt;/code> loops are for Iterating:&lt;/strong> You use them when you want to visit every element in a collection uniformly. The index moves automatically, and the logic applied to the first element is usually the same logic applied to the last.&lt;/li>
&lt;li>&lt;strong>&lt;code>while&lt;/code> loops are for Consuming:&lt;/strong> You use them when the data needs to be processed in &lt;strong>phases&lt;/strong> or &lt;strong>variable chunks&lt;/strong>. You control exactly when the pointer moves, allowing you to &amp;ldquo;stay&amp;rdquo; on an index until a certain condition is satisfied.&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="when-to-use-while-the-consumption-model">When to use &lt;code>while&lt;/code> (The &amp;ldquo;Consumption&amp;rdquo; Model)&lt;/h2>
&lt;p>In many DSA problems, specifically &lt;strong>Intervals&lt;/strong>, &lt;strong>Two-Pointer&lt;/strong>, and &lt;strong>Sliding Window&lt;/strong>, the &lt;code>while&lt;/code> loop is superior because it allows for a &amp;ldquo;Stage-Based&amp;rdquo; architecture.&lt;/p></description></item><item><title>DSA - 2 new (Intervals: Merge &amp; Insert)</title><link>https://www.vijaypagare.in/diary/dsa-2-new-intervals-merge-insert/</link><pubDate>Tue, 14 Apr 2026 22:00:00 +0530</pubDate><guid>https://www.vijaypagare.in/diary/dsa-2-new-intervals-merge-insert/</guid><description>&lt;hr>
&lt;h3 id="new">New&lt;/h3>
&lt;p>&lt;strong>56. Merge Intervals&lt;/strong>&lt;br>
&lt;strong>Insight:&lt;/strong> Optimised approach is to sort intervals by start time, then iterate and merge overlapping intervals by comparing current start with previous end.&lt;br>
&lt;strong>Complexity:&lt;/strong> O(n log n) due to sorting; merging is O(n).&lt;br>
&lt;strong>Comment:&lt;/strong> Initially thought of an O(n²) solution using nested loops and hashing. Midway realised sorting simplifies the problem significantly. Intuition came from previously solved interval patterns. Solved in ~35 minutes.&lt;/p>
&lt;p>&lt;strong>57. Insert Interval&lt;/strong>&lt;br>
&lt;strong>Insight:&lt;/strong> Combination of traversal + interval merging. Need to handle three cases: no overlap (before), overlap (merge), and after insertion.&lt;br>
&lt;strong>Comment:&lt;/strong> Logic was clear conceptually but struggled with implementation and edge cases. Not fluent with array manipulation. Learned that using &lt;code>while&lt;/code> loops could simplify control flow. After hints and reference, able to handle all edge cases.&lt;/p></description></item><item><title>DSA - 1 New, 1 Revision (DP, Greedy, Heaps)</title><link>https://www.vijaypagare.in/diary/dsa-1-new-1-revision-dp-greedy-heaps/</link><pubDate>Mon, 13 Apr 2026 22:30:00 +0530</pubDate><guid>https://www.vijaypagare.in/diary/dsa-1-new-1-revision-dp-greedy-heaps/</guid><description>&lt;hr>
&lt;h3 id="new-problem">New Problem&lt;/h3>
&lt;p>&lt;strong>55. Jump Game&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>
&lt;p>DP (Bottom-up):&lt;/p>
&lt;ul>
&lt;li>Create &lt;code>dp[]&lt;/code>, set &lt;code>dp[last] = true&lt;/code>&lt;/li>
&lt;li>Fill from right to left using reachable indices i.e. &lt;code>dp[i+jumps]&lt;/code>&lt;/li>
&lt;li>Optimization:
&lt;ul>
&lt;li>Without pruning overflow jumps → exponential&lt;/li>
&lt;li>Even optimized DP → O(n²)&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>Greedy - O(n):&lt;/p>
&lt;ul>
&lt;li>Maintain &lt;code>goal = last index&lt;/code>&lt;/li>
&lt;li>Traverse backwards&lt;/li>
&lt;li>If &lt;code>i + nums[i] &amp;gt;= goal&lt;/code> → update &lt;code>goal = i&lt;/code>&lt;/li>
&lt;li>Final check → &lt;code>goal == 0&lt;/code>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;p>Comment:&lt;br>
Initially leaned towards backtracking (decision at each index), but constraints (&lt;code>nums[i]&lt;/code> up to 10^5) made it infeasible. Key learning → recognize when brute force explodes due to branching factor. DP gave structure, but greedy revealed the optimal path.&lt;/p></description></item><item><title>DSA - 1 new (Matrix Simulation)</title><link>https://www.vijaypagare.in/diary/dsa-1-new-matrix-simulation/</link><pubDate>Sun, 12 Apr 2026 11:18:32 +0530</pubDate><guid>https://www.vijaypagare.in/diary/dsa-1-new-matrix-simulation/</guid><description>&lt;hr>
&lt;h2 id="lc-54-spiral-matrix">LC 54. Spiral Matrix&lt;/h2>
&lt;p>&lt;strong>Insight:&lt;/strong> Sometimes the most straightforward approach is the correct one. The problem is best solved by actually simulating the spiral traversal using 4 pointers (top, bottom, left, right) and iterating layer by layer.&lt;/p>
&lt;p>&lt;strong>Key Learning:&lt;/strong> There was an initial hesitation to fully trust the simulation approach — it felt too &amp;ldquo;simple&amp;rdquo; or brute-force. However, this solution is already &lt;strong>asymptotically optimal (O(n × m))&lt;/strong>, which means there is no need to over-optimize further.&lt;/p></description></item><item><title>The Pattern Behind Kadane's Algorithm</title><link>https://www.vijaypagare.in/blog/kadanes-algorithm-pattern/</link><pubDate>Sun, 12 Apr 2026 00:04:00 +0530</pubDate><guid>https://www.vijaypagare.in/blog/kadanes-algorithm-pattern/</guid><description>&lt;blockquote>
&lt;p>Note: Co-written with AI • Edited by Vijay&lt;/p>&lt;/blockquote>
&lt;p>Kadane’s Algorithm is a classic dynamic programming technique used to find the Maximum Subarray Sum within a one-dimensional array of numbers. It’s famous for its efficiency, turning what could be a brute-force $O(N^2)$ problem into a sleek $O(N)$ linear scan.&lt;/p>
&lt;hr>
&lt;h2 id="1-what-is-kadanes-algorithm">1. What is Kadane’s Algorithm?&lt;/h2>
&lt;p>The algorithm iterates through an array, keeping track of the maximum sum ending at the current position. It makes a simple choice at every element:&lt;/p></description></item><item><title>DSA - 2 new, 1 revision (Greedy, Kadane, Linked List)</title><link>https://www.vijaypagare.in/diary/dsa-2-new-1-revision-greedy-kadane-linked-list/</link><pubDate>Sat, 11 Apr 2026 23:24:56 +0530</pubDate><guid>https://www.vijaypagare.in/diary/dsa-2-new-1-revision-greedy-kadane-linked-list/</guid><description>&lt;h3 id="new-problems">New Problems&lt;/h3>
&lt;p>&lt;strong>435. Non-overlapping Intervals&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Concept:&lt;/strong> Greedy&lt;/li>
&lt;li>&lt;strong>Insight:&lt;/strong>&lt;br>
Sort intervals based on start. Iterate and compare adjacent intervals while maintaining &lt;code>prevEnd&lt;/code>.
&lt;ul>
&lt;li>If no overlap → update &lt;code>prevEnd&lt;/code>&lt;/li>
&lt;li>If overlap → increment count and update &lt;code>prevEnd = min(prevEnd, currEnd)&lt;/code>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;strong>Comment:&lt;/strong>&lt;br>
Solved partial conditions independently. Needed a hint to unlock the core greedy idea, then implemented successfully.&lt;/li>
&lt;/ul>
&lt;hr>
&lt;p>&lt;strong>53. Maximum Subarray&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Concept:&lt;/strong> Kadane’s Algorithm&lt;/li>
&lt;li>&lt;strong>Insight:&lt;/strong>&lt;br>
At each step, track max of:
&lt;ul>
&lt;li>current element&lt;/li>
&lt;li>sum till now + current&lt;br>
Maintain a global maximum.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;strong>Comment:&lt;/strong>&lt;br>
Recognized the pattern after hint. Execution was straightforward once direction was clear.&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h3 id="revision">Revision&lt;/h3>
&lt;p>&lt;strong>23. Merge K Sorted Lists&lt;/strong>&lt;/p></description></item><item><title>DSA - 1 new, 2 revision (Hashing, Linked List, Strings)</title><link>https://www.vijaypagare.in/diary/dsa-1-new-2-revision-hashing-linked-list-strings/</link><pubDate>Fri, 10 Apr 2026 21:00:00 +0530</pubDate><guid>https://www.vijaypagare.in/diary/dsa-1-new-2-revision-hashing-linked-list-strings/</guid><description>&lt;h3 id="-todays-progress">📌 Today’s Progress&lt;/h3>
&lt;p>&lt;strong>1 New • 2 Revisions&lt;/strong>&lt;/p>
&lt;hr>
&lt;h3 id="new-problem">New Problem&lt;/h3>
&lt;p>&lt;strong>49. Group Anagrams&lt;/strong>&lt;br>
&lt;strong>Insight:&lt;/strong> Sort characters of each word and use it as a key in a hashmap to group anagrams.&lt;br>
&lt;strong>Comment:&lt;/strong> Easy overall, but needed a hint to recall the sorting trick.&lt;/p>
&lt;p>&lt;strong>Observation (JS Quirk):&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;code>arr.sort()&lt;/code> sorts alphabetically (case-sensitive) by default&lt;/li>
&lt;li>For numbers → &lt;code>(a, b) =&amp;gt; a - b&lt;/code> works&lt;/li>
&lt;li>For alphabets → direct sort works, comparator logic differs&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h3 id="revisions">Revisions&lt;/h3>
&lt;p>&lt;strong>21. Merge Two Sorted Lists&lt;/strong>&lt;br>
&lt;strong>Insight:&lt;/strong>&lt;br>
Used standard linked list template:&lt;/p></description></item><item><title>DSA - 1 new, 3 revision (Matrix, DFS, Sliding Window, Binary Search)</title><link>https://www.vijaypagare.in/diary/dsa-1-new-3-revision-matrix-dfs-sliding-window-binary-search/</link><pubDate>Thu, 09 Apr 2026 20:18:55 +0530</pubDate><guid>https://www.vijaypagare.in/diary/dsa-1-new-3-revision-matrix-dfs-sliding-window-binary-search/</guid><description>&lt;p>Tackled a mix of new challenges and critical revisions, focusing on the philosophy that core patterns—Arrays, Strings, and DFS—must become second nature.&lt;/p>
&lt;hr>
&lt;h3 id="48-rotate-image-medium">48. Rotate Image (Medium)&lt;/h3>
&lt;h4 id="approach">Approach&lt;/h4>
&lt;ol>
&lt;li>&lt;strong>Transpose matrix&lt;/strong> → swap &lt;code>(i, j)&lt;/code> with &lt;code>(j, i)&lt;/code>&lt;/li>
&lt;li>&lt;strong>Reverse each row&lt;/strong>&lt;/li>
&lt;/ol>
&lt;h4 id="reflection">Reflection&lt;/h4>
&lt;ul>
&lt;li>Came up with a &lt;strong>half-baked approach&lt;/strong>&lt;/li>
&lt;li>Missed the &lt;strong>transpose + reverse pattern&lt;/strong>&lt;/li>
&lt;li>Made &lt;strong>silly mistakes&lt;/strong>:
&lt;ul>
&lt;li>Incorrect transpose logic (didn&amp;rsquo;t limit swaps correctly)&lt;/li>
&lt;li>Reverse logic not optimized (can use 2-pointer technique → O(n))&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Need to &lt;strong>slow down and think clearly before coding&lt;/strong>&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="revisions">Revisions&lt;/h2>
&lt;h3 id="297-serialize-and-deserialize-binary-tree-hard">297. Serialize and Deserialize Binary Tree (Hard)&lt;/h3>
&lt;h4 id="approach-1">Approach&lt;/h4>
&lt;ul>
&lt;li>Use &lt;strong>DFS traversal&lt;/strong>&lt;/li>
&lt;li>Serialize:
&lt;ul>
&lt;li>Store values using delimiter &lt;code>&amp;quot;,&amp;quot;&lt;/code>&lt;/li>
&lt;li>Use &lt;code>&amp;quot;N&amp;quot;&lt;/code> for null nodes&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Deserialize:
&lt;ul>
&lt;li>Rebuild using DFS&lt;/li>
&lt;li>Maintain pointer/index across recursion&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h4 id="reflection-1">Reflection&lt;/h4>
&lt;ul>
&lt;li>Solved in &lt;strong>&amp;lt;25 mins&lt;/strong>&lt;/li>
&lt;li>Minor confusion:
&lt;ul>
&lt;li>Pointer increment in deserialization&lt;/li>
&lt;li>Must pass pointer &lt;strong>by reference&lt;/strong>&lt;/li>
&lt;li>Avoid loops; rely purely on DFS flow&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h3 id="3-longest-substring-without-repeating-characters-medium">3. Longest Substring Without Repeating Characters (Medium)&lt;/h3>
&lt;h4 id="approach-2">Approach&lt;/h4>
&lt;ul>
&lt;li>&lt;strong>Sliding Window + Two Pointers&lt;/strong>
&lt;ul>
&lt;li>Expand window when valid&lt;/li>
&lt;li>Shrink when duplicate found&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Use &lt;strong>Set / HashMap&lt;/strong> for tracking characters&lt;/li>
&lt;/ul>
&lt;h4 id="reflection-2">Reflection&lt;/h4>
&lt;ul>
&lt;li>Felt &lt;strong>easy this time&lt;/strong>&lt;/li>
&lt;li>Stayed calm and executed step-by-step&lt;/li>
&lt;li>No unnecessary panic → big improvement&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h3 id="33-search-in-rotated-sorted-array-medium">33. Search in Rotated Sorted Array (Medium)&lt;/h3>
&lt;h4 id="approach-3">Approach&lt;/h4>
&lt;ul>
&lt;li>Modified &lt;strong>Binary Search&lt;/strong>&lt;/li>
&lt;li>Identify &lt;strong>sorted half&lt;/strong> and move accordingly&lt;/li>
&lt;/ul>
&lt;h4 id="reflection-3">Reflection&lt;/h4>
&lt;ul>
&lt;li>Took time to internalize &lt;strong>edge/else cases&lt;/strong>&lt;/li>
&lt;li>Once understood → logic felt clear&lt;/li>
&lt;li>Key idea: &lt;em>always move towards the sorted side&lt;/em>&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="-insights--learnings">🧩 Insights / Learnings&lt;/h2>
&lt;ul>
&lt;li>
&lt;p>Core topics must become &lt;strong>muscle memory&lt;/strong>:&lt;/p></description></item><item><title>DSA: 1 new, 2 revision (DP, Backtracking, Graph)</title><link>https://www.vijaypagare.in/diary/dsa-daily-log-2026-04-08/</link><pubDate>Wed, 08 Apr 2026 21:02:17 +0530</pubDate><guid>https://www.vijaypagare.in/diary/dsa-daily-log-2026-04-08/</guid><description>&lt;p>Today’s session was a mix of one new challenge and two deep-dive revisions. The focus remains on identifying the &amp;ldquo;core pattern&amp;rdquo; rather than just memorizing the syntax.&lt;/p>
&lt;hr>
&lt;h2 id="new-challenge-300-longest-increasing-subsequence">New Challenge: 300. Longest Increasing Subsequence&lt;/h2>
&lt;p>&lt;strong>The Insight:&lt;/strong> The key here is building a &lt;code>dp&lt;/code> array where &lt;code>dp[i]&lt;/code> represents the length of the longest increasing subsequence ending at index &lt;code>i&lt;/code>.&lt;/p>
&lt;p>&lt;strong>The Process:&lt;/strong> To find &lt;code>dp[i]&lt;/code>, we look back at all elements &lt;code>j&lt;/code> (where &lt;code>j &amp;lt; i&lt;/code>). If &lt;code>nums[i] &amp;gt; nums[j]&lt;/code>, then &lt;code>nums[i]&lt;/code> can extend the subsequence ending at &lt;code>j&lt;/code>. The recurrence relation becomes:&lt;br>
&lt;code>dp[i] = max(dp[i], dp[j] + 1)&lt;/code>.&lt;/p></description></item><item><title>Design: Activity Feed</title><link>https://www.vijaypagare.in/diary/design-activity-feed/</link><pubDate>Wed, 08 Apr 2026 20:40:39 +0530</pubDate><guid>https://www.vijaypagare.in/diary/design-activity-feed/</guid><description>&lt;h3 id="the-problem">The Problem&lt;/h3>
&lt;p>In an activity feed (like LinkedIn or Instagram), we need to track which posts a user has already seen.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>The Scale:&lt;/strong> Millions of active users.&lt;/li>
&lt;li>&lt;strong>The Volume:&lt;/strong> Every scroll generates a &amp;ldquo;Seen&amp;rdquo; event. This is a massive write-heavy workload.&lt;/li>
&lt;li>&lt;strong>The Goal:&lt;/strong> Ensure we don&amp;rsquo;t show the same post twice to the same user upon refresh.&lt;/li>
&lt;/ul>
&lt;h3 id="1-the-storage-strategy-the-write-path">1. The Storage Strategy (The Write Path)&lt;/h3>
&lt;p>If we use a traditional SQL database, every &amp;ldquo;seen&amp;rdquo; event requires the DB to find a specific row and update it. This involves &amp;ldquo;Random I/O,&amp;rdquo; which is slow. At 100k+ events per second, a standard relational database will struggle with locking and disk contention.&lt;/p></description></item><item><title>System Design Overview</title><link>https://www.vijaypagare.in/diary/system-design-overview/</link><pubDate>Wed, 08 Apr 2026 20:32:43 +0530</pubDate><guid>https://www.vijaypagare.in/diary/system-design-overview/</guid><description>&lt;p>Shoutout – &lt;a href="https://paperdraw.dev" 
 target="_blank" rel="noopener" >https://paperdraw.dev&lt;/a> (System Design w/ simulations)&lt;/p>
&lt;p>System Design ain&amp;rsquo;t about developing features or writing code, it&amp;rsquo;s about managing trade-offs between speed, reliability, and cost. Below is the &amp;ldquo;index&amp;rdquo; of topics required to navigate top-tier architecture discussions.&lt;/p>
&lt;h2 id="1-the-storage-layer-beyond-crud">1. The Storage Layer: Beyond CRUD&lt;/h2>
&lt;p>Understanding how data is physically stored determines how your system scales.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>B-Trees vs. LSM-Trees:&lt;/strong> The fundamental trade-off between Read-optimization (SQL) and Write-optimization (NoSQL).&lt;/li>
&lt;li>&lt;strong>Storage Paradigms:&lt;/strong> When to use Relational (ACID compliance), Document (flexible schema), Key-Value (low latency), or Graph (complex relationships).&lt;/li>
&lt;/ul>
&lt;h2 id="2-distributed-communication">2. Distributed Communication&lt;/h2>
&lt;p>How services talk to each other defines the user experience and system resilience.&lt;/p></description></item><item><title>DSA: 1 new, 3 revision (Sliding Window, DP, LL, Graph)</title><link>https://www.vijaypagare.in/diary/dsa-daily-log-2026-04-07/</link><pubDate>Tue, 07 Apr 2026 23:38:42 +0530</pubDate><guid>https://www.vijaypagare.in/diary/dsa-daily-log-2026-04-07/</guid><description>&lt;p>Today was about strengthening the foundations and reflecting upon the mastery strategy. While the original plan was two new problems daily, the reality of high-level prep is teaching me that &lt;strong>revision and depth&lt;/strong> often outweigh raw volume.&lt;/p>
&lt;h2 id="-dsa-summary">🧠 DSA Summary&lt;/h2>
&lt;h3 id="1-longest-repeating-character-replacement-lc-424">1. Longest Repeating Character Replacement (LC 424)&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>The Pivot:&lt;/strong> Shifting from a Brute Force approach (checking every possible substring) to a refined &lt;strong>Sliding Window&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>The Insight:&lt;/strong> The window is valid as long as the number of replacements needed doesn&amp;rsquo;t exceed &lt;code>k&lt;/code>.&lt;/li>
&lt;li>&lt;strong>Core Logic:&lt;/strong> &lt;code>Window Length - Max Frequency of a Character &amp;lt;= k&lt;/code>&lt;/li>
&lt;li>&lt;strong>Reflection:&lt;/strong> I managed to hack together a partial solution, but the &amp;ldquo;aha!&amp;rdquo; moment came from maintaining the character count hash to dynamically expand the right pointer and shrink the left. Though an even better solution with keep count of maxFrequency exists.&lt;/li>
&lt;/ul>
&lt;h3 id="2-pacific-atlantic-water-flow-lc-417">2. Pacific Atlantic Water Flow (LC 417)&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>The Insight:&lt;/strong> Treat the 2D matrix as a graph. The key is defining a solid base condition: boundaries + visited sets + the &amp;ldquo;main business logic&amp;rdquo; (water height). Working backward from the oceans often simplifies the flow.&lt;/li>
&lt;/ul>
&lt;h3 id="3-remove-nth-node-from-end-of-list-lc-19">3. Remove Nth Node From End of List (LC 19)&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>The Insight:&lt;/strong> The &amp;ldquo;Two-Pointer Gap&amp;rdquo; strategy. By advancing the first pointer &lt;code>n&lt;/code> steps ahead and then pointing the second to the head, they can hop together. When the first hits the end, the second points exactly to the node that needs removal. &lt;strong>One pass, &lt;code>O(n)&lt;/code> efficiency.&lt;/strong>&lt;/li>
&lt;/ul>
&lt;h3 id="4-maximum-product-subarray-lc-152">4. Maximum Product Subarray (LC 152)&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>The Insight:&lt;/strong> Negative numbers are the wildcards—they can turn a minimum into a maximum instantly.&lt;/li>
&lt;li>&lt;strong>The Fix:&lt;/strong> It is vital to track &lt;strong>both&lt;/strong> the current min and max. When introducing a new element, consider three cases:
&lt;ol>
&lt;li>Starting a new subarray.&lt;/li>
&lt;li>Multiplying with the previous max.&lt;/li>
&lt;li>Multiplying with the previous min.&lt;/li>
&lt;/ol>
&lt;/li>
&lt;li>&lt;strong>Note:&lt;/strong> Encountering a zero resets the running product.&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="-strategy-shift-quality--quantity">🏗️ Strategy Shift: Quality &amp;gt; Quantity&lt;/h2>
&lt;p>I couldn&amp;rsquo;t accommodate a System Design (SD) question today due to time constraints, which sparked a realization about ROI (Return on Investment). Moving forward, I’m adjusting the daily goal:&lt;/p></description></item><item><title>Design: URL Shortener</title><link>https://www.vijaypagare.in/diary/design-url-shortener/</link><pubDate>Mon, 06 Apr 2026 16:27:00 +0530</pubDate><guid>https://www.vijaypagare.in/diary/design-url-shortener/</guid><description>&lt;p>Started learning system design and architecture seriously. I&amp;rsquo;ll be posting daily notes on whatever i learn about the subject going forward. Here&amp;rsquo;s the first one–enjoy!&lt;/p>
&lt;h3 id="1-the-core-base62-encoding">1. The Core: Base62 Encoding&lt;/h3>
&lt;p>To keep URLs short, we use &lt;strong>Base62 encoding&lt;/strong> (&lt;code>[a-z, A-Z, 0-9]&lt;/code>).&lt;/p>
&lt;ul>
&lt;li>A 7-character string gives us &lt;strong>3.5 Trillion combinations&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>Why not Base64?&lt;/strong> Base64 includes &lt;code>+&lt;/code> and &lt;code>/&lt;/code>, which are not URL-safe and can break paths.&lt;/li>
&lt;/ul>
&lt;h3 id="2-the-coordination-problem-key-generation-service-kgs">2. The Coordination Problem: Key Generation Service (KGS)&lt;/h3>
&lt;p>In a distributed system, we must prevent &amp;ldquo;collisions&amp;rdquo; where two servers generate the same ID.&lt;/p></description></item><item><title>Academic AI Fundamentals</title><link>https://www.vijaypagare.in/blog/academic-ai-fundamentals/</link><pubDate>Tue, 16 Sep 2025 01:45:39 +0530</pubDate><guid>https://www.vijaypagare.in/blog/academic-ai-fundamentals/</guid><description>&lt;p>Lord Rama, was doing BFS search until he met Jatayu, then he started DFS.&lt;/p>
 &lt;img src="./images/rama-dfs-bfs.png" alt="Lord Rama and BFS, DFS analogy" />


&lt;div class="callout-container">
 &lt;div class="callout-emoji">&lt;/div>
 &lt;div class="callout-content">Note - This document was created on &lt;a href="https://www.notion.so/pagarevijayy/Notes-AI-Fundamentals-26f41fc193de80f0b2bddc69f32573a1?source=copy_link" 
 target="_blank" rel="noopener" >notion&lt;/a>. It looks more readable there.&lt;/div>
&lt;/div>
&lt;h2 id="search-methods-for-problem-solving">Search Methods for Problem Solving.&lt;/h2>
&lt;h4 id="state-space-search">State space search&lt;/h4>
&lt;ul>
&lt;li>should be precise&lt;/li>
&lt;li>be able to analyse&lt;/li>
&lt;li>&lt;code>S = { S, A, Action(s), Result(s,a), Cost(s,a) }&lt;/code>&lt;/li>
&lt;/ul>
&lt;h4 id="search-types-uninformed-blind-brute-force-and-informed-heuristic">Search Types: Uninformed (blind, brute force) and Informed (heuristic)&lt;/h4>
&lt;table>
 &lt;tr>
 &lt;td>&lt;b>Uninformed&lt;/b>&lt;/td>
 &lt;td>&lt;b>Informed&lt;/b>&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>search without information&lt;/td>
 &lt;td>search with information&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>no knowledge&lt;/td>
 &lt;td>use knowledge to find steps to solution&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>time consuming&lt;/td>
 &lt;td>quicker solution&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>more complexity (time, space)&lt;/td>
 &lt;td>less complexity (time, space)&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>DFS, BFS&lt;/td>
 &lt;td>A*, Heuristic DFS, Best first search&lt;/td>
 &lt;/tr>
&lt;/table>
&lt;h4 id="bfs---uninformed---breadth-first-search">BFS - uninformed - breadth first search&lt;/h4>
&lt;ul>
&lt;li>uninformed search technique&lt;/li>
&lt;li>FIFO (queue)&lt;/li>
&lt;li>Shallowest node&lt;/li>
&lt;li>complete (means it will provide the answer)&lt;/li>
&lt;li>optimal (shortest result/cost)&lt;/li>
&lt;li>time complexity = O(V + E) in Data Structures; in &lt;code>AI → O(b^d)&lt;/code> where b: branch factor and d: depth (of tree)&lt;/li>
&lt;li>example: tree&lt;/li>
&lt;/ul>
&lt;h4 id="dfs---uninformed---depth-first-search">DFS - uninformed - depth first search&lt;/h4>
&lt;ul>
&lt;li>uninformed search technique&lt;/li>
&lt;li>stack (LIFO)&lt;/li>
&lt;li>deepest node&lt;/li>
&lt;li>incomplete (possible that dfs doesn’t give a solution gets stuck in a loop or infinite search space)&lt;/li>
&lt;li>non-optimal ()&lt;/li>
&lt;li>time complexity = O(V+E); in &lt;code>AI → O (b^d)&lt;/code>; b: branching factor, d: depth&lt;/li>
&lt;li>space complexity = O(b*d)&lt;/li>
&lt;li>example: &lt;a href="https://www.youtube.com/watch?v=f8luGFRtshY&amp;amp;list=PLAXUYU7PbJhhg1jaU2gasFmh4FlMXvq-P&amp;amp;index=4" 
 target="_blank" rel="noopener" >tree&lt;/a>&lt;/li>
&lt;/ul>
&lt;h4 id="dfs-family---depth-bounded-iterative-deepening">DFS family - Depth Bounded, Iterative Deepening&lt;/h4>
&lt;table>
 &lt;tbody>
 &lt;tr>
 &lt;td>&lt;b>Depth-Limited Search (DLS)&lt;/b>&lt;/td>
 &lt;td>&lt;b>Iterative Deepening Depth-First Search (IDDFS)&lt;/b>&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Depth is fixed — search is restricted to a certain depth so that it doesn’t encounter a loop or go into infinitely deep space.&lt;/td>
 &lt;td>Iteratively first checks for depth 1, then 2, then 3, and so on... till the goal is found.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;b>Completeness:&lt;/b> NO (if the solution is beyond the depth limit)&lt;/td>
 &lt;td>&lt;b>Completeness:&lt;/b> YES (if the branching factor 'b' is finite)&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;b>Optimality:&lt;/b> NO (it might find a non-optimal solution if a solution exists at a shallower depth but is not explored due to the limit)&lt;/td>
 &lt;td>&lt;b>Optimality:&lt;/b> YES (it is guaranteed to find the shallowest goal)&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;b>Time Complexity:&lt;/b> $O(b^l)$ where 'l' is the depth limit.&lt;/td>
 &lt;td>&lt;b>Time Complexity:&lt;/b> $O(b^d)$ where 'd' is the depth of the shallowest solution. (This is asymptotically equivalent to BFS and DFS for large d)&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>&lt;b>Space Complexity:&lt;/b> $O(bl)$ where 'l' is the depth limit. (Same as DFS)&lt;/td>
 &lt;td>&lt;b>Space Complexity:&lt;/b> $O(bd)$ where 'd' is the depth of the shallowest solution. (Same as DFS)&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;h4 id="bidirectional-search-extension-of-bfs-dfs">Bidirectional search (extension of BFS, DFS)&lt;/h4>
&lt;ul>
&lt;li>Two simultaneous searches - from initial to goal &amp;amp; from goal to initial, stops when two meets.&lt;/li>
&lt;li>time &lt;a href="https://www.youtube.com/watch?v=rEema9uQ02c&amp;amp;list=PLAXUYU7PbJhhg1jaU2gasFmh4FlMXvq-P&amp;amp;index=6" 
 target="_blank" rel="noopener" >complexity&lt;/a> = O(2* b^d/2)&lt;/li>
&lt;li>complete in BFS, not complete in DFS&lt;/li>
&lt;/ul>
&lt;h4 id="heuristics---informed-search">Heuristics - Informed search&lt;/h4>
&lt;ul>
&lt;li>Used to solve a problem quickly&lt;/li>
&lt;li>For solving non-polynomial problem (i.e. the ones having exponential complexity) in polynomial times.&lt;/li>
&lt;li>a good enough solution will be reached (may not be the optimal)&lt;/li>
&lt;li>&lt;a href="https://www.youtube.com/watch?v=5F9YzkpnaRw&amp;amp;list=PLAXUYU7PbJhhg1jaU2gasFmh4FlMXvq-P&amp;amp;index=7" 
 target="_blank" rel="noopener" >Technique&lt;/a>:
&lt;ul>
&lt;li>eucledian distance&lt;/li>
&lt;li>manhatten distance or no. of misplaced tiles (8 puzzle problem - complexity O(3^20))&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h4 id="greedy-best-first-search">Greedy best first search&lt;/h4>
&lt;ul>
&lt;li>Combines BFS and DFS to form best first search&lt;/li>
&lt;li>use of heuristic&lt;/li>
&lt;li>admissibility: h(n) ≤ h*(n) i.e. h(n) should always be less than or equal to actual cost. (heuristic function should not over estimate.)&lt;/li>
&lt;li>if f(n) = h(n) → optimal solution. (i.e. actual cost = heuristic function); sometimes the solution can be optimal even if actual cost is greater. [&lt;a href="https://www.youtube.com/watch?v=O9Bp5O2aeu0&amp;amp;list=PLAXUYU7PbJhhg1jaU2gasFmh4FlMXvq-P&amp;amp;index=8" 
 target="_blank" rel="noopener" >but actual cost cant be less&lt;/a>]&lt;/li>
&lt;li>completeness - NO, optimality - NO&lt;/li>
&lt;li>time and space complexity = O(b^m)&lt;/li>
&lt;/ul>
&lt;h4 id="a---informed-search">A* - informed search&lt;/h4>
&lt;ul>
&lt;li>&lt;code>f(n) = g(n) + h(n)&lt;/code> where g(n) is actual cost from start node to n; h(n) is estimation cost from n to goal node.&lt;/li>
&lt;li>Example - &lt;a href="https://www.youtube.com/watch?v=tvAh0JZF2YE&amp;amp;list=PLAXUYU7PbJhhg1jaU2gasFmh4FlMXvq-P&amp;amp;index=10" 
 target="_blank" rel="noopener" >directed graph&lt;/a>&lt;/li>
&lt;li>optimal&lt;/li>
&lt;li>time and space complexity = O(b^d)&lt;/li>
&lt;/ul>
&lt;h4 id="a-admissibility---underestimate-overestimate">A* admissibility - underestimate, overestimate&lt;/h4>
&lt;ul>
&lt;li>h(n) ≤ h*(n) → &lt;strong>underestimation [ optimal solution ]&lt;/strong>
&lt;ul>
&lt;li>h(n) is heuristic value and h*(n) is the actual/optimal value&lt;/li>
&lt;li>we always get optimal solution in case of &lt;em>underestimation&lt;/em>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>h(n) ≥ h*(n) → &lt;strong>overestimation&lt;/strong> (may not be the optimal)&lt;/li>
&lt;li>&lt;a href="https://www.youtube.com/watch?v=xz1Nq6cZejI&amp;amp;list=PLxCzCOWd7aiHGhOHV-nwb0HR5US5GFKFI&amp;amp;index=21" 
 target="_blank" rel="noopener" >example&lt;/a>&lt;/li>
&lt;/ul>
&lt;h4 id="hill-climbing---local-search-algorithm">Hill climbing - Local search algorithm&lt;/h4>
&lt;ul>
&lt;li>Local search algorithm, &lt;a href="https://www.youtube.com/watch?v=3SiWtAnUROs&amp;amp;list=PLAXUYU7PbJhhg1jaU2gasFmh4FlMXvq-P&amp;amp;index=9" 
 target="_blank" rel="noopener" >no backtracking&lt;/a>&lt;/li>
&lt;li>Algorithm:
&lt;ol>
&lt;li>Evaluate initial state&lt;/li>
&lt;li>Loop until a solution is found or there are no operators left
&lt;ol>
&lt;li>select and apply a new operator&lt;/li>
&lt;li>evaluate the new state&lt;/li>
&lt;li>if goal then quit&lt;/li>
&lt;li>if better than current state then it is new current state&lt;/li>
&lt;/ol>
&lt;/li>
&lt;/ol>
&lt;/li>
&lt;li>Problems: local maxima, plateau/flat maxima, ridge&lt;/li>
&lt;li>Good for a few problems.&lt;/li>
&lt;li>Better space complexity&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>tbd:&lt;/strong>&lt;/p></description></item><item><title>Vim Cheatsheet</title><link>https://www.vijaypagare.in/blog/vim-bindings/</link><pubDate>Thu, 28 Aug 2025 02:23:09 +0530</pubDate><guid>https://www.vijaypagare.in/blog/vim-bindings/</guid><description>&lt;img src="https://jasonmurray.org/images/vscodevimbindings.png">
&lt;h4 id="personal-vim-cheat-sheet">Personal vim cheat sheet&lt;/h4>
&lt;blockquote>
&lt;p>impt: command + count + motion&lt;/p>&lt;/blockquote>
&lt;h3 id="motions">&lt;strong>Motions&lt;/strong>&lt;/h3>


&lt;div class="callout-container">
 &lt;div class="callout-emoji">&lt;/div>
 &lt;div class="callout-content">&lt;p>&amp;ndash; h,j,k,l&lt;/p>
&lt;p>&amp;ndash; w: word start (&amp;hellip;W)&lt;br>
&amp;ndash; e: word end (&amp;hellip;E)&lt;br>
&amp;ndash; b: backwards word (&amp;hellip;B)&lt;br>
&amp;ndash; ge: end of previous word&lt;/p>
&lt;p>&amp;ndash; gg: page top&lt;br>
&amp;ndash; G: page bottom&lt;/p>
&lt;p>&amp;ndash; 0: beginning of the line index&lt;br>
&amp;ndash; $: end of the line &lt;span style="font-size: 14px" class="text-secondary">(trick: use &amp;ldquo;A&amp;rdquo; for the end of line + insert mode.) &lt;/span>&lt;br>
&amp;ndash; _: beginning of the line content &lt;span style="font-size: 14px" class="text-secondary">(trick: use &amp;ldquo;I&amp;rdquo; for the beginning of line + insert mode.)&lt;/span>&lt;/p></description></item><item><title>Tracker - Vibe Project</title><link>https://www.vijaypagare.in/diary/weekly-progress-tracker/</link><pubDate>Sat, 09 Aug 2025 15:19:14 +0530</pubDate><guid>https://www.vijaypagare.in/diary/weekly-progress-tracker/</guid><description>&lt;p>So… I finally built something I actually wanted — a Weekly Work Tracker for personal use.&lt;/p>
&lt;img src="https://github.com/user-attachments/assets/95407c6c-14c6-40e7-8986-87029d333a6b" />
&lt;p>I&amp;rsquo;ve been toying with this idea of building software for personal use for quite sometime now, but couldn&amp;rsquo;t gather enough motivation to actually go and execute. Until yesterday. That&amp;rsquo;s when i tried claude.ai—and, oh bwoy, it&amp;rsquo;s freaking amazinggg!!&lt;/p>
&lt;p>I vibe coded an entire app in almost a single prompt.&lt;/p>
&lt;p>So actually my motivation was to generate a notion template to track my weekly todos (i have recently developed a habit of keeping a paper on my desk and noting a few tasks for the day and knocking them off —needed something similar digitally). But notion AI did a really poor job of realising my dream, so with lots of hope, i then went to chatgpt4, and asked it to materialize my vision. It was disappointing too, I wasn&amp;rsquo;t impressed by the results.&lt;/p></description></item><item><title>Touch Typing Speed - 95 wpm!</title><link>https://www.vijaypagare.in/diary/crossed-95-wpm/</link><pubDate>Thu, 07 Aug 2025 09:40:10 +0530</pubDate><guid>https://www.vijaypagare.in/diary/crossed-95-wpm/</guid><description>&lt;p>So i recently crossed &lt;a href="#ZgotmplZ" >95 wpm typing speed&lt;/a>.&lt;/p>
&lt;h3 id="here-are-my-3-key-take-aways">Here are my 3 key take aways:&lt;/h3>
&lt;p>Backstory, i had hit a typing ceiling around &lt;a href="#ZgotmplZ" >80 wpm&lt;/a> max speed, with ~60ish wpm average, and wasn&amp;rsquo;t able to progress for multiple months (years).&lt;/p>
&lt;p>To overcome it, i had to remove certain mental blocks&lt;/p>
&lt;h3 id="1-always-use-the-appropriate-finger-for-the-specific-key">1. Always, use the appropriate finger for the specific key&lt;/h3>
&lt;p>I do &lt;a href="#ZgotmplZ" >touch typing&lt;/a>. Earlier I used to suck at typing, and I literally learnt how to type correctly at &lt;a href="#ZgotmplZ" >~26yo age&lt;/a> from &lt;a href="#ZgotmplZ" >typing.com&lt;/a>. I could never go pass beyond 35-40 wpm because the way i was typing was flawed (it was mostly two fingers and occasionally a few others). Learning to use appropriate fingers for specific keys is must if you wanna go beyond 45 i think. And it&amp;rsquo;s never too late to invest in this skill. Comm&amp;rsquo;on we&amp;rsquo;re digital natives.&lt;/p></description></item><item><title>Projects</title><link>https://www.vijaypagare.in/projects/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.vijaypagare.in/projects/</guid><description>&lt;h3 id="featured-projects">Featured Projects&lt;/h3>
&lt;ol>
&lt;li>Automated Social Media Content Using CV and NLP.&lt;/li>
&lt;/ol>
&lt;h4 id="side-projects">Side-projects&lt;/h4>
&lt;ul>
&lt;li>&lt;a href="https://www.vijaypagare.in/app/ezcreatives" 
 target="_blank" rel="noopener" >TechPro - News, tips &amp;amp; tricks&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://ezcreatives.technologypro.in" 
 target="_blank" rel="noopener" >Ezcreatives - image generator for social media&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://weekly.technologypro.in" 
 target="_blank" rel="noopener" >Weekly - track your weekly work progress&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://instagram.com/wethesapiens_" 
 target="_blank" rel="noopener" >Instagram - @wethesapiens_&lt;/a> (social media page)&lt;/li>
&lt;/ul>
&lt;h4 id="past--archive">Past / Archive&lt;/h4>
&lt;ul>
&lt;li>&lt;a href="https://www.vijaypagare.in/app/juris" 
 target="_blank" rel="noopener" >Juris Krafter;&lt;/a> &lt;a href="https://www.vijaypagare.in/app/artsy" 
 target="_blank" rel="noopener" >Artsy, the paper flowerist&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.vijaypagare.in/app/calm-landing" 
 target="_blank" rel="noopener" >Calm clone,&lt;/a> &lt;a href="https://gist.github.com/pagarevijayy/c46adf4732d6f9762d928472cf9228ce" 
 target="_blank" rel="noopener" >Apple shortcuts&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.vijaypagare.in/app/wts-v1" 
 target="_blank" rel="noopener" >we-the-sapiens v1 -&lt;/a> &lt;a href="https://www.instagram.com/wethesapiens_/" 
 target="_blank" rel="noopener" >social&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.vijaypagare.in/app/ecom" 
 target="_blank" rel="noopener" >ecom,&lt;/a> &lt;a href="https://www.vijaypagare.in/app/weather" 
 target="_blank" rel="noopener" >weather app,&lt;/a> &lt;a href="https://github.com/pagarevijayy?tab=repositories" 
 target="_blank" rel="noopener" >and a heap of others&amp;hellip;&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Vijay Pagare - Work</title><link>https://www.vijaypagare.in/work/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.vijaypagare.in/work/</guid><description>&lt;h3 id="professional-experience">Professional Experience&lt;/h3>
&lt;blockquote>
&lt;p>For details please check &lt;a href="https://www.linkedin.com/in/pagarevijayy/" 
 target="_blank" rel="noopener" >LinkedIn&lt;/a>.&lt;/p>&lt;/blockquote>
&lt;p>Senior Frontend Engineer | Product Engineering, Web Performance&lt;/p>
&lt;ul>
&lt;li>Publicis Sapient (Medtronic) – Dec 2023 – Present&lt;/li>
&lt;li>Propellor.ai – Aug 2021 – Nov 2023&lt;/li>
&lt;li>Eragap Ventures – Sept 2020 – Aug 2021&lt;/li>
&lt;li>Flexiloans – Jun 2019 – Sept 2020&lt;/li>
&lt;/ul>
&lt;p>Experience: 7+ years&lt;/p></description></item><item><title>Work With Me</title><link>https://www.vijaypagare.in/collaborate/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.vijaypagare.in/collaborate/</guid><description>&lt;h2 id="build-faster-smarter-and-scalable-products">Build faster, smarter, and scalable products&lt;/h2>
&lt;p>I help startups and product teams improve performance, ship faster, and integrate intelligent systems into their products.&lt;/p>
&lt;p>If your product is slow, hard to scale, or needs AI capabilities — I can help.&lt;/p>
&lt;hr>
&lt;h2 id="what-i-can-help-with">What I can help with&lt;/h2>
&lt;h3 id="-frontend-performance-optimization">⚡ Frontend Performance Optimization&lt;/h3>
&lt;ul>
&lt;li>Reduce load times (FCP, LCP, bundle size)&lt;/li>
&lt;li>Improve rendering and responsiveness&lt;/li>
&lt;li>Fix performance bottlenecks in production apps&lt;/li>
&lt;/ul>
&lt;p>👉 Example: Improved dashboard performance from &lt;strong>~5s → ~1.5s&lt;/strong>&lt;/p></description></item></channel></rss>