.
NET Advanced
Interview Questions
2026
Microservices, EF Core, Performance & Cloud
■ What You'll Learn
✓ Microservices Architecture & Design Patterns
✓ Entity Framework Core Advanced Concepts
✓ Performance Optimization & Scaling
✓ Distributed Systems & Cloud Architecture
✓ Authentication, Caching & Security
50 Senior-Level Interview Questions
for MNC & Product Companies
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
By: Anand Kumar Yadav
Table of Contents
Part 1: Microservices Architecture Questions 1-10
Part 2: EF Core Advanced Questions 11-20
Part 3: Performance & Scaling Questions 21-40
Part 4: Architecture & Best Practices Questions 41-50
■ Interview Tips
1. Understand the why behind each pattern, not just the what
2. Be prepared to discuss trade-offs and when NOT to use certain patterns
3. Have real-world examples from your experience ready
4. Focus on problem-solving approach rather than memorizing answers
Part 1 — Microservices Architecture
1. What is Microservices Architecture and why is it used?
Microservices architecture is an architectural style where an application is divided into small independent services. Each service runs independently,
has its own database, can be deployed independently, and communicates via APIs or messaging systems.
2. When should you NOT use Microservices?
Avoid microservices for: small teams (less than 5), early stage startups, simple CRUD applications, and low traffic systems. Microservices introduce
distributed system complexity.
3. What are the key components of a .NET Microservices architecture?
Key components: API Gateway (routing, authentication, rate limiting), Service Discovery (Kubernetes DNS, Consul), Message Broker (RabbitMQ,
Kafka), Distributed Logging (ELK stack, Seq), and Containerization (Docker, Kubernetes).
4. What is an API Gateway and why is it important?
API Gateway is the entry point for all client requests. Responsibilities include routing, authentication (JWT validation), rate limiting, and response
aggregation from multiple services.
5. What is the Saga Pattern?
Saga pattern manages distributed transactions in microservices. It handles failures across multiple databases by compensating previous actions when
a step fails. Two types: Choreography (event-based) and Orchestration (central coordinator).
6. What is CQRS?
CQRS (Command Query Responsibility Segregation) separates read and write operations using different databases. Benefits: faster reads,
independent scaling, optimized models.
7. What is Idempotency in APIs?
Idempotency ensures multiple identical requests produce the same result. Use Idempotency Key header to prevent duplicate processing from network
retries.
8. What is Synchronous vs Asynchronous communication?
Synchronous: Service calls another directly (tight coupling, failure propagation). Asynchronous: Services communicate through events/queues (loose
coupling, better scalability).
9. What is Circuit Breaker Pattern?
Circuit breaker prevents cascading failures by stopping calls to failing services. States: Closed (normal), Open (stop calls), Half-open (test recovery).
10. What is Event Driven Architecture?
Services communicate via events instead of direct API calls. Benefits: loose coupling, scalability, better fault tolerance. Technologies: Kafka,
RabbitMQ, Azure Event Hub.
Part 2 — EF Core Advanced (Q11–20)
11. What is Entity Framework Core and how does it work internally?
EF Core is an ORM for .NET. It translates C# object-oriented code to SQL. Workflow: Entity Classes → DbContext → LINQ Queries → Query
Translator → SQL Query → Database.
12. What is Change Tracking in EF Core?
Change Tracking detects modifications to entities. Entity states: Added (insert), Modified (update), Deleted (delete), Unchanged (no changes),
Detached (not tracked).
13. What is Tracking vs No-Tracking Query?
Tracking: Default behavior, allows updates but uses memory. No-Tracking: AsNoTracking() for read-only queries, faster and less memory usage.
14. What is the N+1 Query Problem?
N+1 occurs when one query for parent is followed by multiple queries for child entities. Solution: Use Include() for eager loading.
15. What is Lazy Loading vs Eager Loading vs Explicit Loading?
Lazy: Data loads when accessed. Eager: Include() loads immediately. Explicit: Manually load related entities. Choose based on requirements.
16. What are Compiled Queries?
Compiled queries cache query plans for repeated queries. Benefits: faster execution, reduced CPU overhead, good for high-frequency queries.
17. How does EF Core handle Transactions?
SaveChanges() automatically wraps operations in a transaction. Use BeginTransaction() for manual control with Commit() and Rollback().
18. What are Indexes and how do they improve performance?
Indexes speed up database queries. Without indexes: full table scans. With indexes: direct lookup. Create using HasIndex() method.
19. What are Bulk Operations?
EF Core processes one record at a time. Bulk operations ([Link], Dapper) are much faster for large datasets.
20. What are common EF Core performance optimization techniques?
Use AsNoTracking, Projections, Indexes, Avoid N+1, Compiled Queries, Pagination, Connection Pooling.
Part 3 — Performance & Scaling (Q21–40)
21. What is asynchronous programming in .NET?
Async allows threads to start operations and continue without waiting. Uses async/await keywords. Improves scalability by reusing threads from thread
pool.
22. What is the Thread Pool?
Collection of worker threads managed by .NET runtime. Reuses threads instead of creating new ones, reducing memory and OS scheduling overhead.
23. What is Garbage Collection (GC)?
Automatic memory management. Uses generational GC: Gen 0 (short-lived), Gen 1 (medium), Gen 2 (long-lived).
24. What is Memory Leak in .NET?
Objects remain referenced even when unused. Common causes: static references, unremoved event handlers, unlimited caching.
25. What is Response Caching?
Stores HTTP responses to serve repeated requests faster. Use [ResponseCache(Duration=60)] attribute.
26. What is Distributed Caching?
Centralized cache (Redis, Memcached) shared across multiple server instances for consistency.
27. What is Output Caching?
Server-controlled caching of entire HTTP response. More powerful than response caching.
28. Best practices to improve API performance:
Use async everywhere, pagination, caching, optimize queries, enable compression, connection pooling.
29. What is Load Balancing?
Distributes traffic across multiple servers. Types: Round Robin, Least Connections, IP Hash.
30. What is Horizontal vs Vertical Scaling?
Vertical: Increase power of single machine (limited). Horizontal: Add more servers (infinite scalability).
31. What is a Distributed System?
Multiple independent computers work together appearing as single system. Characteristics: scalability, fault tolerance, high availability.
32. What is the CAP Theorem?
Distributed systems guarantee only 2 of 3: Consistency, Availability, Partition Tolerance.
33. What is Eventual Consistency?
Data becomes consistent across nodes after some time. Used for massive scalability (DynamoDB, Cassandra).
34. What is Message Queue?
Enables asynchronous communication. Examples: RabbitMQ, Kafka, Azure Service Bus.
35. What is Event Sourcing?
Store state changes as sequence of events instead of updating records. Benefits: audit history, debugging, time travel.
36. What is API Rate Limiting?
Restricts requests per user/timeframe. Protects from abuse, DDoS, traffic spikes.
37. What is Distributed Tracing?
Track requests across multiple services. Tools: OpenTelemetry, Jaeger, Zipkin.
38. What is Service Mesh?
Manages service communication using sidecar proxies. Responsibilities: routing, load balancing, security, observability.
39. What is Containerization?
Packages application with dependencies in portable container. Ensures consistency across environments.
40. What is Kubernetes?
Container orchestration platform. Automates deployment, scaling, networking, failover.
Part 4 — Architecture & Best Practices (Q41–50)
41. What is Dependency Injection (DI)?
Design pattern for loose coupling. Dependencies provided externally instead of created inside class.
42. What are Service Lifetimes?
Transient: new instance every time. Scoped: one per HTTP request. Singleton: one for entire app (DbContext should never be singleton).
43. What is Middleware?
Component handling HTTP requests/responses in pipeline. Can process request, call next middleware, modify response.
44. What is Authentication vs Authorization?
Authentication: verifies who user is. Authorization: determines what user is allowed to do.
45. What is JWT Authentication?
Token-based auth with [Link] structure. Stateless, scales in microservices.
46. What is Clean Architecture?
Separates code into layers: Presentation, Application, Domain, Infrastructure. Dependencies point inward.
47. What is Repository Pattern?
Abstracts database operations. Benefits: encapsulation, testability. Debate: EF Core already acts as repository.
48. EF Core vs Dapper:
EF Core: Full ORM, slower. Dapper: Micro ORM, faster. Strategy: use both for CRUD and performance queries.
49. IEnumerable vs IQueryable vs List:
IEnumerable: in-memory. IQueryable: database queries (SQL translation). List: concrete collection.
50. Common mistakes in large .NET systems:
Overusing microservices, poor database design, blocking async code, ignoring caching, missing observability.
Ready to Master .NET?
Excel in your technical interviews
Best of Luck!
Master these concepts through practice
and gain confidence in interviews
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
By: Anand Kumar Yadav