High Level Design

Table of Contents What is High-Level Design (HLD)? Key Principles of HLD Steps to Approach HLD in Interviews Core Components of HLD System Design Patterns Scalability, Reliability, and Performance Common HLD Examples Case Study: Designing a URL Shortener 1. What is High-Level Design (HLD)? High-Level Design (HLD) is the process of designing the architecture of a system. It focuses on big-picture aspects, including: System architecture: Breaking down the system into modules or components....

4 min · Prajwal S

Interview Preparation Guide

1. Data Structures & Algorithms (DSA) At Google, technical interviews focus heavily on problem-solving skills using data structures and algorithms. You’ll be tested on your ability to solve problems efficiently and with optimal time and space complexity. Key Data Structures Arrays: Efficient manipulation and searching of data. Linked Lists: Implementation of basic linked list operations and traversal. Stacks & Queues: Mastering LIFO and FIFO operations. Hash Tables: Fast lookup and data storage....

4 min · Prajwal S

JS

Variable: let myVariable;

1 min · Prajwal S

Leetcode

One Page to Crack LeetCode Key Sections Core Data Structures Essential Algorithms Problem-Solving Patterns Advanced Techniques Common Problem Categories Optimization Tips 1. Core Data Structures Arrays and Strings Operations: Traverse, search, sort, rotate. Key Techniques: Sliding window, prefix sums. # Sliding Window Example: Maximum Subarray Sum of Size K def max_subarray_sum_k(arr, k): max_sum, window_sum = 0, 0 start = 0 for end in range(len(arr)): window_sum += arr[end] if end >= k - 1: max_sum = max(max_sum, window_sum) window_sum -= arr[start] start += 1 return max_sum Linked Lists Operations: Reverse, detect cycles, merge....

4 min · Prajwal S

Linked List

Introduction A linked list is a linear data structure where elements (nodes) are connected by pointers. Unlike arrays, linked lists allow dynamic memory allocation and efficient insertion/deletion operations. Types of Linked Lists 1. Singly Linked List Each node has a value and a pointer to the next node. Efficient for forward traversal. 2. Doubly Linked List Each node has a value, a pointer to the next node, and a pointer to the previous node....

Low Level Design

These notes cover all essential concepts, principles, and patterns required for Low-Level Design (LLD). It includes explanations, examples, and diagrams to make the understanding and implementation process seamless. 1. Object-Oriented Programming (OOP) Principles 1.1 Encapsulation Encapsulation hides the internal details of a class and exposes only what is necessary. Example: class BankAccount: def __init__(self, balance): self.__balance = balance # Private variable def deposit(self, amount): self.__balance += amount def withdraw(self, amount): if amount > self....

4 min · Prajwal S

Math

Overview Mathematical problems often require efficient algorithms to handle arithmetic operations, geometry, and number theory. These algorithms are essential for competitive programming and interview questions. Common Math Topics and Techniques 1. Greatest Common Divisor (GCD) Finds the largest number that divides two integers. Commonly used to simplify fractions or solve problems involving ratios. Euclid’s Algorithm # Iterative Approach def gcd(a, b): while b: a, b = b, a % b return a # Example Usage print(gcd(56, 98)) # Output: 14 2....

Matrix

Introduction A matrix is a two-dimensional array of elements arranged in rows and columns. In coding interviews, matrix-related problems often involve: Dynamic Programming: Utilizing matrices to store intermediate results. Graph Traversal: Treating the matrix as a grid-based graph for traversal algorithms. Matrices can represent graphs where each cell is a node with up to four neighbors (top, bottom, left, right), except for edge and corner cells. Corner Cases to Consider When working with matrices, be mindful of the following edge cases:...

OOPS

These notes serve as a complete guide to OOP concepts with detailed explanations and examples in Python. 1. Core Principles of OOP Object-Oriented Programming is based on four fundamental principles: 1.1 Encapsulation Definition: Bundling data (attributes) and methods (functions) that operate on that data into a single unit (class) and restricting direct access to some of the object’s components. Goal: Protect the integrity of the data and expose only necessary details....

4 min · Prajwal S

Python

To convert a space-separated list into a list: list1 = input_list1.split() Sets: # Convert into set to remove duplicates set1 = set(list1) # To find common values common_values = set1.intersection(set2) # Searching in set seen = set() if item in seen: pass # Adding a new item in set seen.add(3) Lists: # Appending a new item in list list1.append(3) # Accessing first element list1[0] # Accessing last element list1[-1] # Length of list len(list1) # Count elements satisfying a condition count = sum([1 for s in input_list if len(s) >= 2 and s[0] == s[-1]]) # Sorted list sorted_list = sorted(unsorted_list) # Reverse sorted list reverse_sorted_list = sorted(unsorted_list, reverse=True) # Sorted dictionary by key sorted_by_key = dict(sorted(dictionary1....

2 min · Prajwal S