📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

πŸ“š .NET Interview Questions

1325 questions for senior .NET engineer interviews, each with a 30-second answer, the full answer, a deep dive, the follow-ups interviewers ask next, and real-world production problems.

Systems to Design

Full end-to-end designs of the classic interview systems: URL shortener, rate limiter, notifications, chat, payments, banking, checkout and inventory, booking, multi-tenant SaaS, file storage, orders, audit logging, background jobs, identity and gateways.

  1. How do you generate unique, short IDs across many service instances without a single database bottleneck?

    Distributed ID generation for short codes: leased ID ranges, Snowflake-style 64-bit IDs and UUIDv7, with their length, coordination, ordering and failure trade-offs.

    Mid-Level SystemDesign Systems to Design
  2. Design a URL shortener like the ones used in marketing emails and SMS. Clarify the requirements, estimate the scale, then walk me through the API, how you generate short codes, the data model, how redirects stay fast at peak, and what fails first.

    A full URL shortener design: requirements, capacity estimate, API, short-code generation (counter + Base62 vs hashing vs random), data model, read-heavy caching with a CDN and Redis, 301 vs 302 redirects, abuse and failure modes, mapped to Azure and .NET 10.

    Mid-Level SystemDesign Systems to Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  3. Design a rate limiter for a public API used by thousands of partner API keys. Each plan has its own limits, the API runs on many instances in more than one region, and partners need to know when they can retry. Walk me through the algorithm, where the limiter sits, the shared state, and what happens when that state is unavailable.

    A full distributed rate limiter design: requirements and plans, algorithm choice (token bucket vs sliding window), placement (edge, gateway, in-app), shared state in Redis with atomic Lua scripts, per-key and per-region limits, 429 with Retry-After, fail-open vs fail-closed, and the .NET 10 rate limiting middleware.

    Mid-Level SystemDesign Systems to Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  4. Design a notification system that sends email, SMS and push notifications for many product teams. Users have channel preferences and quiet hours, providers fail and throttle, and some messages (password resets) are urgent while others (marketing) are not. Walk me through the API, the pipeline, retries, deduplication and rate limits.

    A full multi-channel notification platform design: requirements, capacity estimate, send API with idempotency keys, templating and preference checks, priority queues per channel, provider adapters with retries, failover and throttling, deduplication, delivery tracking, Spam Act consent, mapped to Azure Service Bus, Communication Services and Notification Hubs.

    Senior SystemDesign Systems to Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  5. Design a chat system like a customer-support or team messaging app: one-to-one and group conversations, real-time delivery to web and mobile, message history, read receipts and offline users. How do you deliver messages in real time with SignalR at scale, store history, keep ordering, and handle reconnects?

    A full chat system design: requirements, connection and message estimates, real-time delivery with ASP.NET Core SignalR and Azure SignalR Service, message storage partitioned by conversation in Cosmos DB, per-conversation sequence numbers, client message ids for dedup, offline delivery via push, read receipts, presence and failure modes.

    Senior SystemDesign Systems to Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  6. Design the payment integration for an Australian e-commerce site that takes card payments through a payment service provider. Walk me through the payment flow and state machine, how you keep PCI DSS scope small, how you make charges idempotent when a request times out, how you handle webhooks, and how you reconcile with the provider's settlement reports.

    A full payment gateway integration design: requirements and volumes, hosted fields and tokenisation to minimise PCI DSS scope, a payment state machine with 3-D Secure, idempotency keys and unknown-outcome handling, verified and deduplicated webhooks, daily reconciliation against settlement reports, and failure modes, in .NET on Azure.

    Senior SystemDesign Systems to Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  7. Design the money-transfer core of a bank or digital wallet: customers move money between their own accounts and to other customers. How do you model the ledger with double-entry bookkeeping, keep balances correct under concurrent transfers, guarantee a transfer is applied exactly once, handle transfers to other banks that settle later, and make everything auditable?

    A full banking transfer design: requirements and volumes, an append-only double-entry ledger with journal entries and postings, balance maintenance with concurrency control and overdraft checks, idempotency keys, pending and clearing accounts for external transfers, hot accounts, auditability with immutable records and SQL ledger tables, and reconciliation, in .NET on Azure SQL.

    Senior SystemDesign Systems to Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  8. Design the checkout for an e-commerce site that must never oversell, including during a Black Friday flash sale where thousands of people try to buy the last few hundred units of one product. Walk me through cart, inventory reservation, payment and order confirmation, how reservations expire, and what happens when payment fails or a service crashes mid-checkout.

    A full e-commerce checkout design: requirements and peak estimates, atomic inventory reservation with expiry, the order saga across inventory, payment and orders with compensation, idempotent steps, hot-SKU contention in flash sales (sub-buckets, Redis counters, waiting room), multi-warehouse stock, and failure modes on Azure.

    Senior SystemDesign Systems to Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  9. Design a booking system that must never double-book: appointments with practitioners at a chain of clinics, or reserved seats for a concert. Walk me through availability search, holding a slot or seat while the customer pays, preventing two people from booking the same thing, cancellations, and surviving a big on-sale rush.

    A full booking system design: requirements and on-sale estimates, slot and seat data models, double-booking prevention with unique constraints or locked range checks, holds with expiry, idempotent confirm with payment, availability caching, waiting rooms for on-sales, time zones and cancellations, on Azure with .NET.

    Senior SystemDesign Systems to Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  10. Design a multi-tenant SaaS platform, for example a rostering or practice-management product sold to hundreds of Australian businesses. Walk me through tenant isolation in the data and compute layers, how you stop one noisy tenant hurting the others, how a new tenant is onboarded, and how you meet a customer who insists their data stays in Australia.

    A full multi-tenant SaaS design: requirements and tenant-mix estimates, tenant resolution, pooled vs siloed data and compute (shared schema with TenantId and row-level security, database per tenant in elastic pools), noisy-neighbour controls, automated onboarding, per-tenant observability and cost, and data residency in Azure Australia East/Southeast.

    Senior SystemDesign Systems to Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  11. Design a file storage and sharing service on Azure Blob Storage, like the document area of a client portal: users upload files up to a few gigabytes, share them with links that expire, and every file is scanned for malware before anyone can download it. Walk me through uploads, downloads, sharing links, scanning, quotas and keeping it secure.

    A full file storage and sharing design: requirements and storage estimates, direct-to-blob uploads with user delegation SAS and block blobs, metadata in Azure SQL, a quarantine-then-scan pipeline with Defender for Storage, expiring share links checked by the API, quotas, lifecycle tiers, and security and privacy controls, on Azure with .NET.

    Senior SystemDesign Systems to Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  12. Design an order management system for a retailer that sells online and in stores: orders flow through payment, stock allocation, fulfilment from a warehouse or store, shipping, cancellations and returns, and several services own those steps. Walk me through the order lifecycle, how services communicate with events, how you keep them consistent without distributed transactions, and how customer service sees where an order is.

    A full order management system design: requirements and order-volume estimates, an explicit order state machine, service boundaries, the transactional outbox and Azure Service Bus for events, an orchestrated saga with compensations and timeouts, idempotent consumers, ordering per order, a read model for order tracking, and failure handling, on Azure with .NET.

    Senior SystemDesign Systems to Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  13. Design an audit logging system for a financial services platform: every change to customer records and every access to sensitive data must be recorded, the log must be tamper-evident so even an administrator can't quietly alter it, investigators must be able to search years of history quickly, and the main application must not slow down. Walk me through capture, storage, integrity, search and retention.

    A full audit logging design: requirements and event-volume estimates, what an audit event contains, reliable capture with an outbox or SaveChanges interceptor, an append-only store with hash chaining and immutable (WORM) storage or SQL Server ledger tables, a separate search index, access control on the audit log itself, and retention under Australian obligations, on Azure with .NET.

    Senior SystemDesign Systems to Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  14. Design a background job system for a SaaS platform: jobs such as sending invoices, generating reports and syncing with partner APIs are triggered by users, by events and on schedules, some are urgent and some can wait, they fail and must be retried, and some must never run twice in a way the customer can see. Walk me through scheduling, queues and priorities, workers, retries, and how you get exactly-once effects.

    A full background job system design: requirements and job-volume estimates, a job table plus Azure Service Bus queues, priorities and per-tenant fairness, a scheduler that is safe on many instances, competing-consumer workers with leases, retries with backoff and dead-lettering, at-least-once delivery with idempotent handlers for exactly-once effects, long jobs, observability, and build vs Hangfire or Durable Functions, on Azure with .NET.

    Senior SystemDesign Systems to Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  15. Your company runs a dozen products with separate sign-ins and wants one identity platform for customers, staff and partner integrations: single sign-on, social logins, MFA, APIs secured with tokens, and machine-to-machine access. Would you build an authentication server yourself, run one such as Duende IdentityServer or Keycloak, or buy a managed service like Microsoft Entra External ID or Auth0? Design the platform and justify the choice.

    A staff-level identity platform design and build-vs-buy decision: requirements and sign-in estimates, OAuth 2.0 and OpenID Connect flows (authorisation code with PKCE, client credentials), token design and lifetimes, signing keys and rotation, workforce vs customer identity (Entra ID vs Entra External ID), migration from separate user stores, availability and security (MFA, Essential Eight), and the costs of building versus running versus buying.

    Staff / Architect SystemDesign Systems to Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  16. Design a distributed cache from scratch, as if Redis didn't exist: it must hold hundreds of gigabytes, serve hundreds of thousands of reads per second at sub-millisecond latency, survive node failures and let you add nodes without a full reshuffle. Walk me through partitioning, replication, eviction, client routing and failure handling, and then tell me what you would actually build and what you would buy.

    A staff-level distributed cache design and build-vs-buy decision: requirements and memory and throughput estimates, consistent hashing or hash slots, replication and failover, eviction (LRU/LFU approximations) and TTLs, client-side routing, hot keys and the thundering herd, consistency with the database, multi-region, and why you would buy Azure Managed Redis and build only the client-side layer (HybridCache, key design, invalidation) in .NET.

    Staff / Architect SystemDesign Systems to Design Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

βͺ Previous 🏠 Main Next ⏩
πŸ’¬ Chat with me