0% found this document useful (0 votes)
105 views

02 C# Coding Questions For Technical Interviews - Ankit Sharma's Blog

Uploaded by

Arafat Zaman
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views

02 C# Coding Questions For Technical Interviews - Ankit Sharma's Blog

Uploaded by

Arafat Zaman
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog

C# Coding Questions For Technical Interviews

Introduction
In this article, we will learn about some of the frequently asked C# programming questions in
technical interviews.

Note: We won’t be using any inbuilt functions such as Reverse, Substring etc. for string manipulation,
also we will avoid using LINQ as these are generally restricted to be used in coding interviews.

Source Code
Download the source code for all the questions from GitHub (https://github.com/AnkitSharma-
007/csharp-interview-questions)

Q.1: How to reverse a string?


Ans.: The user will input a string and the method should return the reverse of that string

input: hello, output: olleh


input: hello world, output: dlrow olleh
1. internal static void ReverseString(string str)
2. {
3.
4. char[] charArray = str.ToCharArray();
5. for (int i = 0, j = str.Length - 1; i < j; i++, j--)
6. {
7. charArray[i] = str[j];
8. charArray[j] = str[i];
9. }
10. string reversedstring = new string(charArray);
11. Console.WriteLine(reversedstring);
12. }

Q.2: How to find if the given string is a palindrome or not?


Ans.: The user will input a string and we need to print “Palindrome” or “Not Palindrome” based on
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their
whether the input string is a palindrome or not.
use. Accept and close
To find out more, including how to control cookies, see here: Cookie Policy
input: madam, output: Palindrome
(https://ankitsharmablogs.com/privacy-policy/)
input: step on no pets, output: Palindrome
https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 1/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog

input: book, output: Not Palindrome

if we pass an integer as a string parameter then also this method will give the correct output

input: 1221, output: Palindrome


1. internal static void chkPalindrome(string str)
2. {
3. bool flag = false;
4. for (int i = 0, j = str.Length - 1; i < str.Length / 2; i++, j--)
5. {
6. if (str[i] != str[j])
7. {
8. flag = false;
9. break;
10. }
11. else
12. flag = true;
13. }
14. if (flag)
15. {
16. Console.WriteLine("Palindrome");
17. }
18. else
19. Console.WriteLine("Not Palindrome");
20. }

Q.3: How to reverse the order of words in a given string?


Ans.: The user will input a sentence and we need to reverse the sequence of words in the sentence.

input: Welcome to Csharp corner, output: corner Csharp to Welcome


1. internal static void ReverseWordOrder(string str)
2. {
3. int i;
4. StringBuilder reverseSentence = new StringBuilder();
5.
6. int Start = str.Length - 1;
7. int End = str.Length - 1;
8.
9. while (Start > 0)
10. {
11. if (str[Start] == ' ')
12. {
13. i = Start + 1;
14. while (i <= End)
15. {
16. reverseSentence.Append(str[i]);
17. i++;
18. }
19. reverseSentence.Append(' ');
20. End = Start - 1;
21. }
Privacy
22.& Cookies: This site uses cookies. By continuing to use this website, you agree to their
Start--;
use. 23. }
24.
To find out more, including how to control cookies, see here: Cookie Policy
25. for (i = 0; i <= End; i++)
(https://ankitsharmablogs.com/privacy-policy/)
26. {

https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 2/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog
27. reverseSentence.Append(str[i]);
28. }
29. Console.WriteLine(reverseSentence.ToString());
30. }

Q.4: How to reverse each word in a given string?


Ans.: The user will input a sentence and we need to reverse each word individually without changing
its position in the sentence.
input: Welcome to Csharp corner, output: emocleW ot prahsC renroc
1. internal static void ReverseWords(string str)
2. {
3. StringBuilder output = new StringBuilder();
4. List<char> charlist = new List<char>();
5.
6. for (int i = 0; i < str.Length; i++)
7. {
8. if (str[i] == ' ' || i == str.Length - 1)
9. {
10. if (i == str.Length - 1)
11. charlist.Add(str[i]);
12. for (int j = charlist.Count - 1; j >= 0; j--)
13. output.Append(charlist[j]);
14.
15. output.Append(' ');
16. charlist = new List<char>();
17. }
18. else
19. charlist.Add(str[i]);
20. }
21. Console.WriteLine(output.ToString());
22. }

Q.5: How to count the occurrence of each character in a string?


Ans.: The user will input a string and we need to find the count of each character of the string and
display it on console. We won’t be counting space character.

input: hello world;

output:

h–1

e–1
l–3

o–2

w – 1& Cookies: This site uses cookies. By continuing to use this website, you agree to their
Privacy
use.
Torfind
– 1 out more, including how to control cookies, see here: Cookie Policy
(https://ankitsharmablogs.com/privacy-policy/)
d–1
https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 3/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog
1. internal static void Countcharacter(string str)
2. {
3. Dictionary<char, int> characterCount = new Dictionary<char, int>();
4.
5. foreach (var character in str)
6. {
7. if (character != ' ')
8. {
9. if (!characterCount.ContainsKey(character))
10. {
11. characterCount.Add(character, 1);
12. }
13. else
14. {
15. characterCount[character]++;
16. }
17. }
18.
19. }
20. foreach (var character in characterCount)
21. {
22. Console.WriteLine("{0} - {1}", character.Key, character.Value);
23. }
24. }

Q.6: How to remove duplicate characters from a string?


Ans.: The user will input a string and the method should remove multiple occurrences of characters
in the string
input: csharpcorner, output: csharpone
1. internal static void removeduplicate(string str)
2. {
3. string result = string.Empty;
4.
5. for (int i = 0; i < str.Length; i++)
6. {
7. if (!result.Contains(str[i]))
8. {
9. result += str[i];
10. }
11. }
12. Console.WriteLine(result);
13. }

Q.7: How to find all possible substring of a given string?


Ans.: This is a very frequent interview question. Here we need to form all the possible substrings
from input string, varying from length 1 to the input string length. The output will include the input
string also.

Privacy & input: abcd


Cookies: This ,site
output : a ab abc
uses cookies. abcd b bctobcd
By continuing usecthis
cd website,
d you agree to their
use. 1. internal static void findallsubstring(string str)
To find2.
out more,
{ including how to control cookies, see here: Cookie Policy
(https://ankitsharmablogs.com/privacy-policy/)
3. for (int i = 0; i < str.Length; ++i)
4. {
https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 4/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog
5. StringBuilder subString = new StringBuilder(str.Length - i);
6. for (int j = i; j < str.Length; ++j)
7. {
8. subString.Append(str[j]);
9. Console.Write(subString + " ");
10. }
11. }
12. }

Q.8: How to perform Left circular rotation of an array?


Ans.: The user will input an integer array and the method should shift each element of input array to
its Left by one position in circular fashion. The logic is to iterate loop from Length-1 to 0 and swap
each element with last element.

input: 1 2 3 4 5, output: 2 3 4 5 1
1. internal static void RotateLeft(int[] array)
2. {
3. int size = array.Length;
4. int temp;
5. for (int j = size - 1; j > 0; j--)
6. {
7. temp = array[size - 1];
8. array[array.Length - 1] = array[j - 1];
9. array[j - 1] = temp;
10. }
11.
12. foreach (int num in array)
13. {
14. Console.Write(num + " ");
15. }
16. }

Q.9: How to perform Right circular rotation of an array?


Ans: The user will input an integer array and the method should shift each element of input array to
its Right by one position in circular fashion. The logic is to iterate loop from 0 to Length-1 and swap
each element with first element
input: 1 2 3 4 5, output: 5 1 2 3 4
1. internal static void RotateRight(int[] array)
2. {
3. int size = array.Length;
4. int temp;
5. for (int j = 0; j < size - 1; j++)
6. {
7. temp = array[0];
8. array[0] = array[j + 1];
9. array[j + 1] = temp;
10. }
Privacy
11.& Cookies: foreach
This site uses
(intcookies.
num in By continuing
array) to use this website, you agree to their
use. 12. {
13.
To find Console.Write(num
out more, including + " see
how to control cookies, ");here: Cookie Policy
14. }
(https://ankitsharmablogs.com/privacy-policy/)
15. }

https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 5/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog

Q.10: How to find if a positive integer is a prime number or not?


Ans.: The user will input a positive integer and the method should output “Prime” or “Not Prime”
based on whether the input integer is a prime number or not.

The logic is to find a positive integer less than or equal to the square root of input integer. If there is
a divisor of number that is less than the square root of number, then there will be a divisor of
number that is greater than square root of number. Hence, we have to traverse till the square root
of number.

The time complexity of this function is O(√N) because we traverse from 1 to √N.

input: 20, output: Not Prime


input: 17, output: Prime
1. static void Main(string[] args)
2. {
3. if (FindPrime(47))
4. {
5. Console.WriteLine("Prime");
6. }
7. else
8. {
9. Console.WriteLine("Not Prime");
10. }
11. Console.ReadLine();
12. }
13.
14. internal static bool FindPrime(int number)
15. {
16. if (number == 1) return false;
17. if (number == 2) return true;
18. if (number % 2 == 0) return false;
19.
20. var squareRoot = (int)Math.Floor(Math.Sqrt(number));
21.
22. for (int i = 3; i <= squareRoot; i += 2)
23. {
24. if (number % i == 0) return false;
25. }
26.
27. return true;
28. }

Q.11: How to find the sum of digits of a positive integer?


Ans.: The user will input a positive integer and the method should return the sum of all the digits in
that integer.
input: 168, output: 15
Privacy1.& Cookies:
internal static
This site void SumOfDigits(int
uses cookies. By continuing to usenum)
this website, you agree to their
use. 2. {
To find3. int sum = 0;
out more, including how to control cookies, see here: Cookie Policy
4. while (num > 0)
(https://ankitsharmablogs.com/privacy-policy/)
5. {

https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 6/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog
6. sum += num % 10;
7. num /= 10;
8. }
9. Console.WriteLine(sum);
10. }

Q.12: How to find second largest integer in an array using only one
loop?
Ans.: The user will input an unsorted integer array and the method should find the second largest
integer in the array.

input: 3 2 1 5 4, output: 4
1. internal static void FindSecondLargeInArray(int[] arr)
2. {
3. int max1 = int.MinValue;
4. int max2 = int.MinValue;
5.
6. foreach (int i in arr)
7. {
8. if (i > max1)
9. {
10. max2 = max1;
11. max1 = i;
12. }
13. else if (i >= max2 && i != max1)
14. {
15. max2 = i;
16. }
17. }
18. Console.WriteLine(max2); ;
19. }

Q.13: How to find third largest integer in an array using only one
loop?
Ans.: The user will input an unsorted integer array and the method should find the third largest
integer in the array.

input: 3 2 1 5 4, output: 3
1. internal static void FindthirdLargeInArray(int[] arr)
2. {
3. int max1 = int.MinValue;
4. int max2 = int.MinValue;
5. int max3 = int.MinValue;
6.
7. foreach (int i in arr)
8. {
9. if (i > max1)
10. {
11. max3
Privacy & Cookies: This site uses = max2;
cookies. By continuing to use this website, you agree to their
use. 12. max2 = max1;
13. max1 = i;
To find out more, including how to control cookies, see here: Cookie Policy
14. }
(https://ankitsharmablogs.com/privacy-policy/)
15. else if (i > max2 && i != max1)

https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 7/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog
16. {
17. max3 = max2;
18. max2 = i;
19. }
20. else if (i > max3 && i != max2 && i != max1)
21. {
22. max3 = i;
23. }
24. }
25. Console.WriteLine(max3); ;
26. }

Q.14: How to convert a two-dimensional array to a one-dimensional


array?
Ans.: The user will input a 2-D array (matrix) and we need to convert it to a 1-D array. We will create a
1-D array column-wise.

input: { { 1, 2, 3 }, { 4, 5, 6 } }, output: 1 4 2 5 3 6
1. internal static void MultiToSingle(int[,] array)
2. {
3. int index = 0;
4. int width = array.GetLength(0);
5. int height = array.GetLength(1);
6. int[] single = new int[width * height];
7.
8. for (int y = 0; y < height; y++)
9. {
10. for (int x = 0; x < width; x++)
11. {
12. single[index] = array[x, y];
13. Console.Write(single[index] + " ");
14. index++;
15. }
16. }
17. }

This question can also be asked to form a 1-D array row-wise. In this case, just swap the sequence
of the for loops as shown below. The output will be 1 2 3 4 5 6 for the input matrix mentioned above.
1. for (int x = 0; x < width; x++ )
2. {
3. for ( int y = 0; y < height; y++)
4. {
5. single[index] = array[x, y];
6. Console.Write(single[index] + " ");
7. index++;
8. }
9. }

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their
use.
To find out more, including how to control cookies, see here: Cookie Policy
(https://ankitsharmablogs.com/privacy-policy/)

https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 8/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog

Q.15: How to convert a one-dimensional array to a two-dimensional


array?
Ans.: The user will input a 1-D array along with the number of rows and columns. The method should
convert this 1-D array to a 2-D array(matrix) of a given row and column. We will create a matrix row-
wise.
input: {1, 2, 3, 4, 5, 6} ,2 ,3
output:

123

456
1. internal static void SingleToMulti(int[] array, int row, int column)
2. {
3. int index = 0;
4. int[,] multi = new int[row, column];
5.
6. for (int y = 0; y < row; y++)
7. {
8. for (int x = 0; x < column; x++)
9. {
10. multi[y, x] = array[index];
11. index++;
12. Console.Write(multi[y, x] + " ");
13. }
14. Console.WriteLine();
15. }
16. }

Q.16: How to find the angle between hour and minute hands of a
clock at any given time?
Ans.: The user will input the hour and minute of the time and the method should give the angle
between the hour hand and minute hand at that given time.
input: 9 30, output: The angle between hour hand and minute hand is 105 degrees
input: 13 30, output: The angle between hour hand and minute hand is 135 degrees

The logic is to find the difference in the angle of an hour and minute hand from the position of 12 O
Clock when the angle between them is zero. Each hour on the clock represents an angle of 30
degrees (360 divided by 12). Similarly, each minute on the clock will represent an angle of 6 degrees
(360 divided by 60) and the angle for an hour will increase as the minutes for that hour increases.

So, our code will be as follows:


1. internal static void FindAngleinTime(int hours, int mins)
2. {
3. double hourDegrees = (hours * 30) + (mins * 30.0 / 60);
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their
4. double minuteDegrees = mins * 6;
use.
5.
To find6.
out more, including how to control cookies, see here: Cookie Policy
double diff = Math.Abs(hourDegrees - minuteDegrees);
(https://ankitsharmablogs.com/privacy-policy/)
7.
8. if (diff > 180)
https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 9/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog
9. {
10. diff = 360 - diff;
11. }
12.
13. Console.WriteLine("The angle between hour hand and minute hand is {0}
degrees", diff);
14. }

Q.17: Explain Bubble Sort Algorithm In C#


This algorithm follows the concept of iterating through the array from the first index to the last index
and comparing adjacent elements and then swapping them if they appear in the wrong order. i.e. If
the next element is smaller than the current element, they are swapped.

The Time Complexity of bubble sort is O(n²).

Read Bubble Sort Algorithm In C# (https://ankitsharmablogs.com/bubble-sort-algorithm-in-c-


sharp/) to learn more.

Q.18: Explain Quick Sort Algorithm In C#


This Algorithm selects an element as a pivot element from the given array and partitions the array
around it such that, Left side of the pivot contains all the elements that are less than the pivot
element. The right side contains all elements that are greater than the pivot element. Let P be the
index of pivot after partitioning the array. Then, the left subarray(start to P-1) and right subarray(P+1
to end) are sorted recursively to get the final sorted array as output.

The worst-case time complexity of this algorithm is O(N²). The best-case and average-case time
complexity of this algorithm is O(NLogN).

Read Quick Sort Algorithm In C# (https://ankitsharmablogs.com/quick-sort-algorithm-in-c-sharp/) to


learn more.

Q.19: Explain Merge Sort Algorithm In C#


This algorithm works as follows.

Divide the unsorted array of size N into N subarrays having single element each.
Take two adjacent subarrays and merge them to form a sorted subarray having 2
elements.Now we have N/2 subarrays of size 2.
Repeat the process until a single sorted array is obtained.
In all three cases (worst, average, best), the time complexity of Merge sort is O(NLogN)

Read Merge Sort Algorithm In C# (https://ankitsharmablogs.com/merge-sort-algorithm-in-c-sharp/) to


learn more.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their
use.
To find out more, including how to control cookies, see here: Cookie Policy
(https://ankitsharmablogs.com/privacy-policy/)

https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 10/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog

Q. 20: Explain Insertion Sort Algorithm In C#


Insertion sort compares the current element with the largest value in the sorted array. If the current
element is smaller then the algorithm finds its correct position in a sorted array and moves the
element to that position otherwise if the current element is greater then it leaves the element in its
place and moves on to the next element.

To place the element in its correct position in a sorted array, all the elements larger than the current
element are shifted one place ahead. Thus the sorted array will grow at each iteration.

Every element is compared to every other element of a sorted array. Hence the complexity of
Insertion sort is O(n²).
Read Insertion Sort Algorithm In C# (https://ankitsharmablogs.com/insertion-sort-algorithm-in-c-
sharp/) to learn more.

Q. 21: Explain Selection Sort Algorithm In C#


This algorithm follows the concept of dividing the given array into two subarrays.

1. The subarray of sorted elements


2. The subarray of unsorted elements
The algorithm will find the minimum element in the unsorted subarray and put it into its correct
position in the sorted subarray.

Read Selection Sort Algorithm In C# (https://ankitsharmablogs.com/selection-sort-algorithm-in-c-


sharp/) to learn more.

The time complexity of Selection Sort as O(n²).

Q. 22: Explain Binary Search In C#


Binary search is an efficient and commonly used searching algorithm. This algorithm works only on
sorted sets of elements. So if the given array is not sorted then we need to sort it before applying
Binary search.

This algorithm searches a sorted array by repeatedly dividing the search interval in half. Begin with
an interval covering the whole array. If the value of the search key is less than the item in the middle
of the interval, narrow the interval to the lower half. Otherwise narrow it to the upper half.
Repeatedly check until the value is found or the interval is empty. If found return the index of
matched element, else return -1.

Read Searching Algorithms In C# (https://ankitsharmablogs.com/searching-algorithms-in-c-sharp/) to


learn more.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their
The array to be searched is reduced by half in every iteration. Hence time complexity of the Binary
use.
Tosearch
find outismore, including how to control cookies, see here: Cookie Policy
O(LogN).
(https://ankitsharmablogs.com/privacy-policy/)

https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 11/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog

Summary
I hope you like this collection of interview questions. If you have any suggestions or want me to
include any new questions, please let me know through the contact
(https://ankitsharmablogs.com/contact/) page.

You can download the source code for this article from GitHub (https://github.com/AnkitSharma-
007/csharp-interview-questions) and play around to get a better understanding.
You can also read my other articles here (https://ankitsharmablogs.com/)

See Also
JavaScript Interview Questions (https://learnersbucket.com/examples/topics/interview/)

Search...

FOLLOW ME

(https:/ (https:/
/www.f (https:/ /www.l (https:/ (https:/
aceboo /twitte inkedi /mediu /github
k.com/ r.com/ n.com/ m.com .com/A
Ankit.S ankitsh in/anki /@anki nkitSh
harma. arma_ tsharm tsharm arma-
0709) 007) a-007/) ablog) 007)

BUY ME A COFFEE

Buy me a coffee(https://www.buymeacoffee.com/ankitsharma)

FOLLOW MY BLOG

Ankit Sharma's Blog (http://feeds.feedburner.com/~r/AnkitSharmasBlog/~6/6)

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their
use.SUBSCRIBE TO BLOG VIA EMAIL
To find out more, including how to control cookies, see here: Cookie Policy
(https://ankitsharmablogs.com/privacy-policy/)
Enter your email address to subscribe to this blog and receive notifications of new posts by email.
https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 12/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog

Email Address

SUBSCRIBE

GET MY BOOK ON BLAZOR

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their
use.
To find out more, including how to control cookies, see here: Cookie Policy
(https://www.amazon.in/gp/product/178934414X/ref=as_li_tl?
(https://ankitsharmablogs.com/privacy-policy/)

https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 13/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog

ie=UTF8&camp=3638&creative=24630&creativeASIN=178934414X&linkCode=as2&tag=007056f-
21&linkId=594bb7b7027f32d6fe66badf87acd038)

GET MY BOOK ON C#

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their
use.(https://www.amazon.in/gp/product/B0862DM82C/ref=as_li_tl?
To find out more, including how to control cookies, see here: Cookie Policy
ie=UTF8&camp=3638&creative=24630&creativeASIN=B0862DM82C&linkCode=as2&tag=007056f-
(https://ankitsharmablogs.com/privacy-policy/)
21&linkId=add223fa9297e51c756d4390d92b6dd4)
https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 14/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog
FREE EBOOK ON ANGULAR AND FIREBASE

(https://www.c-sharpcorner.com/ebooks/build-a-full-stack-web-

application-using-angular-and-firebase)

CATEGORIES

ASP.NET Core (https://ankitsharmablogs.com/category/asp-net-core/) 33

Blazor (https://ankitsharmablogs.com/category/blazor/) 20

C# (https://ankitsharmablogs.com/category/c/) 17

Angular (https://ankitsharmablogs.com/category/angular/) 15

Algorithm (https://ankitsharmablogs.com/category/algorithm/) 6

Azure (https://ankitsharmablogs.com/category/azure/) 6

.NET Core (https://ankitsharmablogs.com/category/net-core/) 4

Angular 5 (https://ankitsharmablogs.com/category/angular-5/) 4

RECENT POSTS

Announcing A New Blazor Course (https://ankitsharmablogs.com/announcing-a-new-blazor-


course/) July 22, 2021

How To Solve Sudoku Using Azure Form Recognizer (https://ankitsharmablogs.com/how-to-solve-


sudoku-using-azure-form-recognizer/) April 3, 2021

Privacy
Going & Cookies: This With
Serverless site uses cookies.
Blazor By continuing to use this website, you agree to their
(https://ankitsharmablogs.com/going-serverless-with-blazor/) June 12,
use.2020
To find out more, including how to control cookies, see here: Cookie Policy
(https://ankitsharmablogs.com/privacy-policy/)

https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 15/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog

Announcing A Free eBook On Angular and Firebase (https://ankitsharmablogs.com/announcing-a-


free-ebook-on-angular-and-firebase/) May 1, 2020

Optical Character Reader Using Angular And Azure Computer Vision


(https://ankitsharmablogs.com/optical-character-reader-using-angular-and-azure-computer-vision/)
March 9, 2020

POPULAR POSTS

ASP.NET Core – CRUD Using Angular And Entity Framework Core


(https://ankitsharmablogs.com/asp-net-core-crud-using-angular-and-entity-framework-
core/)
March 17, 2018

Single Page Application Using Server-Side Blazor (https://ankitsharmablogs.com/single-


page-application-using-server-side-blazor/)
August 10, 2018

CRUD Operations With ASP.NET Core Using Angular and ADO.NET


(https://ankitsharmablogs.com/crud-operations-asp-net-core-using-angular-ado-net/)
January 1, 2018

Localization In Angular Using i18n Tools (https://ankitsharmablogs.com/localization-in-


angular-using-i18n-tools/)
January 29, 2019

BlazorGrid – A Reusable Grid Component For Blazor


(https://ankitsharmablogs.com/blazorgrid-reusable-grid-component-for-blazor/)
December 2, 2018

ARCHIVES

Select Month

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their
use.
To find out more, including how to control cookies, see here: Cookie Policy
(https://ankitsharmablogs.com/privacy-policy/)

https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 16/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog
GDE FOR ANGULAR

(https://developers.google.com/community/experts/directory/profile/profile-ankit-sharma)

MICROSOFT MVP

(https://mvp.microsoft.com/en-us/PublicProfile/5004063?fullName=Ankit%20Sharma)

C# CORNER MVP

(https://www.c-sharpcorner.com/members/ankit-

sharma93)

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their
use.
To find out more, including how to control cookies, see here: Cookie Policy
(https://ankitsharmablogs.com/privacy-policy/)

https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 17/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog
TAGS

.NET Core (https://ankitsharmablogs.com/tag/net-core/)

.NET Framework (https://ankitsharmablogs.com/tag/net-framework/)

ADO.NET (https://ankitsharmablogs.com/tag/ado-net/) AI (https://ankitsharmablogs.com/tag/ai/)

Algorithm (https://ankitsharmablogs.com/tag/algorithm/) Angular (https://ankitsharmablogs.com/tag/angular/)

Angular 5 (https://ankitsharmablogs.com/tag/angular-5/)

Angular 6 (https://ankitsharmablogs.com/tag/angular-6/)

Angular 7 (https://ankitsharmablogs.com/tag/angular-7/)

Angular Animation (https://ankitsharmablogs.com/tag/angular-animation/)

Angular CLI (https://ankitsharmablogs.com/tag/angular-cli/)

ASP.NET CORE (https://ankitsharmablogs.com/tag/asp-net-core/)

ASP.NET Core 2.0 (https://ankitsharmablogs.com/tag/asp-net-core-2-0/)

ASP.NET Core 3.0 (https://ankitsharmablogs.com/tag/asp-net-core-3-0/)

Authentication (https://ankitsharmablogs.com/tag/authentication/)

Authorization (https://ankitsharmablogs.com/tag/authorization/)

Azure (https://ankitsharmablogs.com/tag/azure/)

Azure Function (https://ankitsharmablogs.com/tag/azure-function/)

Blazor (https://ankitsharmablogs.com/tag/blazor/) BlazorGrid (https://ankitsharmablogs.com/tag/blazorgrid/)

C# (https://ankitsharmablogs.com/tag/c/)

Cognitive Services (https://ankitsharmablogs.com/tag/cognitive-services/)

CRUD (https://ankitsharmablogs.com/tag/crud/)

Data Structures (https://ankitsharmablogs.com/tag/data-structures/)

Entity Framework (https://ankitsharmablogs.com/tag/entity-framework/)

Entity Framework Core (https://ankitsharmablogs.com/tag/entity-framework-core/)

Facebook authentication (https://ankitsharmablogs.com/tag/facebook-authentication/)

Firebase (https://ankitsharmablogs.com/tag/firebase/)

Form Validation (https://ankitsharmablogs.com/tag/form-validation/)

Google authentication (https://ankitsharmablogs.com/tag/google-authentication/)

Highcharts (https://ankitsharmablogs.com/tag/highcharts/)

Hosting (https://ankitsharmablogs.com/tag/hosting/) Q# (https://ankitsharmablogs.com/tag/q/)

Quantum
Privacy Computer
& Cookies: (https://ankitsharmablogs.com/tag/quantum-computer/)
This site uses cookies. By continuing to use this website, you agree to their
use.
Quantum Development Kit (https://ankitsharmablogs.com/tag/quantum-development-kit/)
To find out more, including how to control cookies, see here: Cookie Policy
(https://ankitsharmablogs.com/privacy-policy/)
server-side Blazor (https://ankitsharmablogs.com/tag/server-side-blazor/)

https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 18/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog

Serverless (https://ankitsharmablogs.com/tag/serverless/)

Single Page Application (https://ankitsharmablogs.com/tag/single-page-application/)

SQL Server (https://ankitsharmablogs.com/tag/sql-server/)

Typescript (https://ankitsharmablogs.com/tag/typescript/)

Visual Studio (https://ankitsharmablogs.com/tag/visual-studio/)

Visual Studio 2017 (https://ankitsharmablogs.com/tag/visual-studio-2017/)

Visual Studio 2019 (https://ankitsharmablogs.com/tag/visual-studio-2019/)

Visual Studio Code (https://ankitsharmablogs.com/tag/visual-studio-code/)

Web API (https://ankitsharmablogs.com/tag/web-api/)

BLOG STATS

1,182,135 visits

POPULAR POSTS

ASP.NET Core – CRUD Using Angular And Entity Framework Core


(https://ankitsharmablogs.com/asp-net-core-crud-using-angular-and-entity-framework-core/)
March 17, 2018

Single Page Application Using Server-Side Blazor (https://ankitsharmablogs.com/single-page-


application-using-server-side-blazor/)
August 10, 2018

CRUD Operations With ASP.NET Core Using Angular and ADO.NET


(https://ankitsharmablogs.com/crud-operations-asp-net-core-using-angular-ado-net/)
January 1, 2018

Localization In Angular Using i18n Tools (https://ankitsharmablogs.com/localization-in-angular-


using-i18n-tools/)
January 29, 2019

BlazorGrid
Privacy & Cookies: – Auses
This site Reusable
cookies.Grid Component
By continuing to useFor
thisBlazor (https://ankitsharmablogs.com/blazorgrid-
website, you agree to their
use. reusable-grid-component-for-blazor/)
To find out more, including how to control cookies, see here: Cookie Policy
December 2, 2018
(https://ankitsharmablogs.com/privacy-policy/)

https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 19/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog
CATEGORIES

ASP.NET Core (https://ankitsharmablogs.com/category/asp-net-core/) 33

Blazor (https://ankitsharmablogs.com/category/blazor/) 20

C# (https://ankitsharmablogs.com/category/c/) 17

Angular (https://ankitsharmablogs.com/category/angular/) 15

Algorithm (https://ankitsharmablogs.com/category/algorithm/) 6

Azure (https://ankitsharmablogs.com/category/azure/) 6

.NET Core (https://ankitsharmablogs.com/category/net-core/) 4

Angular 5 (https://ankitsharmablogs.com/category/angular-5/) 4

FOLLOW ME

(https:/ (https:/
/www.f (https:/ /www.l (https:/ (https:/
aceboo /twitte inkedi /mediu /github
k.com/ r.com/ n.com/ m.com .com/A
Ankit.S ankitsh in/anki /@anki nkitSh
harma. arma_ tsharm tsharm arma-
0709) 007) a-007/) ablog) 007)

BLOG STATS

1,182,135 hits

HOME (HTTPS://ANKITSHARMABLOGS.COM)

INTERVIEW QUESTIONS (HTTPS://ANKITSHARMABLOGS.COM/CSHARP-CODING-QUESTIONS-FOR-TECHNICAL-


INTERVIEWS/)

Privacy
ABOUT & Cookies: This site uses cookies. By continuing to useCONTACT
(HTTPS://ANKITSHARMABLOGS.COM/ABOUT/) this website, you agree to their
(HTTPS://ANKITSHARMABLOGS.COM/CONTACT/)
use.
To find out more, including how to control cookies, see here: Cookie Policy
PRIVACY POLICY (HTTPS://ANKITSHARMABLOGS.COM/PRIVACY-POLICY/)
(https://ankitsharmablogs.com/privacy-policy/)

https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 20/21
12/2/24, 2:11 PM C# Coding Questions For Technical Interviews - Ankit Sharma's Blog

© Ankit Theme by Colorlib (http://colorlib.com/) Powered by WordPress (http://wordpress.org/)

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their
use.
To find out more, including how to control cookies, see here: Cookie Policy
(https://ankitsharmablogs.com/privacy-policy/)

https://ankitsharmablogs.com/csharp-coding-questions-for-technical-interviews/ 21/21

You might also like