Back-of-the-envelope EstimationSystem Design
QPS, storage, bandwidth కోసం త్వరిత order-of-magnitude లెక్కలు — boxes గీయకముందే డిజైన్లను చేర్చుతాయి లేదా తోసిపుచ్చుతాయి.
System Design పునాదులు →Algorithms, system design, distributed systems, AI లకు చెందిన 59 పదాలు — ప్రతిదీ దాన్ని బోధించే కోర్సుకు లింక్ చేయబడింది.
QPS, storage, bandwidth కోసం త్వరిత order-of-magnitude లెక్కలు — boxes గీయకముందే డిజైన్లను చేర్చుతాయి లేదా తోసిపుచ్చుతాయి.
System Design పునాదులు →ఎంపికలపై depth-first search, అభ్యర్థిని దశలవారీగా నిర్మించి, ప్రతి దశను అన్వేషించాక undo చేస్తుంది.
Recursion & Backtracking →Array లో వెతకడం బదులు సాధ్యమైన సమాధానాలపై (capacity, speed, days) monotone feasibility check తో binary search.
Binary Search →చాలా requests ఒకేసారి cache miss అయి (తరచూ expiry తర్వాత) backing store ను ఓవర్లోడ్ చేస్తాయి; locking, request coalescing లేదా ముందస్తు refresh తో నివారణ.
Real-time & Streaming →Application మొదట cache నుంచి చదువుతుంది, miss అయితే database నుంచి లోడ్ చేసి తానే cache నింపుతుంది.
System Design పునాదులు →Network partition సమయంలో distributed system consistency, availability మధ్య ఒకటి ఎంచుకోవాలి.
Replication & Consistency Models →Content Delivery Network: భౌగోళికంగా విస్తరించిన caches, static, cache చేయగల content ను users దగ్గర నుంచి అందిస్తాయి.
System Design పునాదులు →Error పరిమితి దాటాక విఫలమవుతున్న dependency ని పిలవడం ఆపేస్తుంది, వేగంగా fail అవుతూ, కోలుకునే వరకు అప్పుడప్పుడు పరీక్షిస్తుంది.
Fault Tolerance & Graceful Degradation →Keys, nodes ను ఒక ring పై ఉంచడం, తద్వారా node జోడించినా తీసివేసినా దాని పక్కనున్న keys మాత్రమే కదులుతాయి.
Partitioning & Sharding →ఒక request లో model దృష్టి పెట్టగల గరిష్ఠ tokens సంఖ్య, prompt, దాని సొంత output తో సహా.
LLM పునాదులు →Conflict-free Replicated Data Type: ఏకకాల updates coordination లేకుండా ఎల్లప్పుడూ నిర్ణీతంగా merge అయ్యే structure.
Replication & Consistency Models →పదేపదే processing లో విఫలమయ్యే messages ను సేకరించే queue, ప్రధాన ప్రవాహాన్ని ఆపకుండా వాటిని పరిశీలించడానికి.
System Design పునాదులు →Non-negative weights ఉన్న graphs పై single-source shortest paths, priority queue తో అత్యంత దగ్గరి unvisited node ను విస్తరిస్తుంది.
Graph →ప్రతి transaction accounts అంతటా సమాన debits, credits నమోదు చేస్తుంది, కాబట్టి balances ఎల్లప్పుడూ సరిపోతాయి — payment systems కి ఆధారం.
డబ్బు & Ledgers →టెక్స్ట్ (లేదా images) యొక్క dense vector రూపం, ఇందులో అర్థ సారూప్యత జ్యామితీయ సామీప్యంగా మారుతుంది.
Retrieval-Augmented Generation (RAG) →Writes ఆగితే అన్ని replicas చివరికి ఒకే value కి చేరతాయి; మధ్యలో reads పాతవి కావచ్చు.
Replication & Consistency Models →Greedy algorithms కోసం proof పద్ధతి: ఏ optimal పరిష్కారం ఎంపికనైనా greedy ఎంపికతో మార్చడం దాన్ని ఎప్పుడూ దిగజార్చదని చూపడం.
Greedy →ప్రతి కొత్త post ను write సమయంలోనే ప్రతి follower యొక్క ముందే లెక్కించిన feed లోకి నెట్టడం; reads వేగం, కానీ భారీ following ఉన్న accounts కి ఖరీదు.
Real-time Fan-out & Push →వేర్వేరు వేగాలతో కదిలే రెండు pointers — cycles గుర్తించడానికి (Floyd's algorithm), linked list మధ్యను కనుగొనడానికి ఉపయోగిస్తారు.
Linked List →Lock లేదా lease తో జారీ చేసే క్రమంగా పెరిగే సంఖ్య, lease ముగిసిన holder writes ను storage తిరస్కరించడానికి.
Locks & Coordination →ప్రకటించిన tool కోసం model structured arguments ఇవ్వడం, applications సహజ భాష నుంచి నిజమైన చర్యలు చేయడానికి.
Prompt Engineering & Structured Output →Latitude/longitude ను string గా encode చేయడం, ఇందులో ఉమ్మడి prefix అంటే దగ్గరి cells — locations ను index, query చేసే సులభ మార్గం.
Location & Mobility →Hierarchical Navigable Small World graph: వేగవంతమైన approximate nearest-neighbour vector search కి అత్యంత సాధారణ index.
Storage Engines & Indexing →Request ఫలితంతో పాటు నిల్వ చేసే client-సృష్టించిన ప్రత్యేక key, retries side effects పునరావృతం చేయకుండా మూల ఫలితాన్నే ఇవ్వడానికి.
Idempotency & Exactly-once →Linear-time maximum subarray sum: ప్రతి index వద్ద మునుపటి subarray ను పొడిగించండి లేదా కొత్తగా ప్రారంభించండి.
Dynamic Programming →ఇప్పటికే process అయిన tokens attention keys, values నిల్వ, generation ప్రతి దశలో మొత్తం prefix ను మళ్లీ లెక్కించకుండా.
LLM Serving, ఖర్చు & Performance →ప్రతి event వద్ద పెరిగి, message అందినప్పుడు merge అయ్యే logical counter — causality కి సరిపోయే క్రమాన్ని ఇస్తుంది.
Time, Clocks & Ordering →అత్యంత బలమైన single-object consistency: ప్రతి operation తన ప్రారంభం, ముగింపు మధ్య ఒక బిందువు వద్ద atomically అమలైనట్లు కనిపిస్తుంది.
Replication & Consistency Models →Rubric తో ఒక model ను వాడి మరో model outputs ను భారీ స్థాయిలో మూల్యాంకనం చేయడం; human labels తో calibrate చేస్తారు.
Evaluation & Guardrails →Log-Structured Merge tree: writes ను memory లో buffer చేసి, sorted files flush చేసి compact చేస్తుంది — భారీ write loads కి అనుకూలం.
Storage Engines & Indexing →Model Context Protocol: ఉమ్మడి interface ద్వారా AI applications కి tools, resources, prompts అందించే ఓపెన్ ప్రమాణం.
Agents & Tool Use →Recursive call ఫలితాన్ని దాని arguments ఆధారంగా cache చేయడం, తద్వారా overlapping subproblems ఒకసారి మాత్రమే లెక్కించబడతాయి — top-down dynamic programming.
Dynamic Programming →పెరుగుతున్న లేదా తగ్గుతున్న క్రమంలో ఉంచిన stack; ప్రతి pop ఒక 'next greater / smaller element' ప్రశ్నను amortised O(1) లో పరిష్కరిస్తుంది.
Stack & Queue →Lead agent పనిని విభజించి, ఉప-పనులను workers కి అప్పగించి, వారి ఫలితాలను సమన్వయపరిచే multi-agent ప్యాటర్న్.
Agentic AI Systems & Orchestration →CAP విస్తరణ: Partition అయితే Availability లేదా Consistency ఎంచుకోండి; లేకపోతే (Else) Latency లేదా Consistency.
Replication & Consistency Models →ఒక running total, ఇందులో prefix[i] మొదటి i elements మొత్తాన్ని ఉంచుతుంది, కాబట్టి ఏ range మొత్తమైనా prefix[r] − prefix[l] గా O(1) లో వస్తుంది.
Array →AI సిస్టమ్ సూచనలను మార్చడానికి ప్రయత్నించే నమ్మలేని input — tools ఉన్న agents కి ప్రధాన security ఆందోళన.
AI System Design →2D space ను పదేపదే నాలుగు భాగాలుగా విభజించే tree, proximity search కోసం points సాంద్రతకు తగ్గట్టు cell పరిమాణం మారుస్తుంది.
Location & Mobility →Model weights ను తక్కువ bits (8-bit, 4-bit) లో సూచించడం, స్వల్ప ఖచ్చితత్వ రాజీతో memory, ఖర్చు తగ్గించడానికి.
LLM Serving, ఖర్చు & Performance →Read లేదా write ను ఆమోదించాల్సిన కనీస replicas సంఖ్య; W + R > N అయితే reads తాజా write ను చూస్తాయి.
Replication & Consistency Models →అర్థం చేసుకోవడానికి సులభమైన consensus algorithm — leader election, log replication, safety నియమాలతో నిర్మితం; etcd, Consul లో వాడతారు.
Consensus & Leader Election →Retrieval-Augmented Generation: query సమయంలో సంబంధిత documents ను తెచ్చి model కి ఇవ్వడం, సమాధానాలు ఆధారసహితంగా, citable గా ఉండటానికి.
Retrieval-Augmented Generation (RAG) →Generation కి ముందు అగ్ర retrieved passages క్రమాన్ని మార్చే రెండో, మరింత ఖచ్చితమైన model (తరచూ cross-encoder).
Retrieval-Augmented Generation (RAG) →పని పూర్తయ్యే వరకు reasoning steps ను actions (tool calls), observations తో మార్చి మార్చి నడిపే agent ప్యాటర్న్.
Agents & Tool Use →Local steps గా విభజించిన దీర్ఘ transaction, తర్వాతి step విఫలమైతే undo చేయడానికి ప్రతి step కి compensating action ఉంటుంది.
Distributed Transactions →ఒక invariant ను కాపాడుతూ కుడివైపు పెరిగి ఎడమవైపు కుదించుకునే వరుస range, subarray సమాధానాలను linear time లో ఇస్తుంది.
Sliding Window →Next-token distribution ను పదునుగా (తక్కువ) లేదా సమంగా (ఎక్కువ) చేసే sampling parameter — determinism కి బదులు వైవిధ్యం.
LLM పునాదులు →Request నుంచి మొదటి streamed token వరకు latency — chat interfaces లో users ఎక్కువగా అనుభవించే సంఖ్య.
LLM Serving, ఖర్చు & Performance →Language model చదివి రాసే యూనిట్ — tokenizer తయారు చేసే పద ముక్క. ఖర్చు, latency, context limits tokens లో లెక్కిస్తారు.
LLM పునాదులు →Tokens స్థిర రేటుతో నిండి, ప్రతి request ఒకటి ఖర్చు చేసే rate limiter — bucket size వరకు చిన్న bursts ను అనుమతిస్తుంది.
Rate Limiting & Admission Control →Directed acyclic graph nodes యొక్క రేఖీయ క్రమం, ఇందులో ప్రతి edge ముందుకు చూపుతుంది; Kahn's BFS లేదా DFS post-order తో కనుగొంటారు.
Graph →బయటికి వెళ్లే event ను state change ఉన్న అదే transaction లో outbox table కి రాసి, తర్వాత broker కి నమ్మకంగా పంపడం.
Distributed Transactions →Stream యొక్క కింది సగానికి max-heap, పై సగానికి min-heap — ప్రతి insert కి O(log n) లో running median ఇస్తుంది.
Heap →ఒక sequence గుండా కదిలే రెండు indices — ఒకదాని వైపు ఒకటి లేదా ఒకే దిశలో — nested loop బదులు ఒక్క pass సరిపోయేలా.
Array →Coordinator అన్ని participants ను మొదట prepare, తర్వాత commit చేయమంటుంది; nodes అంతటా atomic, కానీ coordinator విఫలమైతే ఆగిపోతుంది.
Distributed Transactions →Path compression, union by rank తో దాదాపు-స్థిర find, union operations ఉన్న disjoint-set structure.
Graph →రెండు events causally క్రమంలో ఉన్నాయా లేక concurrent గా ఉన్నాయా చెప్పగల ప్రతి-node counters vector.
Time, Clocks & Ordering →Stream processing లో, సమయం T కంటే పాత events రావని ప్రకటించే marker — windows మూసి ఫలితాలు ఇవ్వడానికి.
Stream Processing & Aggregation →Data pages మారకముందే రాసే append-only log, crash తర్వాత database committed మార్పులను తిరిగి పొందడానికి.
Storage Engines & Indexing →