.Net job interview framework

Some times company asks for online test or coding challenges to get an understanding of your development skills. The test are usually some answer to put in a doc with code example. In this case it would be interesting to have a solution where you can put all the development answers and submit to the company to show your interest on the role.

What I did is a C#2010 solution where you can

  • Add the programming question
  • Define the answer/solution that can be
    • Simple text
    • A set of file to implement working code
  • Unit testing of the implemented code

To use the solution

  • Refactor the NS from Client.Amatucci to what you like
  • Change the Programs.cs adding the relevant instances of TechnicalQuestionnaire

    Ex

    
    TechnicalQuestionnaire.Add(Test.FactoryTest(@"
    
    Describe with relevant code samples how to write a text file to the file system from .NET. What namespace would be the most important for this?"));
    
    
  • Change th TestSolver method to implement the solution using the DevSolution or the TxtSolution

    Ex

    
    
     case 2:
    
    {
    
    x.ImplementedSolution = new Solution.DevSolution(new List<string>() { "Devsolution\\OBDCTest.cs", "App.config" }) { TestSolved = x };
    
    break;
    
    }
    
    ...
    
     case 5:
    
    {
    
    x.ImplementedSolution = new Solution.TxtSolution(@"
    
    An interface represents a *** contract ***, in that a class that implements an interface must implement every aspect of that interface exactly as it is defined.") { TestSolved = x };
    
    break;
    
    }
    
    

    N> it matches your questions of course

The solution is made up of 3 projects, the Solution is where the simple framework is implemented, basically the Test class ‘has a’ ITestSolution that can be DevSOlution if you need to code or TxtSolution if you need to write text as solution of the technical questions…

Image

To conclude a simple class diagram to show the core, mail me if you need more info.

FonuaClassDIagram

The core Programs.cs


using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using Client.Amatucci.Solution;

namespace Client.Amatucci

{

class Program

{

static List<Test> TechnicalQuestionnaire = new List<Test>();

static void Initialize()

{

// Technical Questionnaire

//Question 1

TechnicalQuestionnaire.Add(Test.FactoryTest(@"

Describe with relevant code samples how to write a text file to the file system from .NET. What namespace would be the most important for this?"));


//...


//Question 10

TechnicalQuestionnaire.Add(Test.FactoryTest(@"

You turn your PC on and nothing seems to happen – your screen remains blank and you see no lights on the PC itself. Suggest some troubleshooting steps that you might take to get an idea of where the problem might lie.

", "==="));


}

static void TestSolver(List<Test> technicalQuestionnaire)

{

// ok it's not great here ...

technicalQuestionnaire.ForEach(x =>

{

switch (x.Id)

{

case 1:

{

x.ImplementedSolution =

new Solution.DevSolution(

new List<string>() { "Devsolution\\FileTxtWriter.cs" }) { TestSolved = x };

break;

}

case 2:

{

x.ImplementedSolution = new Solution.DevSolution(new List<string>() { "Devsolution\\OBDCTest.cs", "App.config" }) { TestSolved = x };

break;

}

//...


case 10:

{

x.ImplementedSolution = new Solution.TxtSolution(@"

I would:

1- check the plug is connected

2- check I have the electricity in the house

3- check the computer was not on already and maybe with the screen saver as black screen, in this case I've just switched off the pc

3-Check if the problem is just the monitor

I suggest to print this <a href="http://support.apple.com/kb/ht2173">http://support.apple.com/kb/ht2173</a>") { TestSolved = x };

break;

}

default:

break;

}

// solve it

if (x.ImplementedSolution != null)

x.ImplementedSolution.SolveIt();

});

}

static void Main(string[] args)

{

try

{

Initialize();

TestSolver(TechnicalQuestionnaire);

var technicalQuestionnaires = from t in TechnicalQuestionnaire

where t.ImplementedSolution != null

select t;


technicalQuestionnaires.ToList().ForEach(x =>

{

Console.WriteLine(x.GetQuestion());

Console.WriteLine(x.ImplementedSolution.ToString());

});

}

catch (ArgumentNullException e)

{

Console.WriteLine(e.Message);

}

catch (Exception e)

{

Console.WriteLine(e.Message);

}

finally

{

Console.ReadKey();

}

}

}

}

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s