DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
← From Beginner to Expert in Fundamentals of Frontend
  • Project 1: The Performance-First Dashboard
  • Project 2: Accessible Video Player
  • Project 3: Markdown Blog Engine
  • Project 4: Browser-Based Code Editor
  • Project 5: Multi-Tab Whiteboard
  • Project 6: Infinite Scroll Image Gallery
  • Project 7: Recipe Optimizer & Converter
  • Project 8: Budget Tracker with Charts
  • Project 9: Typing Speed Test
  • Project 10: Weather App with Time-Travel
  • Project 11: CSS Grid Layout Builder
  • Project 12: Password Vault (Frontend Only)
  • Project 13: Kanban Board (Trello Clone)
  • Project 14: Quiz App with Leaderboard
  • Project 15: Habit Tracker (GitHub Style)
  • Project 16: E-commerce Product Page
  • Project 17: Unit Converter (Expert Mode)
  • Project 18: Music Visualizer
  • Project 19: Flashcard Learning App
  • Project 20: Custom Form Validator
  • Project 21: Virtual Terminal
  • Project 22: Pomodoro Timer (Focus Pro)
  • Project 23: SVG Path Editor
  • Project 24: Movie Database Matchmaker
  • Project 25: Interactive Resume / Portfolio
  • Project 26: Recipe Scraper UI
  • Project 27: Crypto Tracker (Real-Time)
  • Project 28: Find My Pet (PWA)
  • Project 29: Markdown-to-Slide Tool
  • Project 30: Browser Health Dashboard
← From Beginner to Expert in Fundamentals of Frontend

Project 9: Typing Speed Test

40 min read
Keyboard EventsTimer LogicWPM CalculationCharacter DiffingGamificationPerformance Analysis

📋 Project Brief

Build a high-precision typing speed trainer that tracks accuracy, WPM, and character-level errors in real-time. This project requires precise keyboard event handling, timer management, and gamified UI feedback. You will compare user input against a source text character-by-character, building a performance analysis system that identifies the user's weakest keys.

🎯 Learning Objectives

  • Master keyboard event handling (keydown vs. keypress vs. input events)
  • Build a precise timer system with start/stop/pause logic
  • Calculate WPM using the standard formula: (characters / 5) / minutes
  • Implement character-level diff highlighting
  • Create gamified UI elements (streaks, ghost racers, heatmaps)

✅ Feature Requirements

Feature 1: Real-Time WPM Counter

Acceptance Criteria:

  • WPM counter updates with every keystroke
  • Use the standard WPM formula: (total characters typed / 5) / elapsed minutes
  • Also display "Raw WPM" (includes errors) and "Net WPM" (subtracts errors)
  • Accuracy percentage displayed alongside WPM
  • Timer starts on first keystroke, not on page load

Feature 2: Error Heatmap

Acceptance Criteria:

  • After each test, show a keyboard visualization
  • Keys that were frequently mistyped are highlighted in red (intensity = error count)
  • Keys with zero errors are green
  • Hovering a key shows: "Pressed X times, Errors: Y, Accuracy: Z%"
  • Aggregate data across multiple tests (stored in localStorage)

Feature 3: Difficulty Modes

Acceptance Criteria:

  • Easy: Common words only, no punctuation
  • Medium: Includes punctuation and capitalization
  • Hard: Includes numbers, symbols, and technical terms
  • Custom: User pastes their own text to practice
  • Each mode must source text from a different word pool

Feature 4: Ghost Racer

Acceptance Criteria:

  • A visual indicator shows the user's personal best speed as a "ghost" progress bar
  • The ghost advances through the text at the rate of the previous best WPM
  • If the user is ahead of the ghost, show a green indicator; behind = red
  • Personal best is stored in localStorage per difficulty mode

Feature 5: Focus Blur

Acceptance Criteria:

  • If the browser window loses focus (user switches tabs), automatically pause the timer
  • Blur the text to prevent "cheating" by reading ahead in another window
  • Show an overlay: "Test Paused — Click to Resume"
  • Clicking the overlay resumes the timer and removes the blur

📊 Performance Metrics Display

MetricHow It's Calculated
WPM (Net)(Correct characters / 5) / minutes
WPM (Raw)(All characters / 5) / minutes
Accuracy(Correct characters / Total characters) × 100
Error RateErrors per minute
ConsistencyStandard deviation of WPM across 10-second intervals

🧪 Testing Checklist

  • Unit test WPM calculation with known inputs
  • Unit test character comparison logic (correct, incorrect, extra, missing)
  • Integration test: completing a test shows the results screen with accurate stats
  • Test focus/blur pause behavior
  • A11y: text must be readable by screen readers; timer state announced

🚀 Stretch Goals

  • Add multiplayer mode (compare WPM with a friend via shared link)
  • Implement a "Lesson Mode" that focuses on the user's weakest keys
  • Add sound effects for correct/incorrect keystrokes (toggleable)
  • Create a 30-day progress chart showing WPM improvement over time

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.