Skip to content

.NET Technical Test & Interview Questions

Onadebi edited this page Mar 19, 2025 · 1 revision

Technical Test & Interview Questions

Project: Various Fintech Projects for a Large Saudi IT Company

Section 1: General .NET Core and C# Knowledge

  1. What are the main advantages of using .NET Core over .NET Framework?
  2. Explain the difference between asynchronous and synchronous programming in C#. Provide an example of an async method.
  3. What are the key principles of SOLID design patterns? How would you apply them in a .NET Core application?
  4. What is dependency injection in .NET Core? Explain how it works with an example.
  5. How does garbage collection work in .NET Core? What are the different generations in GC?

Section 2: ASP.NET Core, MVC, and Web API

  1. Explain the request pipeline in ASP.NET Core. What are middleware components?
  2. What are the differences between API controllers and MVC controllers in ASP.NET Core?
  3. How would you implement authentication and authorization in an ASP.NET Core Web API using JWT?
  4. What is model binding and model validation in ASP.NET Core? Provide an example of how to validate incoming API requests.
  5. How can you implement global exception handling in an ASP.NET Core Web API?

Section 3: Event-Driven Architecture, Microservices, and Distributed Systems

  1. What are the advantages of using event-driven architectures in a microservices environment?
  2. How does an event bus work in microservices? Provide an example using RabbitMQ, Kafka, or Azure Event Grid.
  3. Explain how to implement the Saga pattern in a distributed system.
  4. What are the common challenges of microservices architecture, and how do you overcome them?
  5. How can you handle distributed transactions across microservices?

Section 4: Entity Framework, SQL Database Design & Query Optimization

  1. Explain the differences between Code-First and Database-First approaches in Entity Framework. Which one would you prefer and why?
  2. What is lazy loading, and how does it differ from eager loading in Entity Framework?
  3. How would you optimize the performance of an SQL query that joins multiple large tables?
  4. What are database indexes, and how do they impact query performance? Provide an example of how to create an index in SQL.
  5. How would you handle database migrations in a .NET Core application using Entity Framework?

Section 5: Azure Cloud Hosting & DevOps

  1. What are the different Azure services available for hosting .NET Core applications?
  2. How would you configure an Azure App Service to automatically scale based on incoming traffic?
  3. What is Azure Key Vault, and how would you use it to store sensitive information in a .NET Core application?
  4. How can you implement logging and monitoring for a .NET Core application running on Azure?
  5. Explain the differences between Azure Functions and Azure Web Jobs. When would you use each?

Section 6: CI/CD Pipelines and DevOps Practices

  1. What are the key components of a CI/CD pipeline?
  2. How would you implement CI/CD for a .NET Core application using GitHub Actions, Azure DevOps, or GitLab CI/CD?
  3. How can you use Docker containers in a CI/CD pipeline for deploying .NET Core applications?
  4. Explain how to automate unit tests and integration tests in a CI/CD pipeline.
  5. How can you secure secrets and credentials in a CI/CD pipeline?

Practical Coding Exam

Scenario 1: ASP.NET Core Web API Development

  • Develop a simple .NET Core Web API that allows users to register and authenticate using JWT.
  • Implement an endpoint /api/users that fetches all users from the database (use Entity Framework Core).
  • Implement an endpoint /api/orders that accepts order creation requests and triggers an event using RabbitMQ (simulate an event-driven architecture).

Scenario 2: SQL Performance Optimization

  • Given the following SQL query, optimize it for better performance:

    SELECT Orders.OrderID, Customers.CustomerName, SUM(OrderDetails.Quantity * OrderDetails.Price) AS TotalAmount
    FROM Orders
    JOIN Customers ON Orders.CustomerID = Customers.CustomerID
    JOIN OrderDetails ON Orders.OrderID = OrderDetails.OrderID
    WHERE Orders.OrderDate > '2024-01-01'
    GROUP BY Orders.OrderID, Customers.CustomerName
    ORDER BY TotalAmount DESC;
  • Identify potential indexing strategies to improve query performance.

Scenario 3: Azure Deployment

  • Deploy a .NET Core Web API to Azure App Service using a CI/CD pipeline.
  • Configure Azure Application Insights to log API performance metrics.

Scoring Criteria

  • Conceptual Understanding (30%): Ability to explain and apply .NET Core, ASP.NET, microservices, and database concepts.
  • Problem-Solving & Optimization (30%): SQL query optimization, API design, and CI/CD implementation.
  • Practical Implementation (40%): Hands-on ability to develop, test, and deploy .NET Core applications.