Coding
C# coding problems
Write C# in the browser. Real tests mark your code.
112 problems
Your plan
How long do you want to prepare?
30 problems, easy to medium. About one a day, 15 to 25 minutes each.
- 1Does any value repeat?Hashing15 minLearn it first
- 2Two positions that add up to a targetHashing15 minLearn it first
- 3Count each characterDictionaries15 minLearn it first
- 4Reverse the words in a sentenceStrings15 minLearn it first
- 5Run-length codeStrings15 minLearn it first
- 6Balanced bracketsStacks15 minLearn it first
- 7The missing numberArrays15 minLearn it first
- 8A queue made of two stacksQueues15 minLearn it first
- 9Sort students by marks, then nameLINQ15 minLearn it first
- 10Is it a prime number?Loops15 minLearn it first
Checkpoint after problem 10. Solve 2 earlier problems again, without hints:
1. Does any value repeat?2. Two positions that add up to a target
Tracks
40 problems, easy to hard.
- 1Sort students by marks, then nameLINQ15 minLearn it first
- 2Active customers, newest firstBuild a readable LINQ report15 minLearn it first
- 3The three most expensive productsOrderBy Under the Hood15 minLearn it first
- 4Number the invoice linesStreaming Operators15 minLearn it first
- 5A summary line for each orderBuild a readable LINQ report15 minLearn it first
- 6The cities our customers live inHidden Buffers15 minLearn it first
- 7Race results, with non-finishers lastLINQ Edge Cases Interviewers Test15 minLearn it first
- 8The log lines between START and ENDSkip, Take and Paging15 minLearn it first
- 9The last five errorsSkip, Take and Paging15 minLearn it first
- 10Can the parcels be shipped?Contains, Any and Count15 minLearn it first
Checkpoint after problem 10. Solve 2 earlier problems again, without hints:
1. Sort students by marks, then name2. Active customers, newest first
Problems
29 problemsShow all problems
Repeat useful work with loops
Learn it: Repeat useful work with loops
Find a value by name with a dictionary
Learn it: Find a value by name with a dictionary
Build a readable LINQ report
Learn it: Build a readable LINQ report
Group sessions and join topic names
Learn it: Group sessions and join topic names
Streaming Operators
Learn it: Streaming Operators: Where, Select and Take in O(1) Extra Space
OrderBy Under the Hood
Learn it: OrderBy Under the Hood: O(n log n), an O(n) Buffer, Stability and Top-k
Hidden Buffers
Learn it: Hidden Buffers: Reverse, ToList/ToArray Growth, Distinct and Set Operators
Hashing Operators
Learn it: Hashing Operators: GroupBy, ToLookup, ToDictionary, CountBy and AggregateBy
Contains, Any and Count
Learn it: Contains, Any and Count: Fast Paths on List, HashSet and IEnumerable
Skip, Take and Paging
Learn it: Skip, Take and Paging: O(1) Seeks, O(skip) Walks and Quadratic Paging
LINQ Edge Cases Interviewers Test
Learn it: LINQ Edge Cases Interviewers Test: Empty Input, Nulls, Overflow, Duplicates and Ties
How to Solve and Check a Coding Problem
Learn it: How to Solve and Check a Coding Problem in C#: Patterns, Tests and Measured Big-O
The C# Angle
Learn it: The C# Angle: Collection Costs, LINQ Costs, Strings and Span in Coding Interviews
Arrays and Strings
Learn it: Arrays and Strings in C#: Prefix Sums, Kadane, In-Place Rotation and Counting Arrays
Hashing Patterns
Learn it: Hashing Patterns in C#: Dictionary, HashSet, CollectionsMarshal and Bad Hash Codes
Queues and Deques
Learn it: Queues and Deques in C#: Queue<T>, Two-Stack Queues and Sliding Window Maximum
Tree Traversals
Learn it: Tree Traversals in C#: Recursive and Iterative DFS, BFS Level Order and Stack Depth
When to use recursion and when to prefer a loop
Climbing Stairs
Learn it: Climbing Stairs: the 'hello world' of DP