SWE Maxx
Sign in

From first function to full system.

Answer focused software engineering questions and learn from every explanation.

Practice workspaceTypeScript
Arrays

First unique character

Return the first character that appears only once in a string.

Input"level"
Output"v"
typescript
1const firstUnique = (text: string): string | undefined => {
2 const counts = new Map<string, number>();
3 for (const c of text) {
4 const count = counts.get(c) ?? 0;
5 counts.set(c, count + 1);
6 }
7 for (const c of text) {
8 if (counts.get(c) === 1) {
9 return c;
10 }
11 }
12};
A sample problem, from prompt to working approach.

Choose what to sharpen.

Choose a quiz and check what you already know.

  • Loading quizzes…

Learn it. Then use it.

Read a short explanation, try the problem, and inspect an approach when you need one.

Browse questions
  • 01

    Understand the idea

    Start with the concept behind the solution.

  • 02

    Work the problem

    Turn the prompt into code you can reason about.

  • 03

    Review the approach

    See what worked and where the tradeoffs sit.

Think beyond the function.

Practice the decisions behind systems that need to hold up.

System design exerciseExample brief
Design a URL shortener

What happens after a link is created?

Trace the request, choose where data lives, and explain what changes as traffic grows.

  • Request

    Validate the long URL

  • Storage

    Map a short key to a destination

  • Redirect

    Read the mapping and respond