{"count":25,"generatedAt":"2026-11-27T15:07:09.101Z","categories":[{"key":"fullstack","title":"Full Stack Interview Questions","description":"JavaScript, React, networking and databases — the rounds that gate every web role.","url":"https://cscosmos.vercel.app/interview/fullstack","questions":[{"slug":"what-happens-when-you-type-a-url","title":"What happens when you type a URL and press Enter?","topic":"Browser","difficulty":"beginner","frequency":"very-often","round":"phone-screen","type":"concept","companies":["Google","Cloudflare","Amazon"],"tags":["dns","tls","http","rendering"],"oneLiner":"The classic warm-up question that secretly tests how deep your mental model of the web goes.","url":"https://cscosmos.vercel.app/interview/fullstack/what-happens-when-you-type-a-url"},{"slug":"useeffect-runs-twice-strict-mode","title":"Why does my useEffect run twice in Strict Mode?","topic":"React","difficulty":"intermediate","frequency":"very-often","round":"coding","type":"debugging","companies":["Meta","Vercel","Shopify"],"tags":["react","useeffect","strict-mode","cleanup"],"oneLiner":"Your effect fires twice in development and once in production — the right answer is cleanup, not removing StrictMode.","url":"https://cscosmos.vercel.app/interview/fullstack/useeffect-runs-twice-strict-mode"},{"slug":"event-loop-timeout-vs-promise-order","title":"What does this event-loop snippet print?","topic":"JavaScript","difficulty":"intermediate","frequency":"very-often","round":"coding","type":"coding","companies":["Google","Microsoft","Meta"],"tags":["javascript","event-loop","microtasks","promises","settimeout"],"oneLiner":"A four-line snippet that separates people who memorized \"microtasks before macrotasks\" from those who can run the queues in their head.","url":"https://cscosmos.vercel.app/interview/fullstack/event-loop-timeout-vs-promise-order"},{"slug":"database-indexes-btree-tradeoffs","title":"How do database indexes work, and when do they hurt?","topic":"Databases","difficulty":"intermediate","frequency":"sometimes","round":"concept","type":"concept","companies":["Amazon","Uber","Meta"],"tags":["databases","indexes","b-tree","query-planner"],"oneLiner":"A B+Tree is a tiny table of contents that turns a million-row scan into a handful of page reads — until writes and row lookups tip the balance.","url":"https://cscosmos.vercel.app/interview/fullstack/database-indexes-btree-tradeoffs"},{"slug":"cors-preflight-when-fetch-fails","title":"Why does my fetch to another origin fail with a CORS error?","topic":"Browser","difficulty":"intermediate","frequency":"very-often","round":"concept","type":"debugging","companies":["Stripe","Shopify","Microsoft"],"tags":["cors","http","headers","browser-security","preflight"],"oneLiner":"The request succeeds on the network, yet JavaScript never sees the response — CORS is the browser insisting the other origin opts in before the read is allowed.","url":"https://cscosmos.vercel.app/interview/fullstack/cors-preflight-when-fetch-fails"},{"slug":"n-plus-one-queries-orm","title":"Why does a single page fire 101 database queries?","topic":"Databases","difficulty":"intermediate","frequency":"very-often","round":"concept","type":"debugging","companies":["Shopify","Stripe","Atlassian"],"tags":["orm","n+1","sql","dataloader","performance"],"oneLiner":"One query becomes 101 because the ORM loads relations lazily — the fix is one join or one batch, but the interview is about proving you know why.","url":"https://cscosmos.vercel.app/interview/fullstack/n-plus-one-queries-orm"},{"slug":"rendering-strategy-ssr-ssg-isr-csr","title":"How do you choose between CSR, SSR, SSG and ISR?","topic":"Architecture","difficulty":"intermediate","frequency":"very-often","round":"system-design","type":"design","companies":["Vercel","Shopify","Netflix"],"tags":["next.js","rendering","architecture","caching","trade-offs"],"oneLiner":"Four acronyms, one question underneath: when is the HTML built? The architecture decision is picking per route — not per app.","url":"https://cscosmos.vercel.app/interview/fullstack/rendering-strategy-ssr-ssg-isr-csr"},{"slug":"transaction-isolation-levels-anomalies","title":"What do transaction isolation levels actually prevent?","topic":"Databases","difficulty":"advanced","frequency":"very-often","round":"concept","type":"concept","companies":["Amazon","Uber","Stripe"],"tags":["sql","transactions","isolation","acid","concurrency"],"oneLiner":"Every level answers one question — what may a transaction promise about what it read? — and stronger promises are paid for in conflicts and retries.","url":"https://cscosmos.vercel.app/interview/fullstack/transaction-isolation-levels-anomalies"},{"slug":"exactly-once-payment-retries","title":"Design a payment that charges exactly once — through retries and crashes","topic":"Architecture","difficulty":"advanced","frequency":"very-often","round":"system-design","type":"design","companies":["Stripe","Razorpay","PayPal"],"tags":["payments","idempotency","outbox-pattern","queues","consistency"],"oneLiner":"The card is charged but the crash eats the record — exactly-once charging is not inherited from any tool, it is built from a unique constraint, an outbox, and idempotent effects everywhere.","url":"https://cscosmos.vercel.app/interview/fullstack/exactly-once-payment-retries"},{"slug":"csv-pipeline-10m-rows-live-progress","title":"Design a pipeline that ingests a 10-million-row CSV with live progress","topic":"Architecture","difficulty":"advanced","frequency":"sometimes","round":"system-design","type":"design","companies":["Amazon","Flipkart","Razorpay"],"tags":["streams","queues","idempotency","websockets","postgres"],"oneLiner":"A 10M-row upload is not one job — it is tens of thousands of small idempotent chunks, with Postgres as the only source of truth for progress and the WebSocket as its fast path.","url":"https://cscosmos.vercel.app/interview/fullstack/csv-pipeline-10m-rows-live-progress"},{"slug":"collaborative-editor-ot-crdt-conflicts","title":"Design real-time collaboration — and what survives a disconnect","topic":"Architecture","difficulty":"advanced","frequency":"sometimes","round":"system-design","type":"design","companies":["Google","Figma","Notion","Microsoft"],"tags":["websockets","ot","crdt","redis","consistency"],"oneLiner":"Operations are relative and go stale, so the real design question is who holds the order — a central transformer (OT) or a mergeable data structure (CRDT) — and what survives a disconnect.","url":"https://cscosmos.vercel.app/interview/fullstack/collaborative-editor-ot-crdt-conflicts"}]},{"key":"cybersecurity","title":"Cybersecurity Interview Questions","description":"XSS, CSRF and auth-token attacks: think like an attacker, defend like an engineer.","url":"https://cscosmos.vercel.app/interview/cybersecurity","questions":[{"slug":"xss-attack-and-defense","title":"How does XSS work, and how do you defend against it?","topic":"Web Security","difficulty":"beginner","frequency":"very-often","round":"concept","type":"concept","companies":["Google","Meta","Cloudflare"],"tags":["xss","csp","sanitization","output-encoding","browser-security"],"oneLiner":"The browser cannot tell your code from an attacker payload — every XSS defense is about keeping data out of the HTML parser.","url":"https://cscosmos.vercel.app/interview/cybersecurity/xss-attack-and-defense"},{"slug":"jwt-localstorage-risk","title":"Why is storing JWTs in localStorage dangerous?","topic":"Authentication","difficulty":"intermediate","frequency":"very-often","round":"concept","type":"concept","companies":["Stripe","Auth0","PayPal"],"tags":["jwt","localstorage","httponly","cookies","token-rotation"],"oneLiner":"A JWT is a bearer token: one XSS payload that reads localStorage silently walks away with an account that stays valid until expiry.","url":"https://cscosmos.vercel.app/interview/cybersecurity/jwt-localstorage-risk"},{"slug":"csrf-how-and-samesite","title":"How does CSRF work when the attacker cannot read cookies?","topic":"Web Security","difficulty":"intermediate","frequency":"very-often","round":"concept","type":"concept","companies":["PayPal","Stripe","Google"],"tags":["csrf","samesite","cookies","csrf-tokens","same-origin-policy"],"oneLiner":"The attacker never reads the cookie — the browser volunteers it because cookies follow the destination, not the page that sent you there.","url":"https://cscosmos.vercel.app/interview/cybersecurity/csrf-how-and-samesite"},{"slug":"login-csrf-oauth-state","title":"How does login CSRF work in an OAuth callback?","topic":"Web Security","difficulty":"advanced","frequency":"sometimes","round":"concept","type":"concept","companies":["Stripe","Google","Okta"],"tags":["login-csrf","oauth-state","session-fixation","callback-binding","csrf","oauth2"],"oneLiner":"A signed session ID proves the server made the login URL, not that the browser finishing the login is the one that asked for it.","url":"https://cscosmos.vercel.app/interview/cybersecurity/login-csrf-oauth-state"}]},{"key":"dsa","title":"DSA Interview Questions","description":"Patterns, proofs and complexity — from brute force to the optimal solution.","url":"https://cscosmos.vercel.app/interview/dsa","questions":[{"slug":"two-sum-brute-force-to-hashmap","title":"Two Sum: from brute force to a one-pass hash map","topic":"Arrays & Hashing","difficulty":"beginner","frequency":"very-often","round":"coding","type":"coding","companies":["Amazon","Microsoft","Google"],"tags":["arrays","hash-map","complexity","two-sum"],"oneLiner":"The gateway question: replace the nested loops with a hash map and turn the search inside out in one pass.","url":"https://cscosmos.vercel.app/interview/dsa/two-sum-brute-force-to-hashmap"},{"slug":"kmp-linear-string-matching","title":"KMP: linear-time substring search with LPS","topic":"Strings","difficulty":"advanced","frequency":"sometimes","round":"coding","type":"coding","companies":["Google","Microsoft","Adobe"],"tags":["strings","kmp","pattern-matching","lps"],"oneLiner":"Naive search rewinds the text pointer on every mismatch; KMP precomputes a failure table so the text is read once and never revisited.","url":"https://cscosmos.vercel.app/interview/dsa/kmp-linear-string-matching"},{"slug":"lru-cache-hashmap-doubly-linked-list","title":"Design an LRU cache with O(1) get and put","topic":"Caching & Design","difficulty":"advanced","frequency":"very-often","round":"system-design","type":"design","companies":["Amazon","Google","Uber"],"tags":["lru","cache","hash-map","linked-list","design"],"oneLiner":"Everything hinges on one design move: a hash map to find the node and a doubly linked list to reorder it, both in constant time.","url":"https://cscosmos.vercel.app/interview/dsa/lru-cache-hashmap-doubly-linked-list"},{"slug":"floyd-cycle-detection","title":"Floyd's cycle detection: slow, fast, then reset","topic":"Linked Lists","difficulty":"intermediate","frequency":"sometimes","round":"coding","type":"coding","companies":["Amazon","Microsoft","Adobe"],"tags":["linked-list","two-pointers","cycle-detection","floyd"],"oneLiner":"Two pointers, no extra memory: the fast one laps the slow one inside a cycle, and one reset finds exactly where the loop begins.","url":"https://cscosmos.vercel.app/interview/dsa/floyd-cycle-detection"}]},{"key":"system-design","title":"System Design Interview Questions","description":"Scale, caching and traffic control — design decisions and the math behind them.","url":"https://cscosmos.vercel.app/interview/system-design","questions":[{"slug":"design-url-shortener","title":"Design a URL shortener at scale","topic":"Scalability","difficulty":"intermediate","frequency":"very-often","round":"system-design","type":"design","companies":["Google","Amazon","Microsoft"],"tags":["url-shortener","scalability","caching","key-value-store","id-generation"],"oneLiner":"A read-dominated system whose entire design funnels into one decision: how to generate tiny, unique keys — random ones are unguessable, while counter and Snowflake IDs stay unpredictable only if the sequence state stays secret.","url":"https://cscosmos.vercel.app/interview/system-design/design-url-shortener"},{"slug":"consistent-hashing-virtual-nodes","title":"Explain consistent hashing and virtual nodes","topic":"Scalability","difficulty":"advanced","frequency":"very-often","round":"system-design","type":"concept","companies":["Amazon","Google","Cloudflare"],"tags":["consistent-hashing","sharding","virtual-nodes","scalability"],"oneLiner":"Modulo hashing reshuffles nearly every key when the node count changes; a consistent-hash ring with virtual nodes moves only the minimum.","url":"https://cscosmos.vercel.app/interview/system-design/consistent-hashing-virtual-nodes"},{"slug":"rate-limiter-design","title":"Design a distributed rate limiter","topic":"Traffic","difficulty":"intermediate","frequency":"very-often","round":"system-design","type":"design","companies":["Cloudflare","Stripe","Amazon"],"tags":["rate-limiting","token-bucket","redis","traffic-control"],"oneLiner":"A rate limiter is a distributed race: pick an algorithm, make one shared counter atomic, and give clients a clean 429 contract.","url":"https://cscosmos.vercel.app/interview/system-design/rate-limiter-design"}]},{"key":"ai-ml","title":"AI / ML Interview Questions","description":"Transformers, RAG and training internals — the questions behind modern AI roles.","url":"https://cscosmos.vercel.app/interview/ai-ml","questions":[{"slug":"why-attention-scales-by-sqrt-dk","title":"Why does attention scale the logits by √d_k?","topic":"Transformers","difficulty":"advanced","frequency":"sometimes","round":"concept","type":"concept","companies":["Google","OpenAI","Anthropic"],"tags":["transformers","attention","softmax","scaling","gradients"],"oneLiner":"The 1/√d_k factor looks like a footnote, but it decides whether attention learns or saturates into one-hot weights.","url":"https://cscosmos.vercel.app/interview/ai-ml/why-attention-scales-by-sqrt-dk"},{"slug":"rag-end-to-end-pipeline","title":"Design a RAG pipeline end to end","topic":"RAG","difficulty":"intermediate","frequency":"very-often","round":"system-design","type":"design","companies":["OpenAI","Google","Anthropic"],"tags":["rag","vector-search","embeddings","reranking","grounding"],"oneLiner":"Two pipelines, one grounded answer: ingestion makes knowledge retrievable, query turns a question into a cited response.","url":"https://cscosmos.vercel.app/interview/ai-ml/rag-end-to-end-pipeline"},{"slug":"backpropagation-gradient-flow","title":"How does backpropagation compute every gradient?","topic":"Training","difficulty":"intermediate","frequency":"very-often","round":"concept","type":"concept","companies":["Google","NVIDIA","Meta"],"tags":["backpropagation","chain-rule","gradients","optimization","vanishing-gradients"],"oneLiner":"One forward pass computes the loss; one backward pass applies the chain rule to every weight; one step moves them downhill.","url":"https://cscosmos.vercel.app/interview/ai-ml/backpropagation-gradient-flow"}]}]}