Revisiting Dynamic Programming

The main problem with me w.r.t DP problem is forgetting it if i don't practice. So I decided to revisit all the DP problems i solved once again just to refresh my memory. So first Lets start with a simple one. Here we go!!! Climbing stairs from Leetcode. Explanation : You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps....

March 19, 2024

Java Design Patterns - JDP Series #1

Design patterns are general reusable solutions to common problems that occur in software design. They are not code, but rather guidelines on how to solve a particular problem in a particular context. They are not a finished design that can be transformed directly into code. They are a description or template for how to solve a problem that can be used in many different situations. Types of design patterns in Java -------------------------------- There are three types of design patterns in Java: * Creational...

March 7, 2024

Fed 27 2024. A Day of Compassion and Unexpected Encounters

Today was not an ordinary day for me; it began with the need to take an unexpected sick day. The morning unfolded with urgency as I planned to drop off my child, but fate had a different story in store. Around 9:30 AM, near Hopefarm in Whitefield, my day took a dramatic turn. As I attempted to overtake a car on the right, an elderly man crossing the road appeared in my path....

February 27, 2024

Jump Game

Jump Game Peak and Valley approach. Jump game is a medium level leetcode problem which is very interesting yet brainy. Once you understand the problem correctly then the answer is obvious. The probelm goes like this according to leetcode. You are given an integer array nums. You are initially positioned at the array’sfirst index, and each element in the array represents your maximum jump length at that position. Return true_ if you can reach the last index, or false otherwise_....

February 22, 2024

From Painful Tables to Performance Bliss: My Journey with Database Partitioning - Part II

Skewed workloads and Relieving Hot Spots Imagine you have a library with books categorized by their first letter (A-Z). This is like partitioning data based on a key (like the first letter of a book title). Problem: One letter (say, “X”) becomes super popular (a celebrity author!). Everyone wants to read “X” books, causing a “hot spot” (overcrowding) in the “X” section. Hashing doesn’t fix it: Even if you assign different “buckets” based on a hash of the title, all “X” books still end up in the “X” bucket....

February 15, 2024

From Painful Tables to Performance Bliss: My Journey with Database Partitioning - Part I

Ah, the early days of wrangling massive data tables! I vividly remember the struggle – slow queries, performance bottlenecks, and the ever-growing cloud bill. It was an uphill battle until we unearthed the magic bullet: database partitioning. Talk about a revelation! This newfound approach not only eradicated performance issues but also slashed computational costs. But the story doesn’t end there. My exploration revealed a treasure trove of partitioning techniques, each unlocking unique advantages....

February 11, 2024

Event Sourcing - Moving out of traditions | Simplified version

Introduction A colleague recommended Martin Kleppmann’s “Designing Data-Intensive Applications” to me. Initially, I found the beginning somewhat tedious and opted for a non-linear approach, selecting topics of interest at random rather than reading from start to finish as one might with a novel. This strategy seemed fitting given the book’s comprehensive coverage of software system design, akin to an engineering bible. Today, I’ve chosen to delve into the concept of Event Sourcing....

February 6, 2024

Designing a Browser History Feature

Objective The goal is to create a class capable of handling browser history operations efficiently. This includes: Initializing the browser with a specified homepage. Navigating to new URLs (visiting pages). Enabling backward and forward navigation through the history. Key Components Constructor: Initializes the browser with a homepage. Visit(URL): Navigates to a new URL and updates the current position in the history. Back(steps): Moves back a specified number of steps in history and returns the current URL....

February 4, 2024

An early morning adventure

On the early morning of February 1st, I decided to tackle a problem from the Striver’s SDE sheet. I came across an intriguing challenge titled “Set Matrix Zeroes”. Here’s how I approached it: Initially, I attempted a brute force method. The usual strategy of iterating through a matrix and setting rows and columns to zero has a drawback: it can lead to the loss of the matrix’s original state, potentially zeroing out the entire matrix, which isn’t the desired outcome....

January 31, 2024

An engineers view to religion

KEEP ONE HAND DISTANCE!

April 3, 2022