Interview Time! with Notebooks

jkone27
2 min readOct 8, 2021

Coding assignments with dotnet interactive and vs-code live share

Thanks to new .NET interactive notebooks is now possible to do live (potentially polyglot as well!) coding assignments, having all the test in a single page, with a linear story-line for both the interviewers and the candidate.

Unlike jupyter notebooks, they don’t require a separate notebook kernel but they just run on top of .net interactive, installed as a global .net tool (the vscode extension will auto-install it for you)

I think this is pretty awesome. ☯️

Here is just an example using C# language, in this very simple example a candidate would have to run the code and make the test green…

The first thing the candidate must check is the DI container error, it’s clear a service must be registered, e.g. adding the line:

var services = host.Services;services.AddTransient<MyClass>(); //<<<<<<<<< was missing

In this example, the candidate has to further fix the MakeFive function to return correctly the number 5, and make the test go green.

public int MakeFive() => 5;

It’s just a dumbojumbo example of how this feature/technique could be used in a simple yet prolific manner.

Why not trying your own notebook now, in this next 5 minutes?

Have a great day!

--

--