Category Archives: C#

How exception filters can help you investigate runtime errors in C#

By | July 2, 2016

Exception filters are not new. Its been there for a long time (at least for than a year) as it is been released with .NET framework 6.0. But I do see developers don’t know the basic advantages of using exception filters and use code inside catch to determine problems. Let us look how exception filters can help you… Read More »

Back to Basic : How to count occurrences of a specific word in a sentence using C# ?

By | March 1, 2016

Write a C# code that count the occurrences of a word in a given sentence or string – yet another frequently  asked question in interview for the beginners. During the interview, while I found most of the developers were able to write the code, however the approaches taken are seems to  be lengthy. For an example, using substrings… Read More »

Back to Basics : Difference Between int.Parse() and int.TryParse()

By | January 16, 2016

What is the difference between int.Parse() and int.TryParse() ? Or how the int.parse() is differ from int.TryParse() ? – yet another frequently  asked question in interview for the beginners, and I have seen confusion while answering this.  Let’s try to understand using simple example. To answer this in a sort way, the int.Parse() and int.TryPrase() methods is used… Read More »

Back To Basics – Can we use both C# and VB Project within a single Visual Studio Solution ?

By | May 27, 2015

This is one of my favorite question during interview as a part of .NET Framework fundamental, and I generally received very mixed response. Can we have both c# and visual basic project in same solution ?.  The response  I used to received “No, it is not possible”, “Yes. we can do it for web project” etc. This question comes… Read More »

Back to Basics – Calling base class constructor from derived class in C#

By | May 13, 2015

How to call base class constructor from derived class ?  Another frequently  asked question in interview for the beginners, and I have seen confusion around answering this. Let’s have a quick understanding on this. If we derive a class from a base class and want to pass data from the derived class constructor to the constructor of the… Read More »

Back To Basics – Delegate in C#

By | May 6, 2015

A delegate person is someone who represent an organization or set of people. In C# world a delegate is a reference type variable that represent one or set of methods by holding there reference. Note: The reference can be changed at runtime.  So let’s first understand what it meant. Let’s have a class called BasicMaths having two methods Add and Subtract, which… Read More »

Workstation GC Vs Background GC

By | January 22, 2014

Well, there has been a confusion around the developer community on the differences between the Workstation GC which is by default recommended for standalone machines which targets one single CPU Core and the Background GC which provides multicore execution of Garbage Collections. In general aspect first let us consider how the Workstation is different from the server. A… Read More »