Recursion

RecursionInfinite RecursionRecursion with base casePrint name 5 timesPrint from 1 to N (Recursion)Print from N to 1 (Recursion)BacktrackingPrint from 1 to N (Backtracking)Print from N to 1 (Backtracking)Parametrised and Functional…

Design URL Shortening Service

Clarification questionsBack of the envelope estimationsFunctional requirementsAPI'sNon Functional requirementsAvailabilityLatencyReliability (Partition tolerance) Clarification questions How the customer experience will looks like ? Customer may wants to use simple number and letters…

Template for System Design Interview

IntroductionClarification Questions (Scope)Back of the envelope estimates (Metrics)Functional RequirementsNon functional Requirements1. Scalability2. Availability3. Reliability (Partition Tolerance)4. ConsistencyAPI'sHigh Level DesignLow Level DesignVerification Introduction Here, interviewer wants to know how does it…
Distributed System

System Design Concepts

System Design ConceptsScalabilityProblem StatementSingle server designSeparating Server and DatabaseHorizontal vs Vertical ScalingVertical ScalingHorizontal ScalingFailOver StrategiesScaling the DatabaseFailover servers : Cold StandbyFailover servers : Warm StandbyFailover servers : Hot StandbySharding Databases…

Count occurrences of Anagrams

Count occurrences of AnagramsProblem StatementGolang CodeOutputComplexity Count occurrences of Anagrams Problem Statement Anagram is a word, phrase, or sentence formed from another by rearranging its letters.Given two strings pattern and…

DBMS ACID Properties

AtomicityConsistencyIsolationDurabilityKey Takeaways Atomicity All or nothing Either entire transaction succeed or entire transaction fails & gets rolled back. Use transaction to commit when eveything goes well otherwise, rollback the transaction…

Anagram

AnagramWhat is an Anagram?ExampleGroup AnagramsInputOutputLogicGolang codeOutput Anagram What is an Anagram? An anagram is a word or phrase formed by rearranging the letters of another word or phrase, typically using all the…

LRU Cache

LRU CacheExplanationExample Run LRU Cache LRU Cache using a combination of a map and a doubly linked list package main import "fmt" // Node represents a doubly linked list node type Node struct {…