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
9 problemsShow all problems
Deferred Execution and Multiple Enumeration
Learn it: Deferred Execution and Multiple Enumeration: Paying for the Same Query Twice
Queues and Deques
Learn it: Queues and Deques in C#: Queue<T>, Two-Stack Queues and Sliding Window Maximum
Topological Sort, Dijkstra with PriorityQueue and Union-Find
Learn it: Topological Sort, Dijkstra with PriorityQueue and Union-Find in C#
Heaps with PriorityQueue
Learn it: Heaps with PriorityQueue in C#: Top K, Merge K Sorted, Running Median and API Pitfalls
When to use recursion and when to prefer a loop
Unique Paths and Longest Common Subsequence
Learn it: Unique Paths and Longest Common Subsequence: 2D state
N-Queens
Learn it: N-Queens: the famous one, briefly