A state-of-the-art, interactive React 18+, TypeScript, and Vite learning playground and interview preparation suite. Designed as a one-stop solution for mastering core React concepts, hooks, RTK Query, performance optimization, tricky interview traps, and machine coding interview challenges.
A modular, folder-structured practice engine containing 20+ isolated frontend interview questions categorized by difficulty and estimated completion time. Each challenge includes a live interactive sandbox, requirements checklist with progress tracking, and folder path references.
- Todo List:
src/features/machine-coding/easy/todo-listβ CRUD tasks with status filtering. - Counter:
src/features/machine-coding/easy/counterβ Increment, decrement, reset, and step size modifiers. - Accordion:
src/features/machine-coding/easy/accordionβ Collapsible panels supporting single vs. multi-open modes. - Tabs:
src/features/machine-coding/easy/tabsβ Active tab selection with dynamic tab creation. - Star Rating:
src/features/machine-coding/easy/star-ratingβ Hover preview, selection lock, and read-only mode. - Modal Dialog:
src/features/machine-coding/easy/modalβ Trigger open, Escape key listener, and backdrop click close. - Pagination:
src/features/machine-coding/easy/paginationβ Prev/Next page navigation and dynamic page size selectors. - Image Carousel:
src/features/machine-coding/easy/carouselβ Slider with dot indicators, hover pause, and auto-play playback. - OTP Input:
src/features/machine-coding/easy/otp-inputβ Multi-box digit input, auto-focus progression, and backspace shift. - Traffic Light:
src/features/machine-coding/easy/traffic-lightβ Automated sequence timing with pause and manual overrides. - Chips Input:
src/features/machine-coding/easy/chipsInputβ Add tag chips on Enter key, active toggle, and event bubbling prevention.
- Searchable User List:
src/features/machine-coding/medium/searchable-listβ Multi-attribute live user filtering. - Debounced Search:
src/features/machine-coding/medium/debounced-searchβ Custom 500ms debounce hook with latency logs. - Autocomplete:
src/features/machine-coding/medium/autocompleteβ Debounced combobox with loading spinner and fallback empty state. - Todo with LocalStorage:
src/features/machine-coding/medium/todo-localstorageβ Durable state persistence across browser reloads. - Shopping Cart:
src/features/machine-coding/medium/shopping-cartβ E-commerce catalog, quantity adjustments, and total math. - Multi-select Dropdown:
src/features/machine-coding/medium/multiselectβ Search option filter, "Select All", and tag pills. - Dynamic Form:
src/features/machine-coding/medium/dynamic-formβ Dynamic form generation from JSON schema definitions. - File Upload:
src/features/machine-coding/medium/file-uploadβ Drag-and-drop file attachment with animated upload progress. - Toast Notifications:
src/features/machine-coding/medium/toast-notificationβ Imperative alert stack (toast.success(),toast.error()). - Countdown Timer:
src/features/machine-coding/medium/countdown-timerβ Hours/mins/secs countdown with play, pause, and alert ring.
Master Redux Toolkit Query (@reduxjs/toolkit/query/react) with live API interactions:
- Automatic Caching & Base Query: Built on JSONPlaceholder.
- Tag Invalidation:
Posttag invalidation on adding/deleting posts. - Polling & Prefetching: Real-time state syncing with configurable refetch interval.
- Live Store Inspector: Inspect active RTK Query subscriptions, status, and cached state payload.
Deep-dive into common interview traps with live interactive sandboxes:
- Stale Closures in
useEffect/useState: Why stale variables occur inside timers and howuseRefor functional state updates fix them. - Automatic Batching (React 18/19): How React batches state updates across async timeouts and promises.
- Two-Way Binding in React: Why React enforces one-way data flow and how to implement controlled inputs vs Angular/Vue.
- Child-to-Parent Data Flow: Callback functions, lifting state up, and context events.
- Custom Hooks vs Utility Functions: When to encapsulate stateful logic in custom hooks (
use...) vs pure utilities. - State Colocation: Avoiding unnecessary parent re-renders by pushing state down.
Interactive performance guide showcasing React memoization and rendering strategies:
- Memoization Matrix:
React.memo,useMemo,useCallback, and avoiding object reference traps. - State Colocation: Moving state closest to where it is consumed.
- Concurrent Rendering:
useTransitionanduseDeferredValuefor non-blocking UI response during heavy filtering. - Code Splitting & Lazy Loading:
React.lazyand<Suspense>boundaries. - List Virtualization: Rendering massive datasets efficiently using windowing.
Interactive playground covering standard React hooks with visual re-render counters:
useState,useEffect,useContext,useReducer,useMemo,useCallback,useRef.- Custom Hook Creation Guide: Step-by-step rules and patterns for writing custom hooks.
- Global Header Search (
/): Instant search bar indexing all pages, tricky questions, hooks, and machine coding problems. - Unified Theme System: 100% consistent Light and Dark mode toggle powered by
useTheme().
- Framework: React 18+
- Language: TypeScript & JavaScript (supports
.tsxand.jsxcomponents) - Build Tool: Vite 7+
- Routing: React Router DOM v6
- State Management: Redux Toolkit & RTK Query
- Styling: Vanilla CSS & Tailwind CSS v4
- Localization: i18next
src/
βββ components/ # Shared UI & Layout components
β βββ Layout.tsx # Main navigation & theme shell
β βββ LearningNote.tsx # Educational callout cards
β βββ SearchBar.tsx # Global search modal (/ shortcut)
β βββ hoc/ # Higher-Order Component examples
βββ contexts/ # Global React Contexts
β βββ ThemeContext.tsx # Dark/Light theme provider
βββ features/ # Application Feature Modules
β βββ machine-coding/ # Machine coding suite
β β βββ easy/ # Easy challenges (TodoList, Counter, OTP, ChipsInput...)
β β βββ medium/ # Medium challenges (Autocomplete, ShoppingCart, Toast...)
β β βββ challengesRegistry.ts # Central registry of all machine coding challenges
β βββ rtk-query/ # Redux Toolkit Query API slices
β βββ todos/ # Nested route Todo module
β βββ counter/ # Basic counter state demo
βββ hooks/ # Custom React Hooks
β βββ useTheme.ts # Theme access hook
β βββ useSearch.ts # Global search index hook
β βββ ...
βββ routes/ # Main Route Pages
β βββ HomePage.tsx
β βββ MachineCodingPage.tsx # /machine-coding route
β βββ TrickyQuestionsPage.tsx # /tricky-questions route
β βββ OptimizationPage.tsx # /optimization route
β βββ RtkQueryPage.tsx # /rtk-query route
β βββ HooksPage.tsx # /hooks route
βββ App.tsx # Main routes registry
βββ main.tsx # Application entrypoint
The machine coding section is built for instant folder-wise extension. To add a new practice question:
- Create a folder & component in
src/features/machine-coding/easy/ormedium/:src/features/machine-coding/easy/my-new-question/MyNewQuestionChallenge.tsx (or .jsx)
- Register the challenge in
src/features/machine-coding/challengesRegistry.ts:{ id: 'my-new-question', title: 'My New Question', difficulty: 'Easy', estimatedTime: '20β30 min', description: 'Short explanation of what to build.', folderPath: 'src/features/machine-coding/easy/my-new-question', component: MyNewQuestionChallenge, requirements: ['Requirement 1', 'Requirement 2'], tags: ['custom', 'react'] }
- Done! Your question automatically appears in the sidebar list, live interactive sandbox, search bar, and checklist viewer.
# 1. Clone repo
git clone <repository-url>
cd React-Learning/react-learning-app
# 2. Install dependencies
npm install
# 3. Start local development server
npm run dev
# 4. Build for production verification
npm run buildContributions are warmly welcome! Whether adding new machine coding questions, interview pitfalls, or educational notes, check out our CONTRIBUTING.md guide for step-by-step instructions.
- React Team for building and maintaining the core framework.
- Vite Team for the lightning-fast development server and build tools.
- Redux Toolkit Team for state management & RTK Query.
- Tailwind CSS Team for the responsive utility-first CSS engine.
This project is open-source under the MIT License. Happy React coding! π