Xetech
20+ Interview Questions and Answers
Q1. Can you explain the steps to enable JWT Authentication in ASP Core Web API with Roles?
Enable JWT Authentication in ASP Core Web API with Roles
Install the required NuGet packages like Microsoft.AspNetCore.Authentication.JwtBearer
Configure JWT authentication in Startup.cs file
Add authentication middleware in Configure method
Implement role-based authorization using policies and attributes
Q2. How much experience do have as ASP Core Web API and ReactJs Developer?
I have 3 years of experience as an ASP Core Web API and ReactJs Developer.
3 years of experience in ASP Core Web API development
Proficient in ReactJs development
Developed multiple projects using ASP Core Web API and ReactJs
Q3. How to efficiently retrieve SQL records in case a table has millions of records
Use indexing, limit the columns retrieved, optimize queries, use pagination
Create indexes on columns frequently used in queries
Limit the columns retrieved to only those needed
Optimize queries by using WHERE clauses and avoiding SELECT *
Implement pagination to retrieve records in smaller chunks
Q4. What is the difference between Context API and Redux?
Context API is a built-in feature in React for managing global state, while Redux is a standalone library for state management.
Context API is built into React, while Redux is a separate library.
Context API is primarily used for managing global state in a React application.
Redux provides a centralized store for managing state across the application.
Context API is simpler to use for smaller applications, while Redux is more suitable for complex state management needs.
Redux allo...read more
Q5. What are the Differences between Joins and Sub Queries
Joins are used to combine rows from two or more tables based on a related column, while subqueries are nested queries used to return data for the main query.
Joins are used to retrieve data from multiple tables based on a related column
Subqueries are nested queries within a main query to return data for the main query
Joins are typically more efficient than subqueries for large datasets
Joins can be of different types like INNER JOIN, LEFT JOIN, RIGHT JOIN, etc.
Subqueries can be...read more
Q6. What are the Differences between Views, Procedures, and Functions
Views are virtual tables, procedures are reusable code blocks, functions return values
Views are virtual tables that display data from one or more tables
Procedures are reusable code blocks that can be called multiple times
Functions return a single value based on input parameters
Views are read-only, while procedures and functions can modify data
Examples: View - SELECT * FROM employees_view; Procedure - EXECUTE get_employee_details(101); Function - SELECT calculate_salary(101);
Q7. What are the key features of ASP Dot Net CORE?
Key features of ASP Dot Net CORE include cross-platform support, high performance, and modularity.
Cross-platform support allows developers to build and run applications on Windows, macOS, and Linux.
High performance achieved through features like a new lightweight and modular HTTP request pipeline.
Modularity enables developers to include only the necessary components in their applications, reducing the overall size and improving performance.
Support for cloud-based applications...read more
Q8. What is Dependency Injection and how to achieve it
Dependency Injection is a design pattern where the dependencies of an object are provided externally rather than created within the object itself.
Dependencies are injected into a class through constructor injection, setter injection, or interface injection.
This helps in achieving loose coupling between classes and makes the code more testable and maintainable.
Example: Instead of creating an instance of a dependency within a class, the dependency is passed to the class from ou...read more
Q9. Difference between the Code First and Database First Approach
Code First: Develop database from code. Database First: Generate code from existing database.
Code First: Focus on code design and then generate database schema.
Database First: Focus on existing database schema and generate code classes.
Code First: More control over database design and relationships.
Database First: Faster development for existing databases.
Code First: Entity Framework Code First approach.
Database First: Entity Framework Database First approach.
Q10. How to connect SQL to ASP Core Web API
To connect SQL to ASP Core Web API, you need to configure a database connection in the API project.
Configure a connection string in the appsettings.json file of the API project.
Install Entity Framework Core package in the API project.
Create a DbContext class that inherits from DbContext and represents the database.
Use dependency injection to inject the DbContext into the API controllers.
Q11. What are the design patten we use in iOS?
iOS design patterns include MVC, MVVM, Singleton, Factory, and Observer.
MVC separates data, view, and controller logic
MVVM adds a view model to handle data binding
Singleton ensures only one instance of a class exists
Factory creates objects without exposing the creation logic
Observer allows objects to be notified of changes in other objects
Q12. What is ASP Dot Net Core?
ASP.NET Core is a cross-platform, high-performance framework for building modern, cloud-based, internet-connected applications.
Cross-platform framework for building web applications
High-performance and scalable
Supports cloud-based and internet-connected applications
Open-source and actively maintained by Microsoft
Modular design for flexibility and extensibility
Q13. Write an SQL Query to remove duplicate records
Use the DISTINCT keyword in an SQL query to remove duplicate records.
Use the SELECT DISTINCT statement to retrieve unique records.
Identify the columns that should be used to determine uniqueness.
Consider using GROUP BY clause with aggregate functions if needed.
Q14. Explain different ways to optimize SQL Queries
Optimizing SQL queries involves using indexes, minimizing data retrieval, and avoiding unnecessary joins.
Use indexes on columns frequently used in WHERE clauses
Minimize data retrieval by selecting only necessary columns
Avoid unnecessary joins by using EXISTS or IN clauses instead of JOINs
Q15. Explain the use and types of Indexing in SQL
Indexing in SQL is used to improve the performance of queries by creating a data structure that allows for faster retrieval of data.
Types of indexing include clustered and non-clustered indexes
Clustered indexes physically order the data in the table based on the index key
Non-clustered indexes create a separate data structure that includes the indexed columns and a pointer to the actual data
Indexes can be created on single or multiple columns to improve query performance
Q16. Explain the difference between States and Props
States are mutable data managed within a component, while Props are immutable data passed from parent to child components.
States are managed within a component and can be changed by the component itself
Props are passed from parent to child components and cannot be changed by the child component
States are used for internal component data management, while Props are used for passing data from parent to child components
Q17. Can we keep the reference variable of a parent class in the object of a child class?
Yes, we can keep the reference variable of a parent class in the object of a child class.
This is possible because a child class is a type of parent class and can inherit its properties and methods.
This allows for polymorphism, where a parent class reference variable can refer to an object of a child class.
For example, if we have a parent class Animal and a child class Dog, we can create an object of Dog and assign it to an Animal reference variable.
Q18. Explain the Use of Entity Framework Core
Entity Framework Core is an ORM framework that allows developers to work with databases using .NET applications.
Entity Framework Core is an Object-Relational Mapping (ORM) framework for .NET applications.
It allows developers to work with databases using .NET objects and LINQ queries.
EF Core supports various database providers such as SQL Server, SQLite, MySQL, etc.
It simplifies data access and persistence by handling database operations through code rather than SQL queries.
Q19. Explain the use of LINQ in C#
LINQ (Language Integrated Query) is a feature in C# that allows for querying data from different data sources using a uniform syntax.
LINQ allows for querying data from collections, databases, XML, and more.
It provides a set of standard query operators like Where, Select, OrderBy, etc.
LINQ queries are written in a declarative syntax similar to SQL.
Example: var result = from num in numbers where num % 2 == 0 select num;
Q20. What is clustered and non clustered index in SQL
Clustered index physically reorders the data in the table while non-clustered index creates a separate structure.
Clustered index determines the physical order of data in the table, while non-clustered index does not.
A table can have only one clustered index but multiple non-clustered indexes.
Clustered index is faster for retrieval of data but slower for insert and update operations.
Non-clustered index is slower for retrieval but faster for insert and update operations.
Example...read more
Q21. Why java doesn't support multiple inheritance?
Java doesn't support multiple inheritance to avoid the diamond problem.
Java supports multiple interface inheritance.
Diamond problem occurs when two superclasses have a common method.
Java uses interfaces to achieve multiple inheritance.
C++ supports multiple inheritance but requires virtual inheritance to avoid the diamond problem.
Q22. Where are the objects getting a memory in java?
Objects get memory in Java from the heap memory.
Java uses heap memory to allocate memory to objects.
The heap memory is managed by the JVM.
Objects are created using the 'new' keyword.
The memory allocated to an object is released by the garbage collector when it is no longer in use.
Q23. What are the different OOPS principles?
OOPS principles are the basic concepts of Object-Oriented Programming that help in designing and implementing software solutions.
Abstraction - hiding implementation details
Encapsulation - binding data and functions together
Inheritance - reusing code and creating new classes from existing ones
Polymorphism - using a single interface to represent multiple types
Composition - combining objects to create more complex ones
Q24. How do you handle exceptions in java?
Exceptions in Java are handled using try-catch blocks.
Exceptions are thrown when an error occurs during runtime.
The try block contains the code that may throw an exception.
The catch block catches the exception and handles it.
Multiple catch blocks can be used to handle different types of exceptions.
The finally block is executed regardless of whether an exception is thrown or not.
Q25. What is typecasting and its types?
Typecasting is the process of converting one data type to another data type in programming.
Typecasting is also known as type conversion.
There are two types of typecasting: implicit and explicit.
Implicit typecasting is done automatically by the compiler.
Explicit typecasting is done manually by the programmer.
Examples of typecasting include converting an integer to a float or a string to an integer.
Q26. How a java program compiles and run?
Java program compiles into bytecode which is executed by JVM.
Java code is written in .java files
Compiler converts .java files into .class files containing bytecode
JVM executes the bytecode
JVM provides platform independence
Java programs can be run on any platform with JVM installed
Q27. What is a reference variable in java?
A reference variable in Java is a variable that holds the memory address of an object.
Reference variables are used to access the methods and properties of an object.
They are declared using the class name followed by the variable name.
They can be assigned null or an object of the declared class or its subclasses.
They are passed by value, but the value is the memory address of the object.
Example: String str = new String("Hello World");
Example: Object obj = null;
Q28. What is upcasting and downcasting?
Upcasting is converting a derived class object to its base class type. Downcasting is the opposite.
Upcasting is safe and implicit
Downcasting is explicit and may cause runtime errors
Upcasting can be used for polymorphism
Downcasting is used to access derived class specific members
Example: Animal a = new Dog(); // upcasting
Example: Dog d = (Dog) a; // downcasting
Q29. Redux in react native and saga
Redux is a state management tool for React Native, while Saga is a middleware for handling side effects.
Redux is used to manage the state of the application in a predictable way.
Saga is used to handle side effects like asynchronous calls and impure functions.
Redux and Saga are often used together in React Native applications to manage state and side effects efficiently.
Top HR Questions asked in null
Interview Process at null
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month