Digital Garden

A collection of my notes, thoughts, and writings. These are public notes directly synced from my Obsidian vault on GitHub.

Go Enums

Go has no built-in enum keyword. The idiomatic alternative is a typed constant group combined with iota — a compile-time counter that auto-increments within a const block. The result behaves like an e

Go

Go Generics

Generics (introduced in Go 1.18) let you write functions and types that work across multiple types without duplicating code. The key idea: type parameters — placeholders for concrete types supplied at

Go

Go Proverbs

A collection of wise, pithy design principles from Rob Pike — one of Go's creators. Presented at Gopherfest 2015, they capture the philosophy behind idiomatic Go. Similar in spirit to the Zen of Pytho

Go

Go HTTP Clients

Go's standard library ships a production-ready HTTP client in net/http — no third-party dependency needed. This note covers the full lifecycle: making requests, working with JSON, understanding URLs a

Go

Go Mutexes

A mutex (mutual exclusion lock) protects shared data from concurrent access. While channels communicate data between goroutines, a mutex guards data that multiple goroutines read or write directly. Fr

Go

AWS Lambda

- Serverless compute — run code without provisioning or managing servers - Event-driven — executes in response to triggers (S3, API Gateway, Kinesis, DynamoDB Streams, SNS, SQS, etc.) - FaaS (Function

AWS

Go Channels & Goroutines

Go's concurrency model is built on two primitives: goroutines (lightweight threads managed by the Go runtime) and channels (typed, thread-safe pipes for goroutines to communicate through). The philoso

Go

Go Control Flow

Go's control flow for conditionals is intentionally minimal: if/else for branching and switch as a cleaner alternative to long if-else chains. No parentheses around conditions, braces always required.

Go

Go Error Handling

Go handles errors as values, not exceptions. There's no try/catch — instead, functions return an error as the last return value, and callers check it explicitly. This makes error paths visible, forces

Go

Go Functions

Functions are first-class citizens in Go — they can be assigned to variables, passed as arguments, and returned from other functions. Types come after variable names. Go natively supports multiple ret

Go

Go Quiz & Coding Challenges

How to use: Go section by section. For "What's the output?" — reason through it before expanding. For coding challenges — write the solution first, then verify. --- go package main import "fmt" var x

Go

Go Interfaces

An interface defines a set of method signatures. Any type that implements all those methods automatically satisfies the interface — no explicit implements declaration needed. This is called structural

Go

Go Loops

Go has exactly one looping construct: for. It replaces C's for, while, and do-while. No parentheses around the loop header, braces always required. This keeps the language minimal without sacrificing

Go

Go Maps

A map is Go's built-in hash map — an unordered collection of key-value pairs with O(1) average lookup, insert, and delete. Keys must be a comparable type (anything you can use == on). Maps are referen

Go

Go Packages & Modules

Go code is organized into packages (a directory of .go files that share a package declaration) and modules (a collection of related packages defined by a go.mod file). Every file belongs to a package.

Go

Go Pointers

A pointer holds the memory address of a value rather than the value itself. Pointers let you share and mutate data across function boundaries without copying it. Go pointers are simpler than C pointer

Go

Go Slices

A slice is Go's dynamically-sized, flexible view into an array. Unlike arrays (fixed size, part of the type), slices can grow and shrink. They are the standard way to work with ordered collections in

Go

Go Structs

A struct is Go's primary way to group related data. It's equivalent to a class without inheritance — you get data fields and methods attached to the type. Go favours composition over inheritance throu

Go

Go Variables & Types

Go is statically typed — every variable has a type fixed at compile time. The compiler catches type mismatches before the program runs. Types are written after the variable name (opposite to C/Java).

Go

AWS VPC

--- - Virtual Private Cloud — your own isolated private network within AWS - Spans all AZs in a region (regional resource) - You control: IP ranges, subnets, route tables, gateways, security rules - A

AWS

AWS ML Associate Exam — Index & Guide

Comprehensive exam notes. Each domain has a dedicated file. --- ------ Exam Code MLA-C01 Duration 170 minutes Questions 65 questions (multiple choice + multiple response) Passing Score 7

AWS

Domain 1 — Data Preparation for ML (28%)

Largest domain. Focus on: S3, Glue, Athena, Kinesis, SageMaker Ground Truth, Feature Store, and feature engineering techniques. --- mermaid graph LR Raw[Raw Data] -- S3[S3<br/Data Lake] S3 --

AWS

Domain 2 — ML Model Development (26%)

Focus: SageMaker training jobs, built-in algorithms, custom containers, hyperparameter tuning, and SageMaker JumpStart. --- mermaid graph TD Studio[SageMaker Studio<br/Web IDE] -- NB[Notebooks]

AWS

Domain 3 — Deployment & Orchestration of ML Workflows (22%)

Focus: SageMaker endpoint types, inference patterns, SageMaker Pipelines, CI/CD for ML, and MLOps best practices. --- mermaid graph TD Inference[Inference Options] -- RT[Real-time Endpoint<br/Low

AWS

Domain 4 — Monitoring, Maintenance & Security (24%)

Focus: SageMaker Model Monitor, Clarify, drift detection, retraining triggers, IAM, VPC, encryption, and cost optimisation. --- mermaid graph LR Deploy[Model Deployed] -- DriftD[Data Drift<br/Inpu

AWS

ML Fundamentals — AWS ML Associate

Core ML concepts tested across all domains of MLA-C01. --- mermaid graph TD ML[Machine Learning] -- SL[Supervised Learning<br/Labeled data] ML -- UL[Unsupervised Learning<br/No labels] ML

AWS

AWS AI Services & Bedrock — AWS ML Associate

Pre-built AI APIs — no ML expertise needed. Use when you don't want to build/train your own model. --- mermaid graph TD AI[AWS AI Services] -- Vision[Computer Vision] AI -- NLP[Natural Languag

AWS

Stacks

Pre-requisite: [[Stack & Queue]] — covers Stack/Queue data structure, operations, Python implementation --- - Need to track the most recent element seen (last-in, first-out) - Matching/validation — br

DSA

Two Pointers

--- - Sorted array or string — find a pair satisfying a condition - In-place element removal or rearrangement - Comparing elements from both ends simultaneously - Avoid O(n²) brute force on array pair

DSA

Data Engineering Fundamentals

Type Definition Examples -------------------------- Structured Organized in a defined schema DB tables, CSV, Excel spreadsheets Semi-Structured Some structure via tags/hierarchies JSON, XML,

AWS

AWS EC2

--- Concept Definition Example --------- Scalability Ability to handle increased load by adding resources — either vertically (bigger instance) or horizontally (more instances) Upgrading from t

AWS

AWS S3

Pre-requisite: [[Data Engineering Fundamentals]] — covers Data Types, Data Lake vs Warehouse, ETL, Data Formats --- - Simple Storage Service — object storage service by AWS - Infinitely scalable, high

AWS

Design a URL shortener

Design a URL shortener like bit.ly --- 1. Given a long URL → generate a unique short URL 2. Given a short URL → redirect to original long URL 3. Link Analytics — click count per short URL 4. Optional:

System Design

Trapping Rain Water — Two Pointer Visual

--- idx: 0 1 2 3 4 5 height: 4 2 0 3 2 5 5 █ 4 █ █ 3 █ █ █ 2 █

DSA

Python String Functions for DSA

Quick reference for string operations commonly used in LeetCode / interview problems. --- python s = "Hello World" s.lower() # "hello world" s.upper() # "HELLO WORLD" s.swapcase() #

DSA

IAM

- Global service — IAM is not region-specific - Root account is created by default — never share it, never use it for daily tasks - Users are people within your organization and can be grouped - Group

AWS

AI & ML Topics

Area Notes ------------- LangChain [[Langchain]] MCP [[MCP]] --- - [ ] Transformer architecture (attention, embeddings) - [ ] Prompt engineering — zero-shot, few-shot, chain-of-thought - [ ] R

AI & ML

MCP — Model Context Protocol

Model Context Protocol (MCP) is an open standard by Anthropic that defines how applications expose tools, resources, and prompts to LLMs in a unified way. Think of MCP as USB-C for AI — one standard

AI & ML

AWS Topics

Notes will be added here as AWS topics are studied (MLA-C01 exam track, 12-week plan) Resource Type Cost Use --------------------

AWS

Big O & Complexity

Big-O Name Speed Example ----------------------------- O(1) Constant Best Array index lookup O(log n) Logarithmic Great Binary search O(n) Linear Good Single loop through array O(n

DSA

Backtracking

- Problem asks for all combinations / permutations / subsets - Constraint satisfaction (N-Queens, Sudoku) - Brute force with pruning — you explore, then undo (backtrack) invalid paths Rule of thumb:

DSA

Binary Search

Use Binary Search when: 1. Input is sorted (array, range, search space) 2. Problem asks for a specific value, or min/max that satisfies a condition 3. Brute force is O(N) or O(N²) — binary search brin

DSA

Dynamic Programming

There are two approaches to solve any DP problem: 1. Tabulation - Bottom up approach - The problem is solved in the direction of solving the base cases to the main problem 2. Memoization - Top down

DSA

Graphs

- Input is a network, grid, or dependency structure - Problem asks for connectivity, shortest path, cycles, ordering - Keywords: nodes, edges, neighbors, connected components, path --- python graph =

DSA

Heap & Priority Queue

- "Top K", "Kth largest/smallest", "K most frequent" - Need to repeatedly get the min or max efficiently - Merging multiple sorted streams Python's heapq is a min-heap by default. For max-heap: push

DSA

Linked Lists

Use Linked List patterns when: 1. Problem involves pointer manipulation (reversal, merging, cycle) 2. O(1) space constraint — no converting to array 3. Relative ordering of nodes matters --- Detect cy

DSA

Sliding Window

Answer YES to all 3 → use Sliding Window: 1. Input is an Array or String? 2. Problem asks for a Subarray or Substring? 3. Looking for Longest / Shortest / Max Sum / specific count? --- Is window size

DSA

Trees

- Problem involves hierarchical data, parent-child relationships - Asks for path, depth, lowest common ancestor, validation - DFS → path/property problems BFS → level-by-level problems --- python def

DSA

Tries (Prefix Trees)

- Problem involves prefix matching, autocomplete, word search - Multiple strings need to be searched efficiently - Brute force would be O(N × M) — Trie brings prefix lookups to O(M) --- python class T

DSA

DSA Topics

Type Notes ------------- Complexity [[Big O & Complexity]] Sorting [[Sorting Algorithms]] Data Structures [[Stack & Queue]] · [[Linked List]] · [[Trees & BST]] · [[Hash Map]] · [[Trie]] Te

DSA

Hash Map

Maps keys to values using a hash function. Python's dict is a production-ready hashmap. Operation Average Worst --------------------------- Get O(1) O(n) Set O(1) O(n) Delete O(1) O(n)

DSA

Linked List

Linear data structure where elements are linked via references — not stored contiguously in memory. Feature Array Linked List ----------------------------- Access by index O(1) O(n) Insert/De

DSA

Sorting Algorithms

Algorithm Time (avg) Time (worst) Space Stable Use When ------------------------------------------------------------ Bubble Sort O(n²) O(n²) O(1) Yes Never (educational only) Insertion S

DSA

Stack & Queue

Last In, First Out. All operations O(1). Operation Big O Description ------------------------------- push O(1) Add to top pop O(1) Remove and return top peek O(1) View top without remov

DSA

Trees & BST

- Hierarchical structure: root → children → leaves - Each node has at most one parent, any number of children - Binary Tree: each node has at most 2 children (left, right) - BST: left child < parent <

DSA

Trie (Prefix Tree)

Tree-like structure for storing strings character by character. Optimised for prefix operations. Operation Time ----------------- Insert O(m) where m = word length Search O(m) Prefix check

DSA

FrontEnd Topics

Area Notes ------------- JavaScript Core [[JavaScript]] JavaScript DOM [[JavaScript DOM Notes]] JS Interview Patterns [[JavaScript Function Code Examples for Interviews]] JS Interview Ques

FrontEnd

Interview Question

Area Topics ------------ -------------------------

FrontEnd

JavaScript DOM Notes

Every HTML tag is an object. Nested tags are "children" of the enclosing tag. - Nodes vs. Elements: - Nodes: Include everything (Comments, Text, Elements). Accessed via childNodes, firstChild, nextS

FrontEnd

JavaScript Function Code Examples for Interviews

Quick ref: [[Debounce]] · [[Throttle]] · [[Flatten]] · [[Promise Polyfills]] · [[Currying]] · [[Array Polyfills]] · [[Deep Clone]] · [[DOM Functions]] - A debounce function is a higher-order function

FrontEnd

JavaScript Interview Questions

Q: What are JavaScript's data types? 8 types — 7 primitives + 1 object type. Primitives: Number, BigInt, String, Boolean, Null, Undefined, Symbol Reference: Object (includes Array, Function, Date,

FrontEnd

JavaScript

8 types: Number, BigInt, String, Boolean, Null, Undefined, Symbol, Object javascript typeof "abc" // "string" typeof 42 // "number" typeof null // "object" ← JS bug, null is N

FrontEnd

React Learning

Main reference: [[React]]

FrontEnd

React

- Library (not framework) — only controls the root node you give it - Virtual DOM — React diffs a virtual copy of the DOM and applies minimal real DOM updates - JSX — HTML-like syntax transpiled to Re

FrontEnd

Webdriver IO Learning

- Introduction to WebdriverIO - Setting up the Environment - Basic WebdriverIO Test - Q&A - What is WebdriverIO? - WebdriverIO is a custom implementation for selenium's W3C webdriver API. It is writ

FrontEnd

Go Basics

go package main import "fmt" func main() { fmt.Println("Hello, world!") } Every Go program starts in package main. Execution begins in func main(). --- Every Go program is made of packages. By conven

Go

Go Topics

Area Notes ----------------------- ------------------------- Basics [[Basics]] Variables & Types [[Variables & Types]]

Go

Decorators

Decorators are one of Python's most powerful features. They allow you to modify or enhance the behavior of functions or methods without permanently modifying their source code. They are heavily used i

Python

Object Oriented Programming

Code that's easy for humans to understand is called "clean code". Any fool can write code that a computer can understand. Good programmers write code that humans can understand. -- Mart

Python

Python Programming

- First-class function: A function that is treated like any other value - Higher-order function: A function that accepts another function as an argument or returns a function - Pure Function: For same

Python

Logging

Video ref: https://www.youtube.com/watch?v=pxuXaaT1u3k Python's built-in logging module is the standard for production logging. Avoid using print() in production — it has no severity levels, no format

Python

Python Interview Questions

Q: What is the difference between is and ==? == checks value equality. is checks identity — whether both variables point to the same object in memory. python a = [1, 2, 3] b = [1, 2, 3] a == b # Tr

Python

Python Topics

Area Notes ------------- Language Core [[Python Programming]] · [[Decorators]] · [[Object Oriented Programming]] Libraries [[Logging]] Interview Prep [[Python Interview Questions]] --- - [x

Python

API Gateway

Design an API Gateway that acts as the single entry point for all client requests to a microservices backend. --- - Route requests to appropriate backend services - Authentication & Authorization - Ra

System Design

ML Feature Store

Design a Feature Store — a centralised repository for storing, sharing, and serving ML features for training and inference. --- Direct relevance: Crest Data ML thresholding engine — KPI features need

System Design

Notification System

Design a scalable notification system that sends push, email, and SMS notifications to millions of users. --- - Support push (mobile), email, SMS channels - Send notifications based on events (order p

System Design

RAG & LLM System

Design a Retrieval-Augmented Generation (RAG) system — an LLM-powered Q&A that grounds answers in a private knowledge base. --- Direct relevance: AWS Bedrock LLM chat application at HCLTech. The Flas

System Design

Rate Limiter

Design a rate limiter that restricts the number of requests a user/service can make in a given time window. --- - Allow N requests per user per time window (e.g., 100 req/min) - Return HTTP 429 (Too M

System Design

Uber & Ride Sharing (Maps/Geospatial)

Design a ride-sharing system like Uber — real-time driver tracking, matching, routing. --- ⭐ Direct relevance: HCLTech geospatial engine — 250+ concurrent drivers, WebSocket tracking, sub-second late

System Design

Langchain

Source: DeepLearning.AI — LangChain for LLM App Dev Code: [[L1-Modelpromptparser.py]] Raw OpenAI API LangChain --------------------------

AI & ML

Concurrency

- Process registers - Program counters - Stack pointers - Memory pages Each process has its own memory address space. 1. Heap : It is dynamic allocated memory 2. Stack: 3. Registers: - Thread is a uni

System Design

Basics

- It is a column or a group of columns which uniquely identifies each rows in the database table. - Each table can have one and only one primary key. - The primary key doesn't have to be ID column alw

System Design

Basics

- Distributes incoming requests amongst multiple servers to optimise resource utilisation - Why it is needed? - Distributes requests so no single server is overloaded → high availability - Reduces r

System Design

System Design Basics

mermaid flowchart TD Requirements["Requirements <br/ Functional & Non-Functional"] HLD["High-Level Design <br/ Architecture & Components"] DataModel["Data Model & Flow <br/ Entities & Inte

System Design

CLAUDE

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. This is an Obsidian personal knowledge base ("second brain") backed by Git. It is not a software

CLAUDE.md

DSA-Visualizer

==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠== You can decompress Drawing data with the command palette: 'Decompress current Excalidraw file'. For more info check in plu

Python

URL Shortener Architecture.excalidraw

==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠== You can decompress Drawing data with the command palette: 'Decompress current Excalidraw file'. For more info check in plu

System Design