Skip to main content

General .NET Developer Interview Questions

๐ŸŽฏ Focus Areas

SOLID principles, clean code, system design basics, HR questions, career path. Round 2-3 of most .NET interviews.


SOLID Principlesโ€‹

Q1: What are SOLID principles?

S โ€” Single Responsibility โ†’ class has ONE reason to change
O โ€” Open/Closed โ†’ open for extension, closed for modification
L โ€” Liskov Substitution โ†’ subclass must work wherever base class works
I โ€” Interface Segregation โ†’ many small interfaces > one large interface
D โ€” Dependency Inversion โ†’ depend on abstractions, not concretions

Q2: Explain Single Responsibility with example

// BAD โ€” StudentService does too many things
public class StudentService
{
public void EnrollStudent() { } // business logic
public void SendEmail() { } // email โ€” separate concern
public void GeneratePdf() { } // PDF โ€” separate concern
public void SaveToDb() { } // data access โ€” separate concern
}

// GOOD โ€” each class has one responsibility
public class StudentService { void EnrollStudent() { } }
public class EmailService { void SendEmail() { } }
public class PdfService { void GeneratePdf() { } }
public class StudentRepository{ void Save() { } }

Q3: Explain Dependency Inversion

๐Ÿ’ป Try It โ€” Console App
๐Ÿ’ก Paste into Program.cs and press F5โŒฅ GitHub
// BAD โ€” depends on concrete class (hard to test, hard to change)
public class StudentService
{
private StudentRepository _repo = new StudentRepository(); // concrete!
}

// GOOD โ€” depends on interface (testable, swappable)
public class StudentService
{
private readonly IStudentRepository _repo;
public StudentService(IStudentRepository repo) => _repo = repo;
// inject mock in tests, real impl in production
}

System Design Basicsโ€‹

Q4: How would you design a School Management REST API?

Layers:
API Layer โ†’ Controllers, DTOs, validation, auth
Service Layer โ†’ Business logic, rules
Repository Layer โ†’ Data access (EF Core + Dapper)
Database โ†’ SQL Server

Endpoints:
/api/students โ†’ CRUD
/api/teachers โ†’ CRUD
/api/exams โ†’ Create exam, enter marks
/api/fees โ†’ Payment processing
/api/reports โ†’ Report cards, attendance

Security:
JWT Bearer tokens, role-based (Admin/Teacher/Student)

Performance:
AsNoTracking for read queries
Pagination on list endpoints
Caching for report data

Q5: What is Clean Architecture?

Concentric layers โ€” inner layers don't depend on outer layers.

Core/Domain โ†’ entities, interfaces, business rules (no framework deps)
Application โ†’ use cases, DTOs, services (depends on Domain only)
Infrastructure โ†’ EF Core, SQL, email (implements Core interfaces)
Presentation โ†’ Controllers, API (depends on Application)

Benefit: swap database (SQL โ†’ MongoDB) without changing business logic.

HR and Behavioral Questionsโ€‹

Q6: Why do you want to learn .NET?

Strong answer:
".NET has matured significantly with .NET 8. Microsoft is actively investing in it,
ASP.NET Core is among the fastest web frameworks (TechEmpower benchmarks),
and demand for .NET backend developers is consistently high in India.
The ecosystem โ€” EF Core, Dapper, Blazor, Azure โ€” gives a complete stack."

Q7: Where do you see yourself in 3 years?

Strong answer for freshers:
"In 3 years I want to be a proficient .NET backend developer who can independently
design and build REST APIs with ASP.NET Core, handle complex SQL queries, and
start contributing to architecture decisions. I plan to work through the NexCoding
roadmap systematically and apply everything to real projects."

Q8: What is your biggest weakness?

Avoid: "I work too hard" โ€” cliche, not believable.

Good approach โ€” real weakness + what you are doing about it:
"I sometimes spend too much time trying to write perfect code before testing it.
I am working on shipping smaller increments and testing earlier in development."

Quick Technical Roundโ€‹

Q9: What happens when you type a URL in the browser?

1. Browser checks cache
2. DNS lookup โ€” domain โ†’ IP address
3. TCP connection established (3-way handshake)
4. HTTPS โ€” TLS handshake
5. HTTP request sent (GET /api/students)
6. Server processes โ†’ ASP.NET Core pipeline handles request
7. Response sent back
8. Browser renders response

Q10: What is the difference between GET and POST?

GET โ†’ retrieve data, no body, URL params, cached, bookmarkable, idempotent
POST โ†’ send data, has body, not cached, not bookmarkable, creates resource

Never send sensitive data in GET URL (passwords, tokens visible in browser history)

Interview Preparation Checklistโ€‹

Before the interview:
โœ“ Review C# OOP โ€” classes, inheritance, interfaces
โœ“ Know async/await โ€” explain what happens to thread
โœ“ Review DI lifetimes โ€” Scoped vs Singleton
โœ“ Practice 3 SQL queries with JOINs
โœ“ Know SOLID principles with examples
โœ“ Prepare 2 projects you built to discuss

During the interview:
โœ“ Ask clarifying questions before answering system design
โœ“ Think out loud โ€” interviewers want to see thought process
โœ“ If you don't know โ€” say "I haven't worked with that but here is how I would approach it"
โœ“ Ask good questions at the end: tech stack, team size, deployment process
โ„น๏ธ Best Interview Preparation Strategy

Build the School Management System REST API end to end. Then you can talk confidently about every concept because you have actually done it โ€” not just read about it.

๐Ÿค–Use AI to Learn Faster

Use ChatGPT, Claude, or Copilot to go deeper on .NET developer interview preparation. Try these prompts:

  • "Do a mock .NET developer interview with me โ€” ask HR and technical questions"
  • "What SOLID principle questions do interviewers ask most often?"
  • "Ask me a system design question for a School Management API"
  • "What are the top 10 things a junior .NET developer must know before their first interview?"

๐Ÿ’ก Tip: After reading this article, paste your own code into AI and ask "What could go wrong here and why?" โ€” fastest way to find edge cases and deepen understanding.

nexcoding.in