C# Interviews Tips

What to expect when going for a mid-weight C# web developer position?

below are two questions that are likely to be in a technical test during an interview.

remember!

some companies will ask you to write code in a paper

or in a whiteboard

or if you have in your laptop.

however, other companies will give you multiple answers choice, and you will have to choose one and why?

which in my opinion is a much better approach for you (candidate) to complete the test in a relaxed manner

rather than write down the code in a paper.

         

public class BaseDice 
{      
    public string Color { get; set; }    
    public int NumberOfSides { get; set; } 
    public int Roll() 
}

 

         

var string1 = ″Mother-in-law″; 
var string2 = ″Mission possible″;

 

static bool CheckAnagramOfString(string inputString1, string inputString2)
{
char[] charArr1 = inputString1.ToCharArray();
char[] charArr2 = inputString2.ToCharArray();
//sort both of them in same order
Array.Sort(charArr1);
Array.Sort(charArr2);
// arrays as string
inputString1 = new string(charArr1);
inputString2 = new string(charArr2);
// compare strings and return true if similar
if (inputString1.Equals(inputString2))
{
return true;
}
else
{
return false;
}
}

 

or

var string1 = ″Mother-in-law″; 
var string2 = ″Mission possible″;

if(string1.Contains("-"))

{

      console.writeline(string1)

}

else

{

 console.writeline(string2 )

}