In-depth technical notes on Go concurrency, memory management, garbage collection internals, performance profiling, hexagonal architecture, and design patterns.
Concurrency & Channels Channel Types 1. Unbuffered Channel Behavior: An unbuffered channel has zero capacity (make(chan int)). Synchronization: Requires both sender and receiver to be ready at the exact same moment. Send blocks until a receiver is ready, and receive blocks until a sender is ready. Use Case: Strict point-to-point synchronization between goroutines.
Core architectural principles, decomposition strategies, distributed design patterns, resilience mechanisms, and deployment strategies for microservices systems.
Monolith vs Microservices Architecture Criteria Monolithic Architecture Microservices Architecture Development Single codebase, straightforward local debugging Multiple repositories/services, polyglot tech stacks Deployment Single unit deployment (all-or-nothing) Independent, continuous deployments per service Scaling Vertical scaling or duplicate entire monolith Horizontal, granular scaling based on resource needs Fault Isolation Low (a memory leak or crash impacts whole app) High (failure in one service does not crash others) Complexity Low operational overhead; high codebase coupling High operational complexity (distributed network overhead) Microservice Decomposition Strategies How to break down a domain into microservices:
Comprehensive notes on Relational Databases (SQL), In-Memory Caching (Redis), and Distributed Message Brokers (Kafka & RabbitMQ) for technical interviews and system architecture design.
Relational Databases (SQL) SQL vs NoSQL ACID Properties in Relational Databases Atomicity: All operations in a transaction succeed or fail together. If any operation fails, the entire transaction is rolled back. (e.g. transfer money from Account A to Account B). Consistency: Any transaction brings the database from one valid state to another, strictly obeying all schema rules, constraints, triggers, and cascades.
Operating System Internals & Linux Table of Contents Processes Process Concept Process States & Types Threads Process vs Thread Context Switching Memory Management (Stack vs Heap, Virtual Memory) Cron & Scheduling Storage & Mount Disk Essential Linux Troubleshooting Commands Processes Process Concept A running instance of a program is called a process and it runs in its own memory space. Each time you execute a command, a new process starts. An active process also includes the resources the program needs to run.
OOP Encapsulation: Grouping data and methods that operate on the data together, and restricting access to some components. Là quá trình ẩn đi các chi tiết bên trong của một đối tượng và chỉ cung cấp một giao diện rõ ràng cho người dùng (hay các đối tượng khác) để tương tác type Car struct { brand string speed int } func (c *Car) setSpeed(s int) { c.speed = s } func (c *Car) getSpeed() int { return c.
Architecture Overview Master Node: - Responsible for managing the K8s cluster, storing information about the nodes, containers, ... ETCD: - Database that stores informations in key-value format Scheduler - Identifies the right node to place a container based on the containers resource requirements, worker policies, constraints, ... - Controllers: - Types: - Node Controller: Responsible for onboarding new nodes to the cluster, handling situations where nodes are unavailable or get destroyed, - Replication Controller: ensures that the desired number of containers are running at all times in a replication group - Workflows: - Monitoring status from the nodes and taking some actions to keep applications running.