MeritTraclogo
Banner

C# or C sharp is a general-purpose programming language that was created by Microsoft in the year 2000. The purpose of creating this computing language was to build web, mobile and Windows software targeting platforms. This computing language is also used in building cloud APIs, serverless applications, UI apps, console apps, backend services and lots more. Microsoft dot Net applications are built using C#. Also, C sharp is used to build web applications, native iOS and Android applications. The modern applications of this computing language are machine learning, blockchain and AI products. A few examples of C# products are Photoshop, Paintbrush, Visual Studio 2012, SQL Server 2012, Skype, Microsoft Office and Internet Explorer.

With such a wide range of applications, there is always a demand for coders who have knowledge and expertise in this computing language. Organisations that are looking to recruit programmers for their entry-level or higher positions usually use traditional recruitment methods of resume shortlisting and asking C# programming interview questions. While these methods can help recruiters identify potential candidates, they cannot give you accurate hiring solutions. Due to time constraints and other factors, a hiring manager cannot ask many C# interview questions during a face to face interview to gauge a candidate’s knowledge and evaluate the job fit. We suggest using online programming tests as a first-level screen method. Candidates who clear the first-level online screening test can be called in for an interview where they can be further evaluated with C# or oops interview questions. The next section will give you a general idea of the kind of questions that can be asked in an online programming skill assessment test.

C# programming Interview Questions

Q1. Choose the method that is used to convert a type to a byte value in C#

  1. ToChar
  2. ToDateTime
  3. ToByte
  4. ToSingle

Ans: c. ToByte

Q2. Choose the preprocessor directive that lets you generate a level 1 warning from a specific location in your C# code?

  1. Region
  2. Warning
  3. Line
  4. Error

Ans: b. Warning

Q3. Find the output of this code snippet?

class program

 {

  public static void Main(string[] args)

  {

      try

      {

          throw new NullReferenceException("C");

          Console.WriteLine("A");

      }

      catch (ArithmeticException e)

      {

          Console.WriteLine("B");

      }

      Console.ReadLine();

  }

 }

  1. A
  2. B
  3. Runtime error
  4. Compile time error

Ans: c. Runtime error

Explanation: try block throws a NullPointerException. Its arithmetic expression is countered by the catch block. However, in this case, there is no catch to counter the NullPointerExtension, so a runtime error occurs.

Q4. What is the output of the below code snippet?

static void Main(string[] args)

  {

   int i = 0, j = 0;

   l1: while (i < 2)

   { 

       i++;

       while (j < 3)

       {

              Console.WriteLine("loop\n");

           goto l1;

       }

    }

   Console.ReadLine();

  }

  1. Loop
  2. Loop printed infinite times
  3. Loop loop
  4. Compile time error

Ans: c. Loop loop

Explanation:  (i<2) executes twice. If the loop tries to execute the third time, it will not satisfy the condition (j<3), so it breaks. The output will then be loop loop.

Q5. What object size will be created by the below code?

{

class Baseclass

{

     private int i;

     protected int j;

     public int k;

}

class Derived: Baseclass

{

     private int x;

     protected int y;

     public int z;

}

class MyProgram

{

     static void Main (string[ ] args)

     {

        Derived d = new Derived();

     }

}

}

  1. 12 bytes
  2. 20 bytes
  3. 24 bytes
  4. 10 bytes

Ans: c. 24 bytes

Applications of MeritTrac Assessment Solutions

MeritTrac offers customised assessment solutions that can be used both for hiring and workforce development. During campus interviews, walk-ins or other large volume recruitment drives, it can be practically impossible to ask C# programming interview questions to the hundreds of candidates. This is where MeritTrac assessment solutions step in. Recruiters (even those who don’t have a technical background) can use our online assessment platform to administer programming tests. The platform automatically evaluates the answers and gives you the results. Hundreds of candidates can take up the test simultaneously. And in just a few hours, you will have a list of the top-ranking candidates who can go in for the next round of interviews. The same can be done for lateral hiring. Instead of calling in the senior programmers to the office, they can be asked to take up the online test. MeritTrac assessment platform has a remote proctoring option, which prevents malpractices. If the candidate clears this test, he/she can be called in for the second round, where they can be evaluated with essential C# interview questions by the hiring manager.

When it comes to workforce development, our assessment tool helps you identify the skill sets and learning gaps in the existing workforce. The results of the assessments can be analysed to make data-driven decisions during succession planning or while moving coders to new projects. The learning gaps identified by the assessments can be used as input to design a training program for the team.

MeritTrac Platform for C# Programmer Assessment

CodeTrac is MeritTrac’s assessment platform that has been specially designed for evaluating programming knowledge and skills. The platform has thousands of inbuilt tests, which can be customised based on the job profile. Also, the test can be designed based on the computing language or project. CodeTrac has a unified assessment platform with an integrated programming environment that can be used to build, compile and test stages. Also, this platform has an extensive programming library with all the popular and essential computing languages. It allows you to administer any computer programming tests. The other features of this assessment platform are uniform coding and auto evaluation.

It is very easy to administer programming tests using CodeTrac. The test is assigned to candidates on the online platform. The platform authenticates and verifies the candidate before allowing them to take up the test. Once the candidates complete the test, the platform digitally evaluates the answers and gives you the result. It can also give you a rank-wise list and analytics of the results obtained, which can be used to support your hiring decisions.

FAQ