Full Stack (.
NET + Angular) Interview
Preparation – Detailed Answers
OOPs & Core Programming Concepts
Q: What are the main OOP principles? Explain with examples.
Answer:
Object-Oriented Programming (OOP) is a programming paradigm based on objects and
classes.
The four main principles are:
1. Encapsulation – Bundling data and methods together while restricting direct access.
Example:
class BankAccount {
private decimal balance;
public void Deposit(decimal amount){
balance += amount;
}
}
Here balance cannot be accessed directly.
2. Inheritance – A child class inherits properties from parent class.
Example:
class Vehicle { public void Start(){} }
class Car : Vehicle { }
3. Polymorphism – Same method behaves differently.
Example:
Method Overloading and Overriding.
4. Abstraction – Hiding implementation details and showing only functionality.
Example:
Using interfaces like IRepository in [Link] Core.
Q: What is the difference between Abstraction and Encapsulation?
Answer:
Encapsulation focuses on protecting data by restricting access using private variables
and public methods.
Abstraction focuses on hiding internal implementation and exposing only essential
behavior.
Example:
Encapsulation – Private fields with getter/setter.
Abstraction – Interfaces like ILogger where implementation is hidden.
.NET / Backend
Q: What is [Link] Core?
Answer:
[Link] Core is a cross-platform open-source framework used to build modern web
applications,
REST APIs, and microservices.
Key features:
• Cross-platform (Windows, Linux, macOS)
• High performance
• Built-in Dependency Injection
• Middleware pipeline
Example:
In a typical application:
Angular (Frontend) → [Link] Core Web API → SQL Server database
Controllers handle incoming HTTP requests and return responses in JSON format.
Q: Explain Dependency Injection with example.
Answer:
Dependency Injection (DI) is a design pattern used to reduce tight coupling between classes.
Instead of creating objects inside the class, dependencies are injected from outside.
Example in [Link] Core:
public class ProductController : ControllerBase
{
private readonly IProductService _service;
public ProductController(IProductService service)
{
_service = service;
}
}
Benefits:
• Easier testing
• Better maintainability
• Loose coupling
Q: What is Entity Framework Core?
Answer:
Entity Framework Core (EF Core) is an ORM (Object Relational Mapper).
It allows developers to interact with databases using C# objects instead of writing raw SQL.
Example:
var products = [Link](p => [Link] > 1000).ToList();
EF converts this LINQ query into SQL automatically.
Advantages:
• Faster development
• Database abstraction
• Automatic migrations
Q: Explain async and await.
Answer:
Async programming allows long-running operations without blocking the main thread.
Example:
public async Task<Product> GetProduct(int id)
{
return await _context.[Link](id);
}
Here database operation runs asynchronously which improves application scalability.
REST API
Q: What is a REST API?
Answer:
REST (Representational State Transfer) is an architectural style used for designing
networked applications.
REST APIs communicate over HTTP using methods such as:
GET – Retrieve data
POST – Create data
PUT – Update data
DELETE – Remove data
Example:
GET /api/products
Returns list of products.
Advantages:
• Stateless
• Scalable
• Platform independent
Q: How do you secure REST APIs using JWT?
Answer:
JWT (JSON Web Token) is commonly used for API authentication.
Steps:
1. User logs in with credentials
2. Server validates credentials
3. Server generates JWT token
4. Client sends token with every request
Example Header:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
Middleware validates token before accessing API endpoints.
Benefits:
• Stateless authentication
• Secure communication
Angular
Q: Explain Angular architecture.
Answer:
Angular follows component-based architecture.
Main parts:
Modules – Organize application
Components – UI building blocks
Services – Business logic
Templates – HTML views
Example flow:
User Action → Angular Component → Service → REST API → Database
Angular uses TypeScript and RxJS for reactive programming.
Q: What is RxJS?
Answer:
RxJS is a reactive programming library used for handling asynchronous operations.
It uses Observables which emit multiple values over time.
Example:
[Link]('/api/products').subscribe(data => {
[Link] = data;
});
Benefits:
• Handle async operations
• Manage data streams
• Event handling
Database
Q: What is indexing?
Answer:
Indexing improves query performance by allowing faster data retrieval.
Example:
CREATE INDEX idx_product_name ON Products(name);
Without index:
Database scans entire table.
With index:
Database quickly finds matching rows.
Important for large datasets.
Q: Explain normalization.
Answer:
Normalization is the process of organizing data to reduce redundancy.
Example:
Instead of storing category name in every product row,
create separate Category table.
Benefits:
• Reduces duplicate data
• Improves consistency
Cloud & DevOps
Q: What is CI/CD pipeline?
Answer:
CI/CD stands for Continuous Integration and Continuous Deployment.
Pipeline flow:
Developer pushes code → Git repository
Build server compiles code
Automated tests run
Application deployed automatically
Tools:
Git, Jenkins, Azure DevOps
Benefits:
• Faster releases
• Reduced manual work
Q: What is Docker?
Answer:
Docker is a containerization platform.
It packages application and dependencies together into containers.
Benefits:
• Consistent environments
• Easy deployment
• Lightweight compared to virtual machines
Behavioral
Q: Why do you want to join Microsoft?
Answer:
Microsoft is a global leader in cloud computing, AI, and enterprise software.
The opportunity to work with technologies like .NET, Azure, and AI-driven applications
aligns with my experience and career goals.
I am excited about contributing to enterprise-scale solutions while learning from
experienced architects and engineers.
Q: Describe a challenging problem you solved.
Answer:
In a fintech project, some API endpoints were slow due to complex SQL queries.
Steps taken:
• Analyzed execution plan
• Added indexes
• Optimized joins
• Refactored LINQ queries
Result:
API response time improved by ~35% and system performance increased significantly.