Skip to content

ashishgogula/React-Mastery

Repository files navigation

React Machine Coding Practice Questions

🟢 Beginner Level (Core Concepts)

State & Props

  1. Counter App - Build increment/decrement counter with reset functionality
  2. Todo List - Add, delete, mark complete/incomplete todos
  3. User Profile Card - Display user info passed as props with edit functionality
  4. Shopping Cart - Add items, update quantities, calculate total
  5. Form Validation - Handle input validation with error messages

Event Handling & Conditional Rendering

  1. Toggle Switch - Light/dark theme toggler with visual feedback
  2. Show/Hide Password - Password input with visibility toggle
  3. Modal Component - Open/close modal with backdrop click to close
  4. Accordion - Expandable/collapsible content sections
  5. Tab Component - Switch between multiple content tabs

🟡 Intermediate Level (Hooks & Advanced Patterns)

Custom Hooks

  1. useLocalStorage Hook - Custom hook for localStorage management
  2. useFetch Hook - Reusable data fetching with loading/error states
  3. useDebounce Hook - Debounced search input implementation
  4. useCounter Hook - Reusable counter logic with min/max bounds
  5. useToggle Hook - Boolean state toggle functionality

useEffect & Side Effects

  1. Weather App - Fetch weather data based on user location
  2. Live Clock - Display current time with auto-update
  3. Infinite Scroll - Load more content as user scrolls
  4. Auto-save Form - Save form data automatically every few seconds
  5. Window Resize Tracker - Track and display window dimensions

useReducer & Complex State

  1. Shopping Cart with Reducer - Complex cart operations using useReducer
  2. Quiz App - Multiple questions with score calculation
  3. Undo/Redo Functionality - Text editor with history management
  4. Multi-step Form - Wizard-style form with validation
  5. Game State Manager - Tic-tac-toe or simple game logic

🟠 Advanced Level (Performance & Patterns)

Performance Optimization

  1. Virtualized List - Render large lists efficiently
  2. Memoized Search - Search with React.memo and useMemo
  3. Optimized Image Gallery - Lazy loading with intersection observer
  4. Debounced API Search - Search suggestions with API calls
  5. Heavy Computation - Use useMemo for expensive calculations

Context API & State Management

  1. Theme Provider - Global theme management with Context
  2. User Authentication - Login/logout with protected routes
  3. Multi-language App - Internationalization with Context
  4. Shopping App - Global cart state across components
  5. Notification System - Global toast/alert management

Advanced Patterns

  1. Higher-Order Component - Create reusable HOC for logging/auth
  2. Render Props Pattern - Build flexible, reusable components
  3. Compound Components - Design API like Accordion with multiple sub-components
  4. Portal Component - Render modals/tooltips outside component tree
  5. Error Boundary - Catch and handle component errors gracefully

🔴 Expert Level (Real-world Applications)

Full Applications

  1. Kanban Board - Drag & drop task management (use react-beautiful-dnd)
  2. Chat Application - Real-time messaging interface
  3. File Explorer - Navigate folders, create/delete files
  4. Calendar Component - Month/week/day views with event management
  5. Data Table - Sortable, filterable, paginated table

Advanced Features

  1. Code Editor - Syntax highlighting and basic editing features
  2. Drawing Canvas - Interactive drawing with different tools
  3. Photo Editor - Basic image manipulation (crop, filters)
  4. Music Player - Play/pause, playlist, progress bar
  5. Dashboard - Multiple widgets with drag-and-drop layout

🎯 Concept Coverage Checklist

✅ Core React Concepts

  • JSX and Components
  • Props and State
  • Event Handling
  • Conditional Rendering
  • Lists and Keys
  • Forms and Controlled Components

✅ Hooks Mastery

  • useState, useEffect
  • useContext, useReducer
  • useMemo, useCallback
  • useRef, useImperativeHandle
  • Custom Hooks

✅ Advanced Patterns

  • Higher-Order Components
  • Render Props
  • Compound Components
  • Error Boundaries
  • Portals

✅ Performance & Optimization

  • React.memo
  • useMemo and useCallback
  • Code Splitting
  • Lazy Loading
  • Virtual Scrolling

✅ State Management

  • Local State
  • Context API
  • useReducer for complex state
  • Third-party libraries (Redux, Zustand)

📚 Practice Tips

  1. Start Simple: Begin with basic counter/todo apps
  2. Build Incrementally: Add features one by one
  3. Focus on One Concept: Don't try to learn everything at once
  4. Code Without Tutorials: Try implementing before looking up solutions
  5. Refactor Often: Improve your code structure as you learn
  6. Test Your Components: Write basic tests for critical functionality
  7. Use TypeScript: Add type safety to your practice projects
  8. Deploy Your Projects: Use Vercel/Netlify to showcase your work

🚀 Progression Path

Week 1-2: Questions 1-15 (Master basics and hooks) Week 3-4: Questions 16-30 (Advanced hooks and patterns)
Week 5-6: Questions 31-40 (Performance and architecture) Week 7-8: Questions 41-50 (Full applications and expert level)

Remember: The goal isn't to complete all questions quickly, but to understand the underlying concepts deeply. Take time to experiment, break things, and rebuild them better!

About

React Machine Coding Practice Questions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published