Frontendx
README.md
SOLUTION.md
main.tsxentry
App.tsx
App.css
index.html
vite.config.ts
Installed
react@^19.2.0
react-dom@^19.2.0

Create a Typing Test with Invalid Character Highlighting in React — MonkeyType Clone with Real-Time Character Validation

Prompt

Build a typing speed test application similar to MonkeyType. A random paragraph is displayed and the player types the words. Each character is rendered as an individual <span>. Characters typed correctly turn green; the first incorrectly typed character turns red and all subsequent characters also turn red until the error is corrected. When all characters are typed correctly the test ends and the typing speed in words per minute (WPM) is calculated and displayed. Use the txtgen package to generate random paragraphs of a specified size. Track an array of character states (valid/invalid/untyped) in state and update on each keypress. This was asked in MakeMyTrip's SDE2 frontend machine coding round.

Generate random paragraph using txtgen package and split into array of character objects.
Test Results

Create a Typing Test with Invalid Character Highlighting in React — MonkeyType Clone with Real-Time Character Validation

Build a typing speed test application similar to MonkeyType. A random paragraph is displayed and the player types the words. Each character is rendered as an individual <span>. Characters typed correctly turn green; the first incorrectly typed character turns red and all subsequent characters also turn red until the error is corrected. When all characters are typed correctly the test ends and the typing speed in words per minute (WPM) is calculated and displayed. Use the txtgen package to generate random paragraphs of a specified size. Track an array of character states (valid/invalid/untyped) in state and update on each keypress. This was asked in MakeMyTrip's SDE2 frontend machine coding round.