Junior .NET Developer
60+ Junior .NET Developer Interview Questions and Answers
Q1. what is StringBuffer and were is use
StringBuffer is a mutable sequence of characters. It is used to efficiently manipulate strings.
StringBuffer is a class in Java that allows you to modify strings without creating a new object.
It is used when you need to concatenate a large number of strings efficiently.
StringBuffer is synchronized, so it is safe to use in multi-threaded environments.
It provides methods like append(), insert(), delete(), and reverse() to modify the string.
Example: StringBuffer sb = new StringBu...read more
Q2. What is ArrayList where is used
ArrayList is a dynamic array that can store objects of any type. It is used to store and manipulate collections of data.
ArrayList is part of the System.Collections namespace in .NET.
It can store objects of any type, including value types and reference types.
It automatically resizes itself as elements are added or removed.
Elements can be accessed by their index.
It provides methods for adding, removing, and searching for elements.
Example: ArrayList names = new ArrayList(); name...read more
Junior .NET Developer Interview Questions and Answers for Freshers
Q3. Coding round 1. Write a code for prime and odd numbers
Code for prime and odd numbers
For prime numbers, check if the number is divisible by any number less than itself
For odd numbers, check if the number is not divisible by 2
Use loops and conditional statements to implement the checks
Consider edge cases such as negative numbers and 0
Q4. What is the SQL query to retrieve the maximum salary from a database?
SQL query to retrieve the maximum salary from a database
Use the SELECT statement with the MAX function to retrieve the maximum salary
Specify the column name for the salary field in the table
Example: SELECT MAX(salary) FROM employees
Q5. What is generic how to declare
Generics in .NET allow you to create reusable code that can work with different types.
Generics are declared using the 'generic' keyword followed by the type parameter(s) in angle brackets.
Example: 'public class MyGenericClass
{}' You can use multiple type parameters separated by commas.
Example: 'public class MyGenericClass
{}' Generics provide type safety and eliminate the need for casting.
Example: 'List
myList = new List ();'
Q6. How can you identify and delete duplicate rows in a SQL table?
Identifying and deleting duplicate rows in a SQL table can be done using SQL queries.
Use the GROUP BY clause along with the COUNT() function to identify duplicate rows.
Use the HAVING clause to filter out rows with a count greater than 1.
Use the DELETE statement with a subquery to delete duplicate rows.
Example: SELECT column1, column2, COUNT(*) FROM table_name GROUP BY column1, column2 HAVING COUNT(*) > 1;
Example: DELETE FROM table_name WHERE id NOT IN (SELECT MIN(id) FROM tab...read more
Share interview questions and help millions of jobseekers 🌟
Q7. How would you implement a recursive query in SQL? Provide an example.
To implement a recursive query in SQL, use Common Table Expressions (CTE) with a recursive part and a termination condition.
Use a Common Table Expression (CTE) to define the recursive part of the query.
Include a base case in the CTE to stop the recursion.
Reference the CTE in the main query to retrieve the results.
Example: WITH RecursiveCTE AS (SELECT * FROM TableName WHERE condition UNION ALL SELECT * FROM RecursiveCTE WHERE condition)
Q8. What is the purpose of indexing in a database, and what are the different types of indexes?
Indexing in a database improves query performance by allowing faster retrieval of data.
Indexes are used to quickly locate data without having to search every row in a table.
Types of indexes include clustered, non-clustered, unique, and composite indexes.
Clustered indexes physically reorder the data in the table based on the index key.
Non-clustered indexes store a separate structure that contains the index key and a pointer to the actual data.
Unique indexes ensure that no two ...read more
Junior .NET Developer Jobs
Q9. Do you know SQL, What Databases are you familiar with?
Yes, I know SQL and I am familiar with various databases.
I have experience in writing SQL queries for Microsoft SQL Server, MySQL, and Oracle databases.
I am familiar with database design, normalization, and indexing.
I have worked with Entity Framework and LINQ to SQL for database access in .NET applications.
Q10. What are the available access modifiers in programming?
Access modifiers control the visibility and accessibility of classes, methods, and variables in programming.
Public - accessible from anywhere
Private - accessible only within the same class
Protected - accessible within the same class and its subclasses
Internal - accessible within the same assembly
Protected Internal - accessible within the same assembly or subclasses
Q11. What are the key concepts of Object-Oriented Programming (OOP)?
Key concepts of OOP include encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation: Bundling data and methods that operate on the data into a single unit (class). Example: Class with private fields and public methods.
Inheritance: Creating new classes based on existing classes, inheriting their attributes and behaviors. Example: Subclass extending a superclass.
Polymorphism: Objects of different classes can be treated as objects of a common superclass. Example:...read more
Q12. What is the difference between procedures and functions?
Procedures do not return a value, while functions return a value.
Procedures are used to perform an action, while functions are used to calculate and return a value.
Functions have a return type specified, while procedures do not.
Example: Procedure to display a message on the screen vs Function to calculate the sum of two numbers.
Q13. What is your understanding of normalization in SQL?
Normalization in SQL is the process of organizing data in a database to reduce redundancy and improve data integrity.
Normalization is a technique used to eliminate redundant data and ensure data integrity.
It involves breaking down a table into smaller tables and defining relationships between them.
There are different normal forms such as 1NF, 2NF, 3NF, and BCNF.
For example, in a database of students and courses, instead of storing student details in the course table, a separa...read more
Q14. why we use interface and abstract methods?
Interfaces and abstract methods are used to achieve abstraction and provide a blueprint for classes to implement.
Interfaces allow for multiple inheritance and provide a contract for classes to adhere to.
Abstract methods define a method signature without implementation, allowing subclasses to provide their own implementation.
Interfaces and abstract methods promote code reusability and maintainability.
Interfaces can be used to achieve loose coupling and dependency injection.
Exa...read more
Q15. Find second highest salary,Oops concept what is asp.net core and difference.
Answering interview questions on finding second highest salary, OOPs concepts, and ASP.NET Core.
To find the second highest salary, we can use the SQL query 'SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees)'.
OOPs concepts include inheritance, polymorphism, encapsulation, and abstraction.
ASP.NET Core is a cross-platform, open-source framework for building modern web applications.
The main difference between ASP.NET and ASP.NET Core is that ASP...read more
Q16. Why used isPostBack property in pageload event?
The isPostBack property is used in the Page_Load event to determine if the page is being loaded for the first time or if it is a postback.
The isPostBack property is a boolean property that indicates whether the page is being loaded for the first time or if it is a postback.
It is commonly used to differentiate between the initial page load and subsequent postbacks.
This property is useful when you want to perform certain actions only on the initial page load and not on postback...read more
Q17. What is dependency injection and its lifetimes
Dependency injection is a design pattern where components are given their dependencies rather than creating them.
Dependency injection helps in making components loosely coupled, making it easier to test and maintain code.
There are three main lifetimes for dependencies: transient, scoped, and singleton.
Transient dependencies are created each time they are requested.
Scoped dependencies are created once per request.
Singleton dependencies are created only once and reused througho...read more
Q18. Explain the difference between a correlated subquery and a nested subquery.
Correlated subquery refers to a subquery that depends on the outer query, while nested subquery is a subquery within another subquery.
Correlated subquery is executed for each row of the outer query, while nested subquery is executed only once.
Correlated subquery can reference columns from the outer query, while nested subquery cannot.
Example of correlated subquery: SELECT * FROM table1 WHERE column1 = (SELECT MAX(column2) FROM table2 WHERE table1.id = table2.id)
Example of nes...read more
Q19. What is the diffrence between Abstract vs interface?
Abstract classes can have both abstract and non-abstract methods, while interfaces can only have abstract methods.
Abstract classes can have constructors, fields, and properties, while interfaces cannot.
A class can inherit from only one abstract class, but can implement multiple interfaces.
Abstract classes are used when a class needs to provide a default implementation for some methods, while interfaces are used to define a contract for classes to implement.
Example: Abstract c...read more
Q20. what is CORS ? and we use this
CORS stands for Cross-Origin Resource Sharing, a security feature that allows servers to specify who can access their resources.
CORS is used to prevent web pages from making requests to a different domain than the one that served the original page.
It is implemented using HTTP headers like Access-Control-Allow-Origin.
CORS is commonly used in web development to enable secure cross-origin requests in browsers.
Example: If a frontend application on domain A wants to make a request...read more
Q21. Difference between connected and disconnected architecture of ADO. NET
Connected architecture maintains a continuous connection to the database while disconnected architecture connects only when required.
Connected architecture is suitable for applications that require real-time data updates.
Disconnected architecture is suitable for applications that require occasional data updates.
Connected architecture uses DataReader while disconnected architecture uses DataSet.
Connected architecture is faster but consumes more resources than disconnected arch...read more
Q22. What is auto mapper,middleware, opps conceps
AutoMapper is a library for mapping objects, middleware is software that acts as a bridge between different systems, OOPs concepts are principles of object-oriented programming.
AutoMapper is a popular object-to-object mapping library in .NET that helps to eliminate repetitive mapping code.
Middleware in .NET is software that can handle requests and responses between a client and a server, providing additional functionalities like logging, authentication, etc.
OOPs concepts in ....read more
Q23. How to implement multiple inheritance in C#
Multiple inheritance is not directly supported in C#, but can be achieved using interfaces.
C# does not support multiple inheritance of classes due to the Diamond Problem
Multiple inheritance can be achieved using interfaces by implementing multiple interfaces in a class
Example: public class MyClass : Interface1, Interface2 { }
Q24. why we use TFS or GitHub?
TFS and GitHub are used for version control and collaboration in software development.
TFS and GitHub provide version control, allowing developers to track changes and collaborate on code.
They enable multiple developers to work on the same codebase simultaneously, avoiding conflicts.
They offer features like branching and merging, making it easier to manage different versions of code.
TFS and GitHub provide a centralized repository for code, ensuring its availability and backup....read more
Q25. What are DDL and DML queries?
DDL and DML are SQL queries used to manipulate databases. DDL is used to create, modify or delete database objects while DML is used to manipulate data.
DDL stands for Data Definition Language and is used to create, modify or delete database objects like tables, indexes, etc.
DML stands for Data Manipulation Language and is used to manipulate data in the database like inserting, updating or deleting records.
DDL queries include CREATE, ALTER and DROP statements while DML queries...read more
Q26. Write a code for reverse string
Code to reverse a string
Create an empty string variable to store the reversed string
Loop through the original string from the end to the beginning
Append each character to the empty string variable
Return the reversed string
Q27. Difference between substr() and charindex()?
substr() extracts a substring from a string based on start and length, while charindex() finds the position of a character or substring within a string.
substr() is used in SQL Server to extract a portion of a string based on the starting position and length.
charindex() is used in SQL Server to find the position of a specific character or substring within a string.
Example: SELECT SUBSTRING('Hello World', 1, 5) will return 'Hello'.
Example: SELECT CHARINDEX('o', 'Hello World') w...read more
Q28. write schema for many to many relationship
Schema for many to many relationship
Create a junction table to connect the two entities
Each record in the junction table represents a relationship between the two entities
Both entities have a many-to-many relationship with each other
Q29. What are the advantages of Dotnet Core?
Dotnet Core offers improved performance, cross-platform compatibility, and open-source flexibility.
Improved performance compared to traditional .NET Framework
Cross-platform compatibility allows for development on Windows, macOS, and Linux
Open-source flexibility enables community contributions and faster updates
Support for microservices architecture and containerization
Enhanced security features and easier deployment options
Q30. CLASS NAMES IN disconnected architecture
In disconnected architecture, class names should reflect the entities or objects they represent.
Class names should be meaningful and descriptive.
They should follow naming conventions, such as PascalCase or camelCase.
Avoid using abbreviations or acronyms that may not be easily understood.
Consider using domain-specific terminology to make the class names more intuitive.
Examples: Customer, Order, Product, Employee
Q31. which technical languages do you know?
I am proficient in C#, SQL, and JavaScript.
C#
SQL
JavaScript
Q32. 3. Write a code for fibannoci series
Code for Fibonacci series
Declare two variables to store the first two numbers of the series
Use a loop to generate the next numbers in the series by adding the previous two
Print or store the generated numbers
Q33. What is use of delegate?
Delegates are used to create references to methods and pass them as arguments to other methods.
Delegates allow for loose coupling between objects
Delegates can be used to implement callbacks and event handlers
Delegates can be used to implement the observer pattern
Delegates can be used to implement the command pattern
Delegates can be used to implement the strategy pattern
Q34. Are you familiar with Angular?
Yes, Angular is a popular front-end framework for building web applications.
Angular is developed and maintained by Google.
It uses TypeScript for building applications.
It follows the MVC (Model-View-Controller) architecture.
It provides features like two-way data binding, dependency injection, and directives.
Examples of popular Angular applications include Gmail, PayPal, and Upwork.
Q35. What are filters
Filters in .NET are used to perform logic before or after an action method is executed.
Filters can be used for authorization, logging, exception handling, etc.
Examples include AuthorizeFilter, ActionFilter, ExceptionFilter, ResultFilter.
Filters can be applied globally, at controller level, or at action level.
Q36. How to implement abstract classes
Abstract classes in C# provide a way to define common behavior for derived classes while allowing specific implementations.
Use the 'abstract' keyword to define an abstract class.
Abstract classes cannot be instantiated and can contain abstract methods that must be implemented by derived classes.
Derived classes must provide implementations for all abstract methods.
Abstract classes can also have non-abstract methods and properties.
Example: abstract class Shape { public abstract ...read more
Q37. Difference between interface and abstract class
Interface defines only method signatures while abstract class can have method implementations.
Interface cannot have method implementations, abstract class can
A class can implement multiple interfaces but can inherit only one abstract class
Interfaces are used for defining contracts, abstract classes are used for code reusability
Example: Interface - ILogger { void Log(string message); } Abstract class - Shape { public abstract double CalculateArea(); }
Q38. Difference between authentication, authorization
Authentication verifies the identity of a user, while authorization determines what actions a user is allowed to perform.
Authentication confirms the user's identity through credentials like username and password.
Authorization controls the access rights of authenticated users to specific resources or actions.
Example: Logging into a website with a username and password is authentication. Accessing certain pages or features based on user roles is authorization.
Q39. What is join?
Join is a SQL operation that combines rows from two or more tables based on a related column between them.
Join is used to retrieve data from multiple tables in a single query.
Common types of joins include inner join, left join, right join, and full outer join.
Join conditions are specified using the ON keyword followed by the columns to join on.
Example: SELECT * FROM table1 JOIN table2 ON table1.column = table2.column;
Q40. Function and View In sql server
Functions and views are used in SQL Server to encapsulate logic and simplify querying.
Functions are reusable blocks of code that can accept parameters and return a value.
Views are virtual tables that are based on the result set of a SELECT query.
Functions can be scalar functions, table-valued functions, or aggregate functions.
Views can be used to simplify complex queries by encapsulating logic and joining multiple tables.
Functions and views can improve performance by reducing...read more
Q41. What is the full form of SQL
Structured Query Language
SQL stands for Structured Query Language
It is a standard language for accessing and manipulating databases
Commonly used for querying, updating, and managing relational databases
Examples include SELECT, INSERT, UPDATE, DELETE statements
Q42. What are middlewares?
Middlewares are components that handle requests and responses in the pipeline of a web application.
Middlewares are software components that are executed in the request-response pipeline of a web application.
They can intercept, process, or modify incoming requests and outgoing responses.
Examples include authentication middleware, logging middleware, and error handling middleware.
Q43. What is Partial Class?
Partial class is a class that can be split into multiple files, allowing different parts of the class to be defined in different files.
Partial classes are useful for organizing large classes and separating different concerns.
All parts of a partial class must use the 'partial' keyword.
When compiled, all parts of a partial class are combined into a single class definition.
Q44. What is class and object?
A class is a blueprint for creating objects, while an object is an instance of a class.
A class defines the properties and behaviors of objects.
An object is created based on a class, and can have its own unique values for the properties defined in the class.
Example: Class 'Car' may have properties like 'color' and 'model', while an object of class 'Car' could be 'red Ferrari'.
Q45. Signature of multicaste delegate
Signature of multicast delegate
A multicast delegate is a delegate that can have multiple methods assigned to it
The signature of a multicast delegate is the same as that of a regular delegate
The signature includes the return type, name, and parameters of the delegate
Q46. Difference between first, single
First returns the first element of a sequence, while Single returns the only element of a sequence or throws an exception if there is not exactly one element.
First is used to retrieve the first element of a sequence, while Single is used to retrieve the only element of a sequence.
First does not throw an exception if there are no elements in the sequence, while Single throws an exception in this case.
Example: var numbers = new List
{ 1, 2, 3 }; var firstNumber = numbers.First(...read more
Q47. Difference between Function and Method
A function is a standalone block of code that performs a specific task, while a method is a function that is associated with a class or object.
Functions are independent and can be called from anywhere in the code.
Methods are associated with a class or object and are called using the dot notation.
Functions can be defined outside of classes, while methods are defined within classes.
Example: Function to calculate the square root of a number vs Method to calculate the area of a r...read more
Q48. Difference between ref, out params
ref and out are both used for passing arguments by reference in C#, but out parameters are not required to be initialized before being passed.
ref parameters must be initialized before being passed to a method, while out parameters do not need to be initialized
out parameters are typically used for returning multiple values from a method
ref parameters can be used for both input and output, while out parameters are typically used for output only
Q49. Realtime example of static class
A static class is a class that cannot be instantiated and is used to group related methods and properties.
Static classes are commonly used for utility classes that contain helper methods.
They are also used for defining extension methods.
Example: Math class in C# contains static methods like Math.Max() and Math.Min().
Q50. SQL query and oops in depp
SQL query and OOPs concepts are essential for a Junior .NET Developer.
Understand SQL queries for data retrieval, manipulation, and management.
Learn Object-Oriented Programming principles like inheritance, encapsulation, and polymorphism.
Practice writing SQL queries to retrieve specific data from databases.
Implement OOPs concepts in .NET applications for better code organization and reusability.
Interview Questions of Similar Designations
Top Interview Questions for Junior .NET Developer Related Skills
Interview experiences of popular companies
Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary
Reviews
Interviews
Salaries
Users/Month