Interesting C# Interview Questions

Introduction

In this article, I would like to discuss some of the interesting c# interview questions,This post will be updated with new interesting c# interview questions.

Question and Answer

Q1 . Consider following code snippets

what will be the value of variable i after these two lines?

Continue reading “Interesting C# Interview Questions”

Delete Vs Truncate in SQL Server

Introduction

This article is about comparing  delete Vs truncate in SQL server, It is one of the most discussed topic on all SQL server forums, So there is no point in just discussing their basic difference, this article will be an elaborate one with supporting explanations.

Both delete and truncate command is used to for removing records from tables, the main difference between them lies in the way they perform this operation.

Delete Vs Truncate

Difference between delete and truncate can be summarized as below

Delete Truncate
Command Type DML DDL
Where Condition support does not support
Reset Identity Column no yes
Acquired lock row lock table and page lock
Transaction log for each deleted row one log indicating deallocation of page
Performance(Speed of execution)  slow much faster than Delete

Continue reading “Delete Vs Truncate in SQL Server”

How to Measure Execution Time in C#

Introduction

Sometimes we developers may have more than one way to do a single task. In those cases we can choose the best method based on their execution time. The article covers best methods to measure execution time of a complete c# program or a part of it with better accuracy.

Continue reading “How to Measure Execution Time in C#”

Short-circuit Evaluation in C#

Introduction

Hi everyone , in this article we’ll discuss C# short-circuit logical operators && and || in depth. Most of us must have used these operators before, but many of them don’t know about why we use && instead of &.Use of these operators(&& and ||) is one of the best practice over non short-circuit operators & and |. So you should know how it works, where to use them and how they increase speed of execution. let’s get started. Continue reading “Short-circuit Evaluation in C#”