C#
Learn C# by typing real, idiomatic code.
Type through everyday C#: LINQ queries, async/await, properties and records, pattern matching, and generics. Every snippet is idiomatic, compiling C#, and an AI tutor explains each line — how a LINQ chain defers execution, why a record gives you value equality — so you learn the .NET way of doing things as you build typing speed.
Progress0 / 687 solved · 0/50 sections
best wpm
0
avg wpm
0
accuracy
0%
runs
0
level
1
rating
1000
Run C# on your machine
1. Install the toolchain
brew install dotnet # or see docs2. Save your code as Program.cs, then compile & run
dotnet runprogress by section
1Fundamentals0/12start →
2Strings In Depth0/18start →
3Values & References0/14start →
4Slices & Arrays0/15Unlock →
5Data structures0/12Unlock →
6Iterators0/20Unlock →
Sum / product / CountConcatSelect with an indexSelectStride & ReverseTake & SkipWhereAggregate without a seed (reduce)Aggregate with a seed (fold)MaxBy & MinByAny / All / First / FindIndexSelect + Where (filter_map)TakeWhile & SkipWhileToLookup (partition)ZipIEnumerator by handSelectManyToDictionaryA yield generator (scan)Deferred execution
7Traits0/20Unlock →
Value copy vs CloneDefault interface methodExplicit conversion operatorGetHashCode for a keyIComparable<T> & sortingIEquatable<T>Implicit conversion operatorOperator: +Operator: unary -IComparer<T>IDisposable (RAII)Compound assignment +=Operator: * by scalarOverride ToStringTryParse patternExplicit interface implementationGeneric interfaceIEnumerable<T>IFormattableIndexer this[]
8Generics0/20Unlock →
Generic classInterface constraintGeneric methodTwo type parametersGeneric class with methodsdefault(T)Generic type hierarchyGeneric over IEnumerableGeneric minMultiple constraintsThe new() constraintA generic wrapperGeneric static factorystruct constraint & default(T)Contravariance (in)Covariance (out)Generic math with INumber<T>Generic with a key selectorStatic vs dynamic dispatchGeneric extension method
9Lifetimes0/20Unlock →
The GC manages lifetimesBlock scopeClosures capture variablesClosures can mutateImplement IDisposableout parameterStatic field lifetimeusing declarationusing statementPer-iteration capturein parameterNested usingref localFinalizersGeneric constraintOwned disposable fieldSpan sliceSlice of the inputref returnLazy iterator
10Closures0/20Unlock →
A lambdaAction (no return)Explicit types & a block bodyCapturing a variableMultiple parametersCallbacksLambdas drive LINQCapturing in a WhereA lambda as an argumentMethod group conversionSort with a comparison lambdaClosures capture the variableCurryingCapturing mutable stateReturning a captured valueReturning a delegateA stateful closureHigher-order: composeA list of delegatesReturn different delegates
11Pattern Matching0/20Unlock →
Constant patternsif / else with a patternMatch a nullable valueOr patternsPositional patternsProperty patternsRelational patternsswitch as an expressionTuple patternsMatch a (success, value) pairLoop while a pattern matcheswhen guardsis patternsList pattern with a sliceType patternsvar pattern with a guardBind or return earlyList patterns by lengthMatch a list's shapeNested patterns
12Error Handling0/20Unlock →
try / catchBind the exceptiontry / catch / finallyThe TryX patternGuard against bad argumentsCompute a fallbackCatch the base typeStop at the first failureAdd context to an errorCustom exception typeThrow and catch your own typeSeveral catch blocksRethrow preserving the stackthrow as an expressionWrite your own TryXusing for cleanupusing declarationException filter with whenWrap with an inner exceptionWalk the inner chain
13Option & Result0/20Unlock →
GetValueOrDefaultHasValue and ValueNull-coalescing ??Nullable reference typeNullable value typeTryParse out patternNull-coalescing assignment ??=FirstOrDefaultNull-conditional ?.Pattern-match nullDictionary TryGetValueCoalesce or throwChained null-conditionalNullable arithmeticType pattern bindingA Result recordSwitch on maybe-nullMap over a MaybeA Maybe/Option structPattern-match a Result
14Conversions0/15Unlock →
15Collection Conversions0/19Unlock →
16Math0/14Unlock →
17Encoding0/22Unlock →
String to bytesASCII checks and caseBase64 decodeBase64 encodeBytes to StringChar to code pointChar digit valueHex encodeBinary, octal, hex formattingBig-endian bytesList code pointsEscape control charsHex decodeLittle-endian bytesChars vs bytesParse a number in a basePercent-decodePercent-encodeLossy UTF-8 decodeCaesar cipherROT13XOR cipher
18Random0/21Unlock →
The shared RandomCoin flipRandom f64 in [0, 1)GUIDsPick a random elementNumber in a rangeRandom bytesWeighted true/false64-bit and bounded longsReproducible sequencesRoll many diceRandom enum variantPick with replacementPassword generatorSample k without replacementFisher-Yates shuffleRandom alphanumeric stringCryptographic randomnessSecure tokenWeighted choiceNormal distribution
19Data I/O0/18Unlock →
Parse CSV into rowsTab-separated valuesBuild a CSV stringSelect one columnCSV into a number matrixSplit off the headerSerialize to JSONWhitespace-separated matrixRead a data fileSkip blanks and commentsPrint an aligned tableWrite CSV to a fileAppend a rowNavigate JSON with JsonNodeParse JSON into an objectParse key=value configRound-trip write then readDrop unparseable rows
20Linear Algebra0/21Unlock →
Matrix shapeDot productScalar multiplyA matrix of zerosElementwise addArgmax of a vectorIdentity matrixOne-hot encodeTraceReLU and sigmoidApply a function elementwiseColumn meansColumn sumsCosine similarityFlatten to one arrayMatrix times vectorTransposeMatrix multiplyMin-max normalize columnsSoftmaxStandardize columns (z-score)
21Text Processing0/16Unlock →
22Date & Time0/13Unlock →
23Memory0/12Unlock →
24Modules0/20Unlock →
A namespaceusing directiveusing alias for a typeConstants in a static classAn enum in a namespaceFile-scoped namespaceNested namespacesPrivate membersTop-level entry pointAlias a namespaceA class in a namespaceglobal usingA nested classusing staticA struct in a namespaceA small utility classAn interface in a namespaceinternal vs publicPartial classesPrivate field, public property
25Macros0/20Unlock →
Debug.AssertExpression-bodied methodC# has no macrosCollection expressionDictionary initializernameof operatorMethod overloadingparams variadicPattern matchingT4 templates and concatFormat specifiersStringBuilderVariadic maxCaller info attributesdynamicReflection: TypeSource generatorsCustom attributesExpression treesReflection: MethodInfo
26Testing0/20Unlock →
AssertNotEqualAssertTrue with a messageA unit testTesting a truth tableMultiple checksTesting string outputAsserting on a collectionDebug.Assert and XML docsTesting an error caseA test helperTesting a throw pathTesting a methodTesting a nullableSkipping a testAssertThrowsExpected exception via try/catchComparing floatsTesting internal membersTable-driven testsAssert on the message
27Algorithms0/8Unlock →
28Sorting Algorithms0/12Unlock →
29Expression Parsing0/6Unlock →
30Idioms0/9Unlock →
31OOP & Traits0/8Unlock →
32Trait Objects0/14Unlock →
33Design Patterns0/14Unlock →
35File I/O0/6Unlock →
36Filesystem0/18Unlock →
Does a path exist?Change the extensionBuild a pathCopy a fileCreate nested directoriesFiles vs directoriesList a directoryRename or moveFile metadataPath componentsRemove files and treesSorted listingWrite to the temp dirFilter by extensionAbsolute pathLast modified timeTotal size of a treeWalk the tree
37Networking0/16Unlock →
38Concurrency0/7Unlock →
39Unsafe & FFI0/14Unlock →
40Commands0/14Unlock →
41Array0/10Unlock →
43String0/10Unlock →
45Interval0/5Unlock →
46Linked List0/6Unlock →
47Tree0/14Unlock →
Maximum Depth of Binary TreeInvert Binary TreeSame TreeLowest Common Ancestor of a BSTBinary Tree Level Order TraversalSubtree of Another TreeImplement Trie (Prefix Tree)Kth Smallest Element in a BSTValidate Binary Search TreeAdd and Search WordConstruct Binary Tree from Preorder and InorderBinary Tree Maximum Path SumSerialize and Deserialize Binary TreeWord Search II