When working with linked lists, a classic problem youโll encounter is: โGiven k sorted linked......
QuadTrees are a fascinating data structure, often used in image compression, spatial indexing, and......
Sorting a linked list isnโt as straightforward as sorting an array. With arrays, we can do quick sort......
By rakeshreddy512 | August 31, 2025Most backend engineers spend months grinding LeetCode. But in reality, backend interviews are about......
By rakeshreddy512 | August 31, 2025Most developers preparing for frontend interviews drown themselves in LeetCode. While data structures......
When youโre given a sorted array, you might be asked to convert it into a height-balanced binary......
The Word Search problem is a classic interview question that tests recursion, grid traversal, and......
Got it, Rakesh ๐ Letโs turn this into a neat blog post. Iโll explain the problem, walk through the......
๐ฐ Solving the N-Queens Problem with Backtracking The N-Queens problem is a classic in......
The Combination Sum problem is a classic backtracking question from LeetCode (#39). We are......
Understanding Permutations in JavaScript (Step by Step) Permutations are all the possible......
Problem Given two integers n and k, return all possible combinations of k numbers chosen......
Ever wondered how your phone predicts words when youโre typing on a numeric keypad? Thatโs exactly......
Solving Word Search II with Trie and DFS Finding words in a 2D board may sound like a fun......
๐ Word Dictionary with Wildcards โ Trie + DFS Approach Imagine youโre building a search......
โจ What is a Trie? A Trie (pronounced like "try") is a special type of tree used to store......
๐ Solving the Word Ladder Problem Using BFS in JavaScript The Word Ladder problem is a......
๐ Problem Overview Imagine youโre playing a game where you can mutate genes by changing......
Approach We treat the Snakes and Ladders board as an unweighted graph: Each square = a......
If you've ever tried stacking books in the correct order without violating any โpre-readโ rule (e.g.,......
๐ Problem Overview We are given equations like: a / b = 2.0 b / c = 3.0 Enter......
By rakeshreddy512 | July 14, 2025JavaScript Built-in Method Cheat Sheet Ever find yourself in the middle of a LeetCode......
๐ Approach We use a Breadth-First Search (BFS) approach starting from the border 'O's. Any......
๐ Approach: BFS We traverse each cell in the grid. When we encounter a land cell ("1")......
๐ฒ Two Elegant Ways to Validate a Binary Search Tree (BST) in JavaScript A Binary Search......
๐ง Approach: Inorder Traversal (Because BST is Sorted Inorder) In a BST, an inorder......
๐ง Approach: Inorder Traversal (Sorted View of BST) In a BST, an inorder traversal gives us......
๐ง Approach: BFS with Direction Flag This is a slight variation of Level Order Traversal......
๐ง Approach: Breadth-First Search (BFS) This is a textbook case for BFS using a queue. You......
๐ง Approach: Level Order Traversal (BFS) We use Breadth-First Search (BFS) to traverse the......
๐ง Approach: Level Order Traversal (BFS) We use Breadth-First Search (BFS) โ traverse the......
๐ Approach: Bucket Sort (Linear Time) Instead of sorting elements by frequency (which......
๐งญ Intuition Behind the Recursive Approach Hereโs the deal. Weโre going to: Start at the......
๐ง Intuition When you're at any node: Count yourself โ thatโs 1 Count everything in your......
๐ง Approach Why In-order? In-order traversal (Left โ Root โ Right) returns......
When working with binary trees, it's common to process each node with post-order traversal (left โ......
Approach To solve this problem, we can use a Depth-First Search (DFS) strategy to traverse......
๐ง Approach: Recursive DFS To determine if a path from root to leaf equals a target sum, we......
Hey everyone! ๐ Today, letโs dive deep into a classic tree problem โ flattening a binary tree into a......
By rakeshreddy512 | April 24, 2025If you're a backend engineer with 2โ4 years of experience and dreaming of joining FAANG or a top-tier......
Approach The breadth-first search (BFS) approach is ideal for this problem. By performing......
Reconstructing a binary tree from its inorder and postorder traversal is a classic recursive problem......
By rakeshreddy512 | April 24, 2025In modern web design, flexibility is key. Whether you're building a responsive dashboard, a......
Constructing a binary tree from preorder and inorder traversal is a classic problem that teaches......
By rakeshreddy512 | April 21, 2025Smoothies arenโt just Instagram foodโthey're seriously powerful when it comes to fitness......
Checking if a binary tree is symmetric is a classic recursive problem in data structures. In this......
By rakeshreddy512 | April 21, 2025Protein is essential for building muscle, repairing tissues, and maintaining a healthy metabolism.......
One of the most elegant problems in tree manipulation is inverting a binary tree โ essentially......
The โSame Treeโ problem is a classic interview question that tests your understanding of tree......
Finding the maximum depth (or height) of a binary tree is one of the most classic problems in tree......
By rakeshreddy512 | April 15, 2025If you're diving into UI/Frontend development or want to level up your styling skills, mastering CSS......
By rakeshreddy512 | April 15, 2025Intro: CSS layout properties like position and display often confuse developers, especially when......
By rakeshreddy512 | April 14, 2025In the last two posts, we covered what binary trees are and how to traverse them. Now itโs time to......
By rakeshreddy512 | April 14, 2025Now that weโve covered the basics of binary trees in our first post, it's time to dive into......
By rakeshreddy512 | April 14, 2025If youโve ever scratched your head at the mention of binary trees or felt overwhelmed by tree data......
๐ Building an LRU Cache in JavaScript (The Right Way) Imagine you're building a browser,......
๐ Approach To solve this cleanly, we use the two-pointer technique: Create two dummy......
๐ Approach: Calculate the length of the list. Connect the tail to the head to make it......
By rakeshreddy512 | April 12, 2025If you're like me, you want your screen time to be meaningfulโnot just mindless entertainment. Some......
๐ก Approach The idea is to remove all nodes that have duplicate values, even the first......
By rakeshreddy512 | April 10, 2025Ever wondered why a CSS style you wrote is affecting everything โ or nothing at all? Thatโs because......
You're given a singly linked list. Your task is to remove the nth node from the end and return the......
By rakeshreddy512 | April 9, 2025Ant Design v5 introduced a powerful theming system built around design tokens, making it easier than......
By rakeshreddy512 | April 8, 2025As artificial intelligence continues to evolve, many developers are wondering: "Will AI take over my......
๐ก Approach The idea is to reverse each group of k nodes while maintaining the correct......
Reversing a linked list is a common problem in coding interviews and data structures. In this blog,......
Approach Find the leftPrev Node** Create a dummy node to handle edge cases (like when......
By rakeshreddy512 | April 2, 2025Introduction React is one of the most popular frontend libraries, known for its......
By rakeshreddy512 | April 2, 2025Redux has been the go-to state management library for React applications, but traditional Redux......
By rakeshreddy512 | April 2, 2025Microfrontend architecture allows breaking a monolithic frontend into smaller, independent apps that......
By rakeshreddy512 | April 2, 2025When managing state in a React application, two common approaches are React Context API and Redux.......
By rakeshreddy512 | March 31, 2025Introduction Many people believe that you can either lose fat or gain muscleโbut not both......
By rakeshreddy512 | March 29, 2025How to Become Super Smart, Mentally Strong, and Boost Brain Power Introduction Many people believe......
By rakeshreddy512 | March 27, 2025Low-Level Design (LLD) of ClearFood in JavaScript Introduction ClearFood is a......
By rakeshreddy512 | March 27, 2025Webpack is a module bundler for JavaScript applications. It takes all your files (JavaScript, CSS,......
Copy List with Random Pointer โ JavaScript Approach Problem Statement You are......
# Merging Two Sorted Linked Lists: Approach, Complexity, and Code Merging two sorted linked lists is......
By rakeshreddy512 | March 21, 2025๐ช Complete Exercise & Nutrition Plan for Muscle Growth & Fat Loss (Based on Your......
Understanding Carry in Linked List Addition Key Concepts Numbers are stored in......
Creating and Working with Linked Lists in JavaScript Introduction In......
Evaluating Reverse Polish Notation (RPN) โ Approach & Learnings ......
Implementing MinStack in JavaScript Problem Statement Design a stack that......
Using Stack /** * @param {string} path * @return {string} */ var simplifyPath = function (path)......
Approach We loop through chars of s , if its a closing bracket we compare with last element in stack......
Intuition The problem requires us to find the minimum number of arrows needed to burst all......
Javascript Code /** * @param {number[][]} intervals * @param {number[]} newInterval * @return......
Using Sorting Chapter 1 /** * @param {number[][]} intervals * @return {number[][]} ......
Two Pointer Approach Javascript Code /** * @param {number[]} nums * @return {string[]} */ var......
By rakeshreddy512 | March 18, 2025JavaScript Set - Concise Notes ๐ ๐น What is a Set? A Set is a built-in......
Javascript Code /** * @param {number[]} nums * @return {number} */ var longestConsecutive =......
Javascript Code /** * @param {number[]} nums * @param {number} k * @return {boolean} */ var......
Using Hashmap Store all the numbers , and check for repeated number if repetition occurs then its......
Using Hashmap (Optimal solution) /** * @param {number[]} nums * @param {number} target *......
Using Sorting /** * @param {string[]} strs * @return {string[][]} */ var groupAnagrams =......
Approach 1 /** * @param {string} s * @param {string} t * @return {boolean} */ var isAnagram =......
Javascript Code /** * @param {string} pattern * @param {string} s * @return {boolean} */ var......
Javascript Code /** * @param {string} s * @param {string} t * @return {boolean} */ var......
By rakeshreddy512 | March 17, 2025Let's break it down: OAuth and SAML are both protocols used for authentication and authorization, but......
By rakeshreddy512 | March 17, 2025๐ Notes on Sockets and Their Importance What is a Socket? A socket is a......
๐ JavaScript Map (HashMap) Basics Definition: A Map stores key-value pairs and maintains......
Cell State Mapping: Original State New State Transitional Value Meaning 1......
By rakeshreddy512 | March 16, 2025A post by Rakesh Reddy Peddamallu...
Javascript Code /** * @param {number[][]} matrix * @return {void} Do not return anything, modify......
/** * @param {number[][]} matrix * @return {void} Do not return anything, modify matrix in-place......
awesome-system-design-resources system-design-primer...
By rakeshreddy512 | March 8, 2025Goal: Reduce Body Fat (from 26% to ~15-18%) While Maintaining Muscle Since you are 75 kg......
Javascript Code /** * @param {number[][]} matrix * @return {number[]} */ var spiralOrder =......
By rakeshreddy512 | March 7, 2025Here's a structured plan to help you prepare effectively: 1. Data Structures &......
By rakeshreddy512 | March 7, 2025Hereโs a detailed 6-week backend interview preparation plan tailored for 3 years of experience: ......
Javascript Code /** * @param {character[][]} board * @return {boolean} */ const checkInRow =......
Javascript Code /** * @param {string} s - The input string * @param {string} t - The target......
Javascript Code /** * @param {string} s * @param {string[]} words * @return {number[]} */ var......
Javascript Code /** * @param {string} s * @return {number} */ var lengthOfLongestSubstring =......
/** * @param {number} target * @param {number[]} nums * @return {number} */ var minSubArrayLen =......
Javascript Code /** * @param {number[]} nums * @return {number[][]} */ var threeSum = function......
Javascript Code /** * @param {number[]} height * @return {number} */ var maxArea = function......
Javascript Code /** * @param {number[]} numbers * @param {number} target * @return {number[]} ......
Javascript Code /** * @param {string} s * @return {boolean} */ var isPalindrome = function (s)......
Javascript Code /** * @param {string[]} words * @param {number} maxWidth * @return {string[]} ......
Javascript Code var strStr = function (haystack, needle) { if (needle.length === 0) return 0; ......
/** * @param {string} s * @param {number} numRows * @return {string} */ var convert =......
Javascript Code Considering the first word as a whole as prefix ; we iterate for a mismatch and......
/** * @param {string} s * @return {number} */ var lengthOfLastWord = function(s) { let words......
/** * @param {number} num * @return {string} */ var intToRoman = function(num) { let......
Explanation The trick is IV is 4 because , I which is 1 is less than V which is 5 so we check in the......
Mathematical function Javascript code /** * @param {number[]} height * @return {number} */ var......
/** * @param {number[]} ratings * @return {number} */ var candy = function(ratings) { const......
/** * @param {number[]} gas * @param {number[]} cost * @return {number} */ var......
class RandomizedSet{ constructor() { this.hashMap = new Map() this.list = []; ......
/** * @param {number[]} citations * @return {number} */ var hIndex = function(citations) { ......
The question says that we can be always able to reach the end , only that we need to find is the min......
so this is a greedy approach our goal is to reach the last index , so we try to reach to index......
/** * @param {number[]} prices * @return {number} */ var maxProfit = function(prices) { ......
Naive Approach In this i'm just using an extra array to store /** * @param {number[]} nums *......
Is it possible to do in O(1) time complexity ? There are multiple ways to solve this problem One......
/** * @param {number[]} nums * @return {number} */ var removeDuplicates = function(nums) { ......
There are multiple ways to solve this but we need to solve it in inplace as mentioned in the problem......
A post by Rakesh Reddy Peddamallu...
Since we need to check every character of s to be sequentially present in t , if we find the......
Naive Approach /** * @param {number[]} nums * @return {void} Do not return anything, modify nums......
Need to update the solution Please read the question completely before going through the......
Tried this but not a right solution /** * @param {number[]} nums * @return {boolean} */ var......
So we should not be using the division operator as the question says but adding the code......
Naive Approach /** * @param {string} s * @return {string} */ var reverseWords = function(s) { ......
Naive Approach /** * @param {string} s * @return {string} */ var reverseVowels = function(s)......
To solve the problem we are going to iterate through the flowerbed and check for 3 things , left ,......
Got the brute force solution Javascript Code /** * @param {number[]} candies * @param {number}......
Approach -> String is considered as divisor , when the lengths of both strings str1 and str2 is......
Heres , the solution try to understand the code ๐ /** * @param {string} word1 * @param {string}......
By rakeshreddy512 | September 2, 2024Follow SDE2 Guide Grokking System Design Fundamentals Grokking the System Design......
By rakeshreddy512 | August 29, 2024Today we will go through another fundamental component of system design , API Gateway It is an......
By rakeshreddy512 | June 24, 2024U can read the question properly and give a try once before coming to the solution Incase you have......
key - in order to start in circular way -> generally we iterate starting from i=0 , j = (i+1) ......
Lets quickly go into the solution for the unique email addresses problem we can see every email in......
/** * // Definition for a Node. * function Node(val, neighbors) { * this.val = val ===......
Solution that i got , not a good one but at-least mine ๐ , the Time Complexity is O(n^2) which is......
Initial Solution /** * @param {number} n * @return {number} */ var climbStairs = function(n) { ......
Basically we need to return duplicated item and the missing item in array . since the numbers are......
Lets get into the solution of the problem . Basically we need to split the linked list in k parts......
Firstly i couldn't solve on my own ๐ , so i went through this video U can visualize the mountains......
so basically we have a string s , and if its possible to rotate it and get to the string goal then we......