Skip to content
Katabench
Try free

Online C# practice, graded beyond correct

C# coding challenges that grade what production cares about

Write C# in the browser and get specific feedback on more than output. Katabench measures time and memory, captures database plans, checks code structure, and runs adversarial tests across 504 focused exercises.

No signup required for your first puzzle. Nothing to install.

Solution.cs Trapping Rain Water · Hard
public long Trap(int[] height)
{
int l = 0, r = height.Length - 1, lMax = 0, rMax = 0;
long water = 0;
while (l < r)
{
if (height[l] < height[r])
water += (lMax = Math.Max(lMax, height[l])) - height[l++];
else
water += (rMax = Math.Max(rMax, height[r])) - height[r--];
}
return water;
}
Submission graded 5 / 5 tests passed
✓ Classic example
Passed 180 µs
✓ Deep basin
Passed 210 µs

✓ 2 more visible tests passed

✓ Large input · O(n) hidden
Passed 640 µs
time budget <1% of 200 ms
memory 48 B allocated

Correct, fast, and allocation-aware: the result shows all three on the same submission.

Advanced C# exercises

Practice the parts of engineering that simple kata miss

The catalog starts with algorithms and keeps going into the work that fills an actual .NET codebase. Pick one discipline for focused reps or follow a guided learning path through a deliberate sequence.

114 challenges · all free

Algorithms and performance

Solve familiar algorithm problems, then face inputs large enough to expose the wrong complexity and allocation budgets that punish needless copying.

Start free: Two Sum →

Want an ordered data-access progression? Start with the LINQ exercises. For a broader sequence across disciplines, follow a guided C# learning path.

The feedback loop

Every submission answers a better question

Not only "did it pass?" but "what did the code cost, and would this solution survive the constraints that expose weak engineering?"

01

Correctness

Visible examples help you iterate. Hidden tests cover edge cases and larger inputs without handing you the answer.

02

Performance and memory

Every test reports server-measured time and allocated bytes. Some challenges enforce hard budgets for both.

03

Production quality

Specialized tracks grade query plans, code structure, dependency rules, security payloads, or the strength of the tests you wrote.

Read how grading works or see how each submission runs inside an isolated server-side sandbox.

Who this is for

C# practice for developers past the syntax stage

You want production instincts

You know how to make code compile. Now you want to recognize an accidental O(n²), see the SQL behind LINQ, refactor without changing behavior, and close a security hole for the right reason.

You want deliberate reps

Each exercise isolates one skill, returns immediate evidence, and gives you another attempt. Use open practice for variety or Learning Paths when you want the next challenge chosen for you.

C# coding challenge FAQ

Before you start

Can I solve the C# coding challenges online?

Yes. The editor, compiler, tests, and results all run from your browser. Your code executes in a disposable server-side sandbox, so there is no SDK or local setup required.

Are these C# exercises for beginners or experienced developers?

Katabench is built primarily for working developers who already know C# syntax and want deeper practice in performance, data access, refactoring, architecture, testing, and security. Challenges range from Easy to Hard.

Are the C# challenges free?

Many are. The Free plan includes the full algorithm catalog, every Test Writing and Design Principles exercise, free previews in the database, refactoring, architecture, and secure coding tracks, the guided Katabench Tour, and 10 graded submissions a day. Pro unlocks the rest of those four tracks, every learning path, the full hidden performance suites, and unlimited submissions under fair use.

What makes these different from interview coding problems?

Correct output is only the starting point. Depending on the track, a solution may also need to meet a time or allocation budget, use the intended database plan, satisfy architecture rules, or block real attack payloads.

Find out what your green checkmark missed

Open a C# challenge, run the samples, then submit against the production-grade checks. Your first puzzle needs no account.

Try a C# challenge free