Test description

This test was designed to check the advanced knowledge and coding skills of C# developers who are up-to-date with the latest versions and features in C#. Most of the questions include pieces of code that evaluate your understanding of the latest enhancements in the C# language (up to version 10.0).
Topics: record structs, global using directives, extended property patterns, improvements on lambda expressions, classes and interfaces, dynamic types, CodeDom, extension methods, pattern matching, nullable reference types, slice, tasks, deconstructors.

Sample questions

1
What will be the result of the following code?

public class Vehicle
{
    public void BoostSpeed(double boost)
    {
        Console.WriteLine($"Boooost with {boost} km/h.");
    }
}

public class Program
{
    static void Main(string[] args)
    {
        dynamic obj = Activator.CreateInstance(typeof(Vehicle));
        try
        {
            obj.BoostSpeed(120);
        }
        catch (RuntimeBinderException ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
}