TypeScript Type Definition Practice

Medium
TypeScriptIntermediate
Overview

Practical code using TypeScript type definitions and interfaces.

Code PreviewTypeScript
interface User {
  id: string;
  name: string;
  email: string;
  age?: number;
}

type UserRole = "admin" | "user" | "guest";

const createUser = (name: string, role: UserRole): User => {
  return {
    id: crypto.randomUUID(),
    name,
    email: `${name}@example.com`,
  };
};
Statistics
Time Limit
1:10
Created
January 20, 2026
Challengers
1
Completions
0
Avg Accuracy
93.0%
Avg WPM
40
Ranking
RankUserWPMAccuracy
Ssupermandesu
4093.0%

Exercise Ranking

Top typers for this exercise

Total Participants

1

Period

All Time

Total Challenges (All Users)

2

Total Practice Time (All Users)

00:02:20

Total Keystrokes (All Users)

498

Period
Sort
RankUserwpmAccuracyStarted/CompletedCorrect/StrokesTotal TimeLast Attempt
Ssupermandesu
40.0093.00%2/0463/49800:02:201/20/2026, 10:35 PM
Ranking of 1 users