Developer
Developer
Answer: A type that represents references to methods with a specific parameter list and return
type. When you instantiate a delegate, you can associate its instance with any method that
matches its signature and return type. You can invoke (or call) the method through the
delegate instance.
5. Question: What is the difference between an abstract class and an interface in C#?
Answer: An abstract class can provide method implementations and state, while an interface
only defines method signatures without implementations.
Difficulty: Medium
Object-Oriented Programming in C#
5. Question: What is the difference between method overloading and method overriding?
Answer: Method overloading allows multiple methods with the same name but different
parameters in the same class, while method overriding replaces a base class method in a
derived class.
Difficulty: Medium
6. Question: How do you implement an interface in C#?
Answer: A class implements an interface by providing implementations for all its members,
using the : interfaceName syntax after the class name.
Difficulty: Medium
10. Question: What are the differences between an abstract class and an interface in C#?
Answer: An abstract class can contain implementation, fields, and constructors, while an
interface can only define method signatures and properties.
Difficulty: Hard
Design Patterns in C#
6. Question: What is the difference between the Adapter and the Facade pattern?
Answer: The Adapter pattern allows incompatible interfaces to work together, while the
Facade pattern provides a simplified interface to a complex subsystem.
Difficulty: Medium
SOLID Principles
Difficulty: Easy
Answer: An array in C# is a collection of variables of the same type stored in contiguous
memory locations. It is declared using square brackets.
Difficulty: Easy
Answer: A List<T> is a dynamic array that automatically resizes itself as elements are added
or removed. In contrast, a standard array has a fixed size once it is initialized.
Difficulty: Easy
Answer: A Dictionary<TKey, TValue> is a collection of key-value pairs. It is used when you
need to quickly retrieve data using a unique key. The keys must be unique.
Difficulty: Medium
Answer: A HashSet<T> stores unique elements and is optimized for fast lookups (constant
time O(1)), while a List<T> can store duplicates and generally has slower lookup times (linear
O(n)).
8. How would you reverse a linked list in C#?
Difficulty: Medium
Answer: To reverse a singly linked list, you need to iterate through the list and reverse the
pointers of each node. Here's a simple implementation:
9. What is the time complexity of searching in a balanced binary search tree (BST)?
Difficulty: Hard
Answer: The time complexity of searching in a balanced BST is O(log n) because the tree is
structured in such a way that each comparison reduces the search space by half.
Difficulty: Hard
Answer: One common approach to detect a cycle in a linked list is to use Floyd’s Tortoise and
Hare algorithm. You maintain two pointers (slow and fast). The slow pointer moves one step,
and the fast pointer moves two steps. If they meet, there is a cycle.
Unit Testing in C#
9. Question: What are some common practices for writing good unit tests?
Answer: Practices include writing tests that are independent, repeatable, descriptive, covering
edge cases, and maintaining a consistent naming convention.
Difficulty: Hard
10. Question: How do you handle exceptions in unit tests?
Answer: You can use assertions to check for expected exceptions, using constructs like
Assert.Throws<ExceptionType>(() => MethodCall()) in NUnit.
Difficulty: Hard
Answer: A Web API is an interface that allows different applications to communicate with each
other over the internet using HTTP. It enables interaction between clients and servers.
Difficulty: Easy
2. Question: What is REST?
Difficulty: Easy
3. Question: What is JSON and why is it used in APIs?
Answer: JSON (JavaScript Object Notation) is a lightweight data interchange format that is
easy for humans to read and write, and easy for machines to parse and generate. It is
commonly used in APIs because of its simplicity and compatibility with JavaScript.
Difficulty: Easy
4. Question: What are the differences between SOAP and REST APIs?
Answer: SOAP (Simple Object Access Protocol) is a protocol that relies on XML and has strict
standards, while REST is an architectural style that can use various formats (JSON, XML, etc.)
and is more flexible and easier to use. REST is generally considered lightweight compared to
SOAP.
Difficulty: Medium
5. Question: How do you handle versioning in a Web API?
Answer: Versioning can be handled using several strategies, such as URL versioning (e.g.,
/v1/resource), query parameter versioning (e.g., /resource?version=1), and header versioning
(e.g., using a custom header). The choice depends on the project's needs and the expected
frequency of changes.
Difficulty: Medium
6. Question: What are status codes in HTTP, and can you name a few?
Answer: Status codes are three-digit numbers returned by a server to indicate the result of a
client's request. Common ones include 200 (OK), 201 (Created), 400 (Bad Request), 401
(Unauthorized), and 404 (Not Found).
Difficulty: Medium
Answer: Idempotency means that multiple identical requests should have the same effect as a
single request. This can be achieved by using HTTP methods appropriately (e.g., GET, PUT)
and designing resource operations so that they do not cause unintended side effects when
repeated.
Difficulty: Hard
Answer: Pagination can be implemented using query parameters like limit and offset or page
and size. This helps control the amount of data returned in a single response and improve
performance.
Difficulty: Hard
Answer: CORS (Cross-Origin Resource Sharing) is a security feature that allows or restricts
resources requested from a different domain. It is important because it protects APIs from
malicious requests coming from unauthorized domains.
Difficulty: Hard
Answer: Testing can be performed using tools like Postman, Swagger, or automated testing
frameworks (e.g., NUnit, Jest). Tests should include unit tests, integration tests, and end-to-
end tests to ensure all components function as expected.
Difficulty: Hard
11. Question: What is middleware in the context of web applications?
12. Question: Can you name a few common uses for middleware?
Answer: Common uses include authentication, logging, error handling, request parsing, and
serving static files.
Difficulty: Easy
13. Question: What is the difference between application-level and router-level middleware
in Express?
Answer: Application-level middleware is bound to an instance of the app and applies to all
routes. Router-level middleware applies only to specific routes defined in a router, allowing
more granular control.
Difficulty: Medium
14. Question: What are error-handling middleware, and how do they differ from regular
middleware?
Answer: Error-handling middleware is specifically designed to handle errors that occur during
request processing. It takes four arguments: err, req, res, and next, allowing it to manage
errors and send appropriate responses.
Difficulty: Medium
15. Question: How does middleware affect the request-response lifecycle in a web
application?
Answer: Middleware functions can intercept and modify requests and responses, perform
actions before passing control to the next function, or terminate the request-response cycle.
This can include tasks like authentication, validation, and error handling.
Difficulty: Hard
Answer: Using too many middleware functions can lead to performance bottlenecks,
especially if they perform heavy computations or blocking operations. It's essential to use
efficient middleware and optimize the request-response cycle to maintain performance.
Difficulty: Hard
Answer: API security refers to the measures taken to protect APIs from unauthorized access,
misuse, and abuse, ensuring the integrity, confidentiality, and availability of data and services.
Difficulty: Easy
18. Question: What are common authentication methods for APIs?
Answer: Common authentication methods include Basic Authentication, API keys, OAuth, and
JWT (JSON Web Tokens). Each has its use cases and security implications.
Difficulty: Easy
Answer: HTTPS (Hypertext Transfer Protocol Secure) is an extension of HTTP that uses
SSL/TLS to encrypt data exchanged between clients and servers. It is important for protecting
sensitive data and preventing man-in-the-middle attacks.
Difficulty: Easy
Answer: Routing is the process of defining how an application responds to client requests for
specific endpoints, typically by associating URLs with corresponding request handlers.
Difficulty: Easy
Answer: A RESTful API is an architectural style that uses standard HTTP methods (GET,
POST, PUT, DELETE) to operate on resources identified by URLs.
Difficulty: Easy
26. Question: What is Swagger, and how is it used in ASP.NET Web API?
Answer: Swagger is a tool that generates interactive API documentation. In ASP.NET Web
API, you can use it to document endpoints, request/response types, and test the API directly.
Difficulty: Medium
27. Question: How do you implement versioning in a Web API?
Answer: You can implement versioning by using URL path segments, query strings, or custom
headers to differentiate between versions of the API.
Difficulty: Hard
28. Question: Explain the difference between HTTP status codes 200, 201, 400, and 404.
Answer: 200 OK indicates success, 201 Created indicates a successful resource creation, 400
Bad Request indicates client-side error due to invalid request, and 404 Not Found indicates
that the requested resource was not found.
Difficulty: Hard
29. Question: What is CORS, and how do you enable it in ASP.NET Web API?
Answer: CORS (Cross-Origin Resource Sharing) allows restricted resources on a web page to
be requested from another domain. You can enable it by adding the
Microsoft.AspNet.WebApi.Cors package and configuring it in WebApiConfig.
Difficulty: Hard
30. Question: How do you handle pagination in a Web API?
Answer: Pagination can be handled by implementing query parameters (e.g., page and
pageSize) to control the number of records returned in the response.
Difficulty: Very Hard
8. Question: What is the difference between Add() and Attach() methods in EF Core?
Answer: Add() is used to add a new entity to the context and marks it as added, while Attach()
is used for existing entities to inform the context of their existence without changing their state.
Difficulty: Hard
Answer: Lazy loading is a feature in Entity Framework that delays the loading of related data
until it is explicitly accessed. This can improve performance by reducing the amount of data
loaded initially.
Difficulty: Easy
Answer: Lazy loading is enabled by default in Entity Framework when using virtual navigation
properties in your entities. You can also configure it in the context using
Configuration.LazyLoadingEnabled = true.
Difficulty: Easy
Answer: Lazy loading can lead to performance issues due to multiple database queries being
executed for each navigation property accessed. This can result in the "N+1 query problem."
Difficulty: Medium
4. How can you disable Lazy Loading in Entity Framework?
Answer: You can disable lazy loading by setting Configuration.LazyLoadingEnabled = false in
your DbContext class.
Difficulty: Medium
Answer: Eager loading retrieves related entities as part of the initial query using the Include
method, while lazy loading retrieves related entities on-demand when they are accessed for
the first time.
Difficulty: Medium
Answer: You would prefer eager loading when you know you will need the related data
immediately, as it can reduce the number of queries and improve performance in such
scenarios.
Difficulty: Medium
Difficulty: Medium
Difficulty: Hard
Difficulty: Hard
Difficulty: Hard
Microservices in C#
Difficulty: Easy
Answer: Advantages include improved scalability, better fault isolation, technology diversity,
faster time to market, easier maintenance, and the ability to deploy independently.
Difficulty: Easy
Difficulty: Medium
Answer: Service discovery is the process of automatically detecting devices and services on a
network. In microservices, it allows services to find and communicate with each other without
hardcoding the network locations.
Difficulty: Medium
Answer: Inter-service communication can be handled using synchronous protocols like REST
or gRPC, or asynchronous messaging queues such as RabbitMQ, Apache Kafka, or Azure
Service Bus.
Difficulty: Medium
Answer: An API Gateway acts as a single entry point for all client requests. It routes requests
to the appropriate microservices, handles cross-cutting concerns like authentication, logging,
and rate limiting, and can aggregate responses from multiple services.
Difficulty: Medium
7. How do you implement security in microservices?
Answer: Security can be implemented through OAuth2, JWT for authentication, and SSL/TLS
for secure communication. Each service should also validate tokens and have role-based
access control.
Difficulty: Medium
Answer: The Circuit Breaker pattern is used to prevent cascading failures in microservices by
detecting failures and temporarily blocking requests to the failing service. It allows for fallback
strategies and recovery when the service is healthy again.
Difficulty: Medium
Answer: Microservices can be tested using unit tests, integration tests, and contract tests.
Tools like Postman or Swagger can be used for API testing, and frameworks like JUnit or NUnit
for unit tests.
Difficulty: Hard
Difficulty: Hard
Monolithic Applications in C#
Answer: A monolithic application is a single, unified software application where all components
are interconnected and interdependent, typically running as a single service.
Difficulty: Easy
2. What are the advantages of a monolithic architecture?
Difficulty: Medium
5. What is the process of breaking down a monolith into microservices?
Answer: The process involves identifying bounded contexts, refactoring functionalities into
services, establishing inter-service communication, and gradually migrating users to the new
services while maintaining the existing monolith until complete.
Difficulty: Medium
Answer: Dependencies can be managed using dependency injection, keeping the application
modular, and ensuring that components are loosely coupled, enabling easier updates and
maintenance.
Difficulty: Medium
Difficulty: Medium
Answer: Maintainability can be ensured through proper code organization, consistent coding
standards, comprehensive documentation, and regular code reviews.
Difficulty: Hard
Difficulty: Hard
10. How do you handle scaling in a monolithic application?
Answer: Scaling can be achieved through vertical scaling (increasing resources on the server)
and horizontal scaling (replicating the entire application across multiple servers), although the
latter can be more challenging due to the tightly coupled nature of monoliths.
Difficulty: Hard
Docker and Kubernetes
JavaScript
TypeScript
Angular
Answer: Lazy loading is a technique in Angular that allows you to load feature modules only
when they are needed, which can improve the initial load time of the application.
Difficulty: Easy
Answer: The loadChildren property in Angular routing is used to specify the module to be
loaded lazily. It can be set to a string representing the module path or a dynamic import.
Difficulty: Easy
Difficulty: Medium
5. What is the difference between eager loading and lazy loading in Angular?
Answer: Eager loading loads all modules upfront when the application starts, while lazy
loading loads modules on demand as the user navigates to specific routes.
Difficulty: Medium
Answer: Yes, you can lazy load components using the ng-container directive or by using
Angular's dynamic component loading features. However, typically, lazy loading is used with
modules.
Difficulty: Medium
7. What are some best practices for implementing Lazy Loading in Angular?
Answer: Best practices include keeping feature modules small, using shared modules
effectively, and ensuring that lazy-loaded routes are properly configured to avoid loading
unnecessary code.
Difficulty: Medium
8. How does Angular handle module dependencies when using Lazy Loading?
Answer: Angular resolves module dependencies during the lazy loading process by analyzing
the imports and ensuring all necessary modules are loaded when a lazy-loaded module is
requested.
Difficulty: Hard
9. What are the implications of Lazy Loading on routing and guards in Angular?
Answer: Lazy loading can affect how guards are applied to routes. Guards need to be aware
of lazy-loaded modules to prevent unauthorized access, and it may require a different
configuration for route protection.
Difficulty: Hard
10. How do you optimize performance with Lazy Loading in Angular applications?
Answer: You can optimize performance by utilizing preloading strategies, ensuring proper
caching, minimizing the size of lazy-loaded modules, and analyzing bundle sizes using tools
like Webpack.
Difficulty: Hard
ReactJS
Answer: Lazy loading in React is a technique used to delay the loading of components until
they are needed, which can improve the initial loading time of the application.
Difficulty: Easy
Answer: You can implement lazy loading in React using React.lazy() to dynamically import the
component and Suspense to handle loading states while the component is being fetched.
Difficulty: Easy
Answer: React.lazy() is a function that allows you to define a component that will be loaded
lazily. It takes a function that returns a dynamic import.
Difficulty: Easy
4. How do you handle loading states when using Lazy Loading in React?
Answer: You can handle loading states using the Suspense component, which allows you to
specify a fallback UI that will be displayed while the lazy-loaded component is being fetched.
Difficulty: Medium
Answer: Lazy loading reduces the initial bundle size, leading to faster load times and
improved performance by only loading components as needed instead of all at once.
Difficulty: Medium
Answer: Code splitting is a technique that involves breaking up the code into smaller chunks
that can be loaded on demand, which is often achieved through lazy loading.
Difficulty: Medium
Answer: You can use error boundaries around lazy-loaded components to catch errors during
the loading process and display a fallback UI instead of crashing the entire application.
Difficulty: Hard
9. What are some best practices for using Lazy Loading in React applications?
Answer: Best practices include keeping components small, using meaningful loading
indicators, leveraging code splitting effectively, and ensuring error boundaries are
implemented.
Difficulty: Hard
10. How can you optimize the loading performance of lazily loaded components in React?
Answer: You can optimize loading performance by analyzing bundle sizes with tools like
Webpack Bundle Analyzer, using dynamic imports strategically, and implementing preloading
or prefetching techniques.
Difficulty: Hard
React Hooks
Difficulty: Easy
Answer: React Hooks are functions that let you use state and other React features in functional
components without needing to convert them into class components. They were introduced in React
16.8.
Difficulty: Medium
Answer: The useEffect Hook allows you to perform side effects in your functional components. It runs
after every render by default, but you can control when it runs by passing a dependency array as the
second argument.
4. What is the purpose of the dependency array in useEffect?
Difficulty: Medium
Answer: The dependency array tells React when to re-run the effect. If you provide an empty array,
the effect runs only once after the initial render. If you provide specific dependencies, the effect runs
when those dependencies change.
Difficulty: Medium
Answer: You can clean up effects by returning a function from the useEffect callback. This cleanup
function is called before the effect runs again or when the component unmounts.
6. Can you use multiple useEffect Hooks in a single component?
Difficulty: Medium
Answer: Yes, you can use multiple useEffect Hooks in a single component. Each effect can handle
different side effects independently.
7. What is the difference between useMemo and useCallback?
Difficulty: Medium
Answer: useMemo is used to memoize expensive calculations to optimize performance, while
useCallback is used to memoize callback functions to prevent unnecessary re-renders.
Difficulty: Medium
Answer: You can share state between components by lifting state up to a common ancestor and
passing state and updater functions down as props. Alternatively, you can use context with the
useContext Hook to provide shared state.
Difficulty: Hard
Answer: The useReducer Hook is an alternative to useState that is used for managing complex state
logic in functional components. It's beneficial when state transitions are complex or when managing
state that depends on previous state.
Difficulty: Hard
Answer: The rules of Hooks state that:
1. You can only call Hooks at the top level of your React function (not inside loops, conditions, or
nested functions).
2. You can only call Hooks from React function components or custom Hooks, not from regular
JavaScript functions.
React Functional Components Life Cycle
Difficulty: Easy
Answer: The life cycle of a functional component involves three main phases: mounting (when the
component is created and inserted into the DOM), updating (when the component is re-rendered due
to state or prop changes), and unmounting (when the component is removed from the DOM).
2. How do functional components differ from class components regarding lifecycle methods?
Difficulty: Easy
Answer: Functional components do not have lifecycle methods like class components. Instead, they
use the useEffect Hook to handle side effects at different stages of the lifecycle, mimicking lifecycle
methods like componentDidMount, componentDidUpdate, and componentWillUnmount.
3. What is the purpose of the useEffect Hook in managing the component lifecycle?
Difficulty: Medium
Answer: The useEffect Hook allows you to perform side effects in a functional component. You can
simulate lifecycle methods by controlling when the effect runs based on the dependency array,
enabling you to execute code at mount, update, and unmount phases.
Difficulty: Medium
Answer: To mimic componentDidMount, you can use useEffect with an empty dependency array,
which ensures the effect runs only once after the initial render.
Difficulty: Medium
Answer: You can mimic componentDidUpdate by using useEffect and specifying the dependencies
you want to watch. The effect will run every time one of those dependencies changes.
Difficulty: Medium
Answer: To mimic componentWillUnmount, return a cleanup function from the useEffect callback.
This cleanup function will be called when the component is unmounted or before the effect runs
again.
7. What is the purpose of React.StrictMode in relation to lifecycle methods?
Difficulty: Medium
Answer: React.StrictMode is a tool for highlighting potential problems in an application. It
intentionally invokes certain lifecycle methods, including the cleanup functions of effects, twice in
development mode to help identify side effects that could lead to bugs.
8. How can you optimize performance in functional components?
Difficulty: Medium
Answer: You can optimize performance by using React.memo to prevent unnecessary re-renders,
using useMemo to memoize expensive calculations, and useCallback to memoize functions passed
as props.
Difficulty: Hard
Answer: Some drawbacks of useEffect include potential for bugs due to incorrect dependency
management, complexity in understanding effects with multiple dependencies, and performance
issues if effects are not optimized.
Difficulty: Hard
Answer: You can handle errors in functional components by using error boundaries in class
components or by implementing error handling within effects (e.g., using try-catch blocks in
asynchronous operations). In React 18, you can also use the ErrorBoundary component to catch
errors in functional components.
SQL in General
Easy Level
o Difficulty: Easy
o Answer: A primary key is a unique identifier for a record in a database table. It ensures
that no two rows can have the same value in the primary key column(s) and cannot
contain NULL values.
o Difficulty: Easy
3. Question: What is the difference between INNER JOIN and LEFT JOIN?
o Answer: An INNER JOIN returns only the rows where there is a match in both tables. A
LEFT JOIN returns all rows from the left table and the matched rows from the right
table. If there is no match, NULL values are returned for columns from the right table.
o Difficulty: Easy
4. Question: What is a foreign key?
o Answer: A foreign key is a column or a set of columns in one table that uniquely
identifies a row in another table. It establishes a relationship between the two tables and
enforces referential integrity.
o Difficulty: Easy
o Answer: The GROUP BY clause is used to arrange identical data into groups. It is often
used with aggregate functions like COUNT(), SUM(), AVG(), etc., to perform operations
on each group of data.
o Difficulty: Easy
Medium Level
6. Question: What are the differences between UNION and UNION ALL?
o Answer: UNION combines the result sets of two or more SELECT statements and
removes duplicate rows. UNION ALL combines the results without removing duplicates,
which can lead to better performance if duplicates are not a concern.
o Difficulty: Medium
o Difficulty: Medium
o Answer: An index is a database object that improves the speed of data retrieval
operations on a table. It is created on one or more columns of a table and can
significantly reduce the amount of data that needs to be scanned for queries.
o Difficulty: Medium
Hard Level
o Difficulty: Hard
10. Question: Explain the ACID properties in a database context.
o Answer: ACID stands for Atomicity, Consistency, Isolation, and Durability. These
properties ensure reliable processing of database transactions:
▪ Consistency: Ensures that a transaction brings the database from one valid state
to another, maintaining data integrity.
o Difficulty: Hard
Easy Level
o Difficulty: Easy
▪ Third Normal Form (3NF): Achieves 2NF and removes transitive dependency,
where non-key attributes depend on other non-key attributes.
o Difficulty: Easy
Medium Level
3. Question: Explain First Normal Form (1NF).
o Answer: A table is in 1NF if all columns contain atomic (indivisible) values, and each
entry in a column is of the same data type. There should be no repeating groups or
arrays in any column.
o Difficulty: Medium
4. Question: What is Second Normal Form (2NF), and how do you achieve it?
o Answer: A table is in 2NF if it is in 1NF and all non-key attributes are fully functionally
dependent on the primary key. To achieve 2NF, identify partial dependencies (where
non-key attributes depend only on part of a composite key) and move them to separate
tables.
o Difficulty: Medium
o Difficulty: Medium
Hard Level
o Answer: A table is in 3NF if it is in 2NF and there are no transitive dependencies. This
means that all non-key attributes must depend only on the primary key. If a non-key
attribute depends on another non-key attribute, it should be moved to a separate table
to maintain data integrity.
o Difficulty: Hard
7. Question: What is denormalization, and when would you use it?
o Difficulty: Hard
▪ Disadvantages: Can lead to complex queries, may require more joins (which can
slow down performance), and can complicate the database design process.
o Difficulty: Hard
9. Question: What is Boyce-Codd Normal Form (BCNF)?
o Answer: BCNF is a stronger version of 3NF. A table is in BCNF if it is in 3NF and, for
every functional dependency X→YX \rightarrow YX→Y, XXX is a superkey. This
ensures that all dependencies are on a key and helps eliminate redundancy more
effectively than 3NF.
o Difficulty: Hard
o Answer: You should consider normalizing a database when you notice data
redundancy, update anomalies, or when the same data appears in multiple places.
Additionally, if the database design is complex and leads to difficulties in maintenance or
querying, it may be time to normalize.
o Difficulty: Hard
SQL Server
10. Question: What is the difference between MongoDB and traditional relational databases?
Answer: The primary difference is that MongoDB is a NoSQL database that uses a document-
oriented approach, while traditional relational databases use tables and rows. MongoDB offers
schema flexibility, horizontal scaling, and high performance for unstructured data, while
relational databases enforce strict schemas and use SQL for querying.
Difficulty: Hard
Git
1. Question: What is Git?
Answer: Git is a distributed version control system that allows multiple developers to
collaborate on a project while tracking changes to files over time.
Difficulty: Easy
2. Question: What is a repository in Git?
Answer: A repository (repo) is a storage space for a project where all the files and their
revision history are kept. It can be local (on a developer's machine) or remote (on a server like
GitHub).
Difficulty: Easy
5. Question: Explain the difference between git merge and git rebase.
Answer: git merge combines two branches by creating a new commit that includes changes
from both branches, preserving the history. git rebase integrates changes by moving the entire
branch to a new base commit, resulting in a linear history.
Difficulty: Medium
8. Question: What are Git tags, and how are they used?
Answer: Git tags are references to specific points in the repository's history, often used to
mark release versions. You can create a tag using git tag <tag-name> and push it to a remote
repository with git push origin <tag-name>.
Difficulty: Hard
Scrum
5. Question: What is the difference between a product backlog and a sprint backlog?
Answer: The product backlog is a prioritized list of features, enhancements, and bug fixes for
the entire product, while the sprint backlog is a subset of the product backlog that the team
commits to completing during the current sprint.
Difficulty: Medium
C# LINQ
• Difficulty: Easy
• Answer: LINQ (Language Integrated Query) is a .NET framework component that adds native
data querying capabilities to .NET languages. Unlike traditional SQL, which is executed
against a database, LINQ queries can be used with various data sources, such as arrays, lists,
XML, and databases, directly within the C# language.
2. What is deferred execution in LINQ?
• Difficulty: Easy
• Answer: Deferred execution means that the evaluation of a LINQ query is delayed until the
query variable is iterated over. This allows for optimization and can improve performance, as
the data is only retrieved when needed.
• Difficulty: Medium
• Answer: You can perform joins in LINQ using the Join method or the query syntax. For
example:
csharp
Copiar código
select new { a, b };
4. Explain the difference between IEnumerable and IQueryable.
• Difficulty: Medium
• Answer: IEnumerable is used for in-memory collections and executes queries against the data
in memory. IQueryable is designed for querying remote data sources, such as databases, and
constructs an expression tree to be executed on the server.
5. What are lambda expressions, and how are they used in LINQ?
• Difficulty: Medium
• Answer: Lambda expressions are anonymous functions that can contain expressions and
statements. They are used in LINQ to create inline functions for query operations, such as
Select, Where, and OrderBy. Example:
csharp
Copiar código
• Difficulty: Medium
• Answer: The GroupBy method is used to group elements that share a common attribute. It
returns a collection of groups, where each group contains elements that match the specified
key. Example:
csharp
Copiar código
• Answer: You can use the null-coalescing operator ?? or the DefaultIfEmpty method to handle
nulls in LINQ queries. Example:
csharp
Copiar código
• Difficulty: Medium
csharp
Copiar código
• Answer: LINQ to XML is a set of classes that allow for querying and manipulating XML
documents in a more concise way. You can load XML into an XDocument, and then use LINQ
queries to access and modify its elements. Example:
csharp
Copiar código
select el.Value;
• Difficulty: Hard
• Difficulty: Easy
• Answer: MVC (Model-View-Controller) is a design pattern used for developing user interfaces
that separates the application into three interconnected components: Model (data), View (UI),
and Controller (business logic). This separation promotes organized code and scalability.
• Difficulty: Easy
• Answer:
o Model: Represents the data and business logic.
o Controller: Handles user input, interacts with the model, and selects the view to
display.
• Difficulty: Medium
• Answer: Routing in ASP.NET MVC is the mechanism that maps incoming requests to the
appropriate controller and action. It uses the URL pattern defined in the route configuration to
determine how to handle the request.
• Difficulty: Medium
o ViewBag: A dynamic object that allows you to pass data to the view.
o ViewData: A dictionary that holds data to be passed to the view.
o Model: A strongly typed object that represents the data for the view.
5. What are Action Filters in ASP.NET MVC?
• Difficulty: Medium
• Answer: Action Filters are attributes that can be applied to controllers or action methods to
execute custom logic before or after action method execution. They can be used for logging,
authentication, or modifying the result. Examples include Authorize, ActionName, and
OutputCache.
6. How do you create a custom Action Filter?
• Difficulty: Medium
• Answer: To create a custom Action Filter, you implement the IActionFilter interface or derive
from ActionFilterAttribute. You then override the OnActionExecuting or OnActionExecuted
methods to add your logic. Example:
csharp
Copiar código
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
• Difficulty: Medium
• Answer: Model binding is the process by which MVC maps data from HTTP requests to action
method parameters or model properties. It converts data types, handles complex types, and
validates the incoming data automatically.
• Difficulty: Medium
• Answer: Validation can be handled using data annotations on model properties, which specify
rules like Required, StringLength, and Range. MVC automatically validates the model based
on these annotations when the form is submitted.
• Difficulty: Hard
• Answer: Partial Views are reusable views that can be rendered within other views. They help
break down complex views into smaller components. They can be used with Html.Partial() or
Html.RenderPartial() to include them in a parent view.
• Difficulty: Easy
• Answer: CI/CD stands for Continuous Integration and Continuous Deployment. In Azure
DevOps, CI/CD pipelines automate the process of integrating code changes, running tests,
and deploying applications to different environments, enabling faster and more reliable
software delivery.
• Difficulty: Easy
• Answer: Continuous Integration (CI) is the practice of automatically integrating code changes
into a shared repository and running tests to detect issues early. Continuous Deployment (CD)
is the practice of automatically deploying code changes to production after passing CI tests,
ensuring that new features are available to users quickly.
• Difficulty: Medium
• Answer: You can create a CI/CD pipeline in Azure DevOps by navigating to the Pipelines
section, selecting "New Pipeline," and then configuring the source repository, selecting a
template, and defining build and deployment steps in the YAML file or using the visual
designer.
4. What are the key components of a CI/CD pipeline in Azure?
• Difficulty: Medium
o Triggers: Define when pipelines are executed (e.g., on code push, pull request).
o Tasks: Individual actions that are performed within the pipeline (e.g., build, test,
deploy).
• Difficulty: Medium
• Answer: You can implement environment-specific configurations using variable groups,
pipeline variables, or Azure App Configuration. These allow you to define and manage settings
for different environments, such as development, staging, and production.
6. What is a YAML pipeline, and how does it differ from a classic pipeline?
• Difficulty: Medium
• Answer: A YAML pipeline is defined using YAML syntax, which allows for versioning and
storing the pipeline as code within the repository. In contrast, a classic pipeline is configured
using a visual interface in Azure DevOps. YAML pipelines provide greater flexibility and
reusability.
• Difficulty: Medium
• Answer: You can handle secrets and sensitive information in Azure Pipelines using Azure Key
Vault or pipeline variables marked as secrets. Secrets are encrypted and not exposed in logs,
ensuring secure handling of sensitive data during builds and deployments.
• Difficulty: Hard
o Blue-Green Deployment: Two identical environments (blue and green) allow switching
traffic with minimal downtime.
9. How can you integrate automated testing into your CI/CD pipeline?
• Difficulty: Hard
• Answer: Automated testing can be integrated into CI/CD pipelines by adding test tasks in the
build pipeline to run unit tests, integration tests, and UI tests using frameworks like NUnit,
MSTest, or Selenium. Test results can be published and monitored in Azure DevOps.
• Difficulty: Hard
Answer: Big O notation is a mathematical notation used to describe the upper bound of the time
complexity or space complexity of an algorithm in computer science. It provides a high-level
understanding of the performance characteristics of an algorithm, particularly in terms of how the time
or space requirements grow as the input size increases.