0% found this document useful (0 votes)
46 views4 pages

Name, Email Users Name, Email (COUNT ( ) ) : Select From Group BY Having

1. The document discusses various topics related to .NET, C#, SQL, and web development including LINQ joins, lambda expressions, singleton classes, MVC, transactions, and more. 2. Key points covered are LINQ joins using both query syntax and lambda expressions, the difference between static and sealed classes, how magic tables are used to hold inserted and deleted rows in SQL triggers, and the purpose of CORS for cross-origin requests. 3. Several questions are also provided relating to topics like exception handling, authentication, solid principles, and threading issues like starvation.

Uploaded by

Sumit Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views4 pages

Name, Email Users Name, Email (COUNT ( ) ) : Select From Group BY Having

1. The document discusses various topics related to .NET, C#, SQL, and web development including LINQ joins, lambda expressions, singleton classes, MVC, transactions, and more. 2. Key points covered are LINQ joins using both query syntax and lambda expressions, the difference between static and sealed classes, how magic tables are used to hold inserted and deleted rows in SQL triggers, and the purpose of CORS for cross-origin requests. 3. Several questions are also provided relating to topics like exception handling, authentication, solid principles, and threading issues like starvation.

Uploaded by

Sumit Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

1. Disposable interface.

Implementation of
dispose method. 2. Generation of garbage collector.

2a. joins in linq

2b. lambda exp.

3. Extension methods.

4. Partial methods in C# .net 4.0

5. Other use of new keyword rather than creating new object.

6. View state in asp.net - first and last method in asp.net life cycle where
can change get/change viewstate.

7. MVC and Action Filters. And web api.

8. Disposing COM unmanaged object.

9. How can you force a singleton class to create only one object. Code for
it.

10. MVC viewbag and viewdata 11. Why C# doesnt support multiple
inheritance. (ans: because of diamond problem)

12. DLL hell problem

13. Can a normal class me empty.

14. Difference between abstract class and interface and real world situation
where you will use interface and abastracat classes. SQL 1. Nested
Transaction. If inner transaction is commited and outer transaction fails .
What will be the overall state of that transaction. 2. Can SQL function have
transactions. 3. Transaction defined in both sql server and asp.net. What if
code does the commit and sql procedure commit fails. 4. Difference
between clustered and non clustered index. 5. SQL query to find duplicate
rows.

A: SELECT name, email


FROM users
GROUP BY name, email
HAVING ( COUNT(*) > 1 )
6. SQL query to delete duplicate rows.

With CTE_Duplicates as
(select empid,name , row_number() over(partition by empid,name order by empid,name
) rownumber
from EmpDup )
delete from CTE_Duplicates where rownumber!=1

6. Use of Threads.(thread starvation)

1. exception handling in mvc, c#, web api.

2. authentication n authorization in mvc, web api

3. solid principle

4. singleton
 CORS (Cross-Origin Resource Sharing)

Interview:
1. Join in linq:
var query = from p in db.Employees
join r in db.Students
on p.EmpId equals r.PersonId into temp
from t in temp.DefaultIfEmpty()
select new
{
Designation = p.EmpDesignation,
EmployeeName = p.EmpName,
FirstName = t.FirstName,
LastName = t.LastName,
Age = t.Age
};
2. Join in lambda exp:
var LambdaQuery = databaseEntities.Employees.Join(databaseEntities.Departments, e => e.ID,
d => d.EmpID, (e, d) => new
{ e.ID, e.Name, d.DepartmentName
});
3. A lambda expression is an anonymous function that you can use to create delegates or expression tree
types. By using lambda expressions, you can write local functions that can be passed as arguments or
returned as the value offunction calls.
4. Static vs Sealed:-

It can only have static members.

It cannot have instance members as static class instance cannot be created.

It is a sealed class.

As static class is sealed, so no class can inherit from a static class.

We cannot create instance of static class that's the reason we cannot have instance members in
static class, as static means shared so one copy of the class is shared to all.

Static class also cannot inherit from other classes.

Static class:
1) A static class can not be instantiated. Means you can't create instance of any static class.
2) A static class can have only static member (e.g static method, property, and variables).
3) A static class restrict the user to call default constructor of the class.
4) Static classes can only have static constructor to initialize static members.
5) Static classes are sealed so they can not be inherited.

Sealed Class:
1) When a class defined as sealed its not possible to inherit.
2) A Sealed class is last class of Inheritance feature.
3) Use the sealed modifier in a class declaration to prevent inheritance of the class.
4) It is not permitted to use the abstract modifier with a sealed class.
5) Structs are implicitly sealed; therefore, they cannot be inherited.

Magic Table:

1. Magic tables are nothing but inserted and deleted which are temporary objects
created by the server internally to hold recently inserted values in the case of insert
and to hold recently deleted values in the case of delete, to hold before updating
values or after updating values in the case of update.

Let us suppose if we write a trigger on the table on insert or delete or update. So


on insertion of a record into that table, the inserted table will be created
automatically by the database, on deletion of record from that table; the deleted
table will be created automatically by the database.

2. These two tables, inserted and deleted, are called magic tables.

3. Magic tables are used to put all the deleted and updated rows. We can retrieve
the column values from the deleted rows using the keyword "deleted".

4. These are not physical tables, only internal tables.


5. This Magic table is used In SQL Server 6.5, 7.0 & 2000 versions with Triggers
only.
6. But, In SQL Server 2005, 2008 & 2008 R2 Versions can use these Magic tables
with Triggers and Non-Triggers also.
7. Using with Triggers:

You might also like