C# Online IDE & Code Editor for Technical Interviews

Running .NET Core 6.0 - IntelliSense is enabled

Our C# environment runs on Microsoft’s cross-platform .NET Core runtime. The System.Json assembly is linked.

You should define a static void Main on a class named Solution.

Tests can be written in NUnit. Note that if you run NUnit tests, you should only use the test runner’s main method, like so:

using NUnit.Framework; using NUnitLite; using System; using System.Reflection; public class Runner { public static int Main(string[] args) { return new AutoRun(Assembly.GetCallingAssembly()).Execute(new String[] {"--labels=All"}); } [TestFixture] public class Dog { public String bark() { return "bark"; } [Test] public void TestBarker() { Assert.AreEqual("bark", new Dog().bark()); } } }
Code language: C# (cs)

You should be able to run LINQ queries, like so:

using System; using System.Linq; class Solution { static void Main(string[] args) { int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 }; var lowNums = from n in numbers where n < 5 select n; Console.WriteLine("Numbers < 5:"); foreach (var x in lowNums) { Console.WriteLine(x); } } }
Code language: C# (cs)

Your code is compiled and run with debug mode enabled.

Try Our C# Editor