.NET interview questions,c# interview questions ,

Apr 18

.NET interview questions and answers: - How to reverse a string in .NET ( DotNet)?

Reversing a string in c# is a three step process.

Step 1 :- First  convert the string to a char array.

string str = .NET interview questions with answers “;

char[] Array1 = str.ToArray(); // Step 1 :- Convert to a Array

Step 2 :-  Call the reverse method of the array.

Array.Reverse(Array1); // Step 2 :- call the reverse method

Step 3 :- Convert the reversed array back to string

string strrev = new string(Array1); // Step 3:- Convert the same back to a string

Below goes the complete code for the same.

string str = “c# interview questions with answers”;

char[] Array1 = str.ToArray(); // Step 1 :- Convert to a Array

Array.Reverse(Array1); // Step 2 :- call the reverse method

string strrev = new string(Array1); // Step 3:- Convert the same back to a string

Console.WriteLine(strrev);

This is a nice blog which has a nice collection of real time c# interview questions and answers.

We are also  thankful to Mr Shivprasad Koirala and Bpb publication to print such a awesome book c# interview questions and answers  

Mar 01

C# and ASP.NET interview question: - What is Ajax and how does it help?

Ajax stands for Asynchronous JavaScript and XML. There are two prime benefits of Ajax:-

 

The above question is taken from the bestselling c# and .NET interview question book written by Shivprasadkoirala and published by BPB publication.

References

Jan 28

15 real time .NET design pattern interview question asked in IT companies?

Below are 15 real time design pattern and .NET interview question asked in IT companies.

1.  You want to implement Audit trail which design patterns suits?

2. You want to implement a simple and customizable work flow which design patterns suits?

3. You have multiple data access methods i.e. SQL Server, Oracle which design patterns suits?

4.  You have a WPF application which architecture pattern suits better?

5.  You want to create your own language compiler which design pattern is better?

6. What are the ways by which you can implement dependency injection?

7. You have a third party DLL and some methods of that DLL are not compatible with current code in terms of naming convention which design pattern is better?

8. WCF and Web service implement which pattern internally?

9. ASP.NET page life cycle implement which design pattern internally?

10.“For each” syntax reminds you of which pattern?

11.   You have huge screen and you want to implement cancel functionality, without database trip.

12. Which is the best pattern to implement UNDO and REDO?

13. You have 5 heavy duty classes which talks with each other; your code has become clumsy which pattern is suitable?

14. How can we improve the below code in terms of consistency which pattern can help us for the same?

image


15. You have master tables and you want to cache them on Demand which design pattern is suited?

Design pattern interview question References for further reading:-


• If you want to Learn MVC ( Model view controller)  step by step start   from here 

• You can refer this comprehensive.NET interview question book  published by BPB publications.

Jan 04

SQL Server interview question :-Can we use CTE multiple times in a single execution?

If you are new to CTE please see (What is CTE ) SQL Server interview question first.

CTE can be used only once in the same execution. You can see the below code snippet where we have created a simple CTE called as “MyTemp”. In the same execution I have tried to use it 2 times and you can see how did not identify the “MyTemp” in the second select execution.
 

                     image

Some of the interviewer’s question further asking about in what scenarios we can use CTE.Below are some points.
 
CTE can be used in the following scenarios:-
 
Complex SQL queries can be broken down using CTE which will make your      code more readable. Note it does have side effect of performance.
Recursive query.
Replacement for views if you do not want to store the metadata.
You want use aggregate functions in WHERE clause.
You can group by scalar values which are derived from a result set.
 
You can also read our 10 SQL Server interview questions from here.


You can also see video on SQL Server Interview questions CTE (Common table expression):- 



Do visit us for more  SQL Server interview questions

Dec 31

SQL Server Interview question: - How to combine table row in to a single column / variable?

declare @Combine varchar(200)

set @Combine=”

SELECT @Combine = @Combine + [Column1] FROM [Customer].[dbo].[SomeTable]

print @Combine
 

You can also see SQL server interview question video :-
 

Dec 29

C# and ASP.NET MVC interview question: - What are “ActionFilters”in MVC?

“ActionFilters” helps you to perform logic before a MVC action happens or after a MVC action is completed. Action filters are useful in the following scenarios:-

1. Implement pre-processing / post processing logic before or after the action happens.

2. Cancel a current execution.

3. Inspect the returned value.

4. Provide extra data to the action.
 

Also read ASP.NET interview question :- What is difference between “Server.Transfer” and “Response.Redirect”?
 

Do visit for more c# and MVC interview questions and answer at  www.questpond.com
 

The above question is taken from the book published by Bpb publication .NET interview question by Shivprasad koirala.

Dec 10

C# and .NET interview question: - What is hashing?

 

This is a nice c# /.NET interview question which was asked to a senior consultant in capgemini Mumbai recently. So below is simple answer for the same.

Hashing is a process of converting string of characters into a shorter fixed-length value or key which represents the original string. It has many uses like encryption (MD5 , SHA1 etc) or creating a key by which the original values can be retrieved easily ( Hash tables collections in .NET). 

The above question was borrowed from book .NET interview questions and answers by koirala . 

Dec 05

c# and .NET interview question:- what connects dataset and data source ?

We had received this email from one our blog readers, who had gone for the c# /.NETinterview in Accenture.       


“Adapter” class connect the dataset and data source. Below is simple ADO.NET code where you can see how the “da” which is the data adapter is filling the dataset i.e. “CustomersDataSet” using the “Fill” method.

DataSet CustomersDataSet = new Dataset();

da = new SqlDataAdapter(“select * from CustTest order by Custld”, cn);

da.Fill(CustomersDataSet, “Customers”);

Just a quick note the above answer is taken from the book .NET interview question by Shivprasad koirala. 

Nov 27

ASP.NET and MVC Interview questions: - How can you do authentication and authorization in MVC?

Start learning MVC step by step from here Learn MVC step by step

You can use windows or forms authentication for MVC.

For windows authentication you need to go and modify the “web.config” file and set authentication mode to windows.

 

Then in the controller or on the action you can use the “Authorize” attribute which specifies which users have access to these controllers and actions. Below is the code snippet for the same. Now only  the users specified in the controller and action can access the same.

Forms authentication is implemented the same way as we do in ASP.NET. So the first step is to set authentication mode equal to forms. The “loginUrl” points to a controller here rather than page

We also need to create a controller where we will check the user is proper or not. If the user is proper we will set the cookie value 

All the other actions need to be attributed with “Authorize” attribute so that any unauthorized user if he makes a call to these controllers it will redirect to the controller ( in this case the controller is “Login”) which will do authentication.

 

Below is an important c# interview question and answers video:- Can you explain extension methods? 

See more stuffs on c#  and ASP.NET MVC interview question and answers

Regards,

Click here to view more c#/ASP.NET MVC interview question and answers

Nov 24

C# and ASP.NET MVC (Model view controller) interview questions and answers: - How can we restrict MVC actions to be invoked only by GET or POST? -

This article will explain how to restrict MVC actions to be invoked only by GET or POST.For more articles visit us at www.questpond.com

C# and ASP.NET MVC (Model view controller) interview questions and answers: – How to do validation in MVC (Model view controller)? -

This article explain you how to do validation in MVC (Model view controller).For more articles visit us at www.questpond.com

Nov 23

SQL Server Interview Question and answers:- Are SQL Server views updatable? -

In this article we will see does SQL Server views updatable.For more articles and Videos Visit us at http://www.questpond.com

[video]

Nov 21

C# interview questions: - Top c# interview questions asked in c# and .NET interviews -

This are the top C# interview questions.For more visit us on http://www.questpond.com

Nov 20

ASP.NET MVC (Model view controller) interview questions: - Is MVC different from a 3 layered architecture?

In case you are new to MVC start learning by click on this video learn MVC step by step.

MVC is an evolution of a 3 layered traditional architecture. Many components of 3 layered architecture are part of MVC.  So below is how the mapping goes.

 

Below is an important c# interview question video


See more stuffs on  ASP.NET interview questions

Regards,

Click here to view more C#/ASP.NET interview questions and answers