🔹 MCQs Of Class 1: React Basics

Rashmi Mishra
0

 ðŸ”¹ MCQs Of Class 1

 React Basics

    1.   What is React?
        a) Programming Language
        b) CSS Framework
        c) JavaScript Library 

        d) Database

2.   Who developed React?
a) Google
b) Microsoft
c) Twitter
d) Facebook 

3.   What type of applications is React best suited for?
a) Operating Systems
b) Desktop Applications
c) Single Page Applications 

d) Games

4.   What is the main feature of React?
a) Server-side rendering
b) File Management
c) Component-Based UI 

d) Browser Extension

5.   Which of the following is NOT a feature of React?
a) Virtual DOM
b) One-way data binding
c) Template-based syntax
d) Component reusability 

6.   React is mainly used for:
a) Back-end Development
b) Designing Databases
c) Building User Interfaces 

d) Mobile Apps Only

7.   React is a library for which language?
a) PHP
b) Java
c) JavaScript 

d) Python

8.   What kind of architecture does React follow?
a) MVC
b) MVVM
c) Component-Based 

d) Client-Server

9.   Which of the following best describes React?
a) Full-stack framework
b) JavaScript library for UI 

c) Server-side rendering tool
d) Backend runtime

10.                   Which React feature allows for UI reusability?
a) APIs
b) Hooks
c) Components 

d) Services


🔹 Section 2: SPA vs MPA

11.                   SPA stands for:
a) Styled Page App
b) Single Page Application 

c) Static Page Application
d) Service Page Application

12.                   MPA stands for:
a) Master Page App
b) Multi Page Application 

c) Main Page Application
d) Modular Page App

13.                   In SPA, how are page transitions handled?
a) With full-page reloads
b) Through AJAX
c) Dynamically without reload 

d) With cookies

14.                   Which of the following is an example of an SPA?
a) Amazon
b) Facebook 

c) Yahoo
d) Wikipedia

15.                   In MPA, what happens when navigating between pages?
a) No reload occurs
b) Only partial content reloads
c) Full page reload occurs 

d) Content changes with JavaScript only


🔹 Section 3: Virtual DOM

16.                   What is Virtual DOM in React?
a) Real DOM
b) An exact copy of the browser DOM
c) Lightweight representation of real DOM 

d) Database of DOM elements

17.                   Why is Virtual DOM used in React?
a) For styling pages
b) For storing component data
c) To increase rendering speed 

d) For debugging only

18.                   What happens when state changes in React?
a) Real DOM is modified directly
b) Page reloads
c) Virtual DOM updates 

d) No changes occur

19.                   How does React update the DOM efficiently?
a) It recreates the DOM
b) It performs manual editing
c) It compares new and old Virtual DOM 

d) It clears the whole DOM

20.                   React compares the new Virtual DOM with the previous one using:
a) AJAX
b) Diffing Algorithm 

c) Compiler
d) Server Scripts


🔹 Section 4: JSX Basics

21.                   What is JSX?
a) Java Syntax Extension
b) JavaScript XML 

c) JavaScript eXecution
d) XML Script

22.                   What is the purpose of JSX in React?
a) Write CSS
b) Write HTML in JavaScript 

c) Create database queries
d) Send HTTP requests

23.                   JSX must return how many parent elements?
a) One 

b) Two
c) Many
d) None

24.                   Which of the following is valid JSX?
a) <div>Hello World</div> 

b) <div>Hello World
c) div>Hello World</div>
d) print(“Hello”)

25.                   What is used in JSX instead of class?
a) classname
b) class-name
c) className 

d) cssClass

26.                   Which of these can be embedded inside JSX using curly braces {}?
a) HTML
b) CSS
c) JavaScript expressions 

d) SQL

27.                   What will be the result of {2 + 2} in JSX?
a) 2+2
b) 4 

c) "2 + 2"
d) Error

28.                   What is NOT allowed in JSX?
a) Using HTML tags
b) Using JavaScript expressions
c) Using unclosed tags 

d) Nesting components

29.                   Which syntax is correct in JSX?
a) <br>
b) <br /> 

c) <br/ >
d) br;

30.                   JSX is converted into:
a) HTML
b) XML
c) JavaScript 

d) TypeScript


🔹 Section 5: Environment Setup

31.                   Which tool is used to create a new React project?
a) npm init
b) create-react-app 

c) webpack
d) nodemon

32.                   What command is used to create a new React app?
a) npm create react-app
b) npx create-react-app 

c) nvm install react
d) react-init

33.                   React apps are started using:
a) npm launch
b) npm open
c) npm start 

d) npm begin

34.                   What file is the entry point of a React app?
a) App.js
b) main.js
c) index.js 

d) start.js

35.                   Which file contains the root HTML in React?
a) index.js
b) index.html 

c) App.js
d) main.html

36.                   Which folder contains the HTML file in React project?
a) src
b) public 

c) components
d) assets

37.                   Which folder contains the React components?
a) html
b) public
c) src 

d) lib

38.                   Which dependency is required to run a React app?
a) Python
b) React DOM 

c) Apache
d) Bootstrap

39.                   Which code editor is commonly used for React development?
a) NetBeans
b) Eclipse
c) VS Code 

d) Turbo C++

40.                   To install React globally, you need:
a) Node.js 

b) MySQL
c) Git
d) Java


🔹 Section 6: Conceptual Understanding

41. React updates only the changed parts of the DOM using:
a) Real DOM
b) Virtual DOM 

c) Inline CSS
d) Class selectors

42.  JSX looks like HTML but is actually:
a) TypeScript
b) JavaScript 

c) Python
d) SQL

43.                   The App.js file in React contains:
a) Backend logic
b) HTML code
c) Root component 

d) Styles

44.  index.js is used to:
a) Define API routes
b) Launch the React component tree 

c) Set up database
d) Add global styles

45.  React components should start with:
a) lowercase
b) Capital letter 

c) Symbol
d) Number


🔹 Section 7: Short MCQs for Practice

46.                   React uses which programming concept?
a) OOP
b) Functional Programming 

c) Procedural Programming
d) Imperative Programming

47. Which is NOT a React tool?
a) Babel
b) Webpack
c) React Router
d) Django 

48. In React, the HTML inside JS is known as:
a) JSX 

b) TSX
c) HJS
d) HTS

49.To comment in JSX, we use:
a) <!-- -->
b) /* */
c) {/* */} 

d) //

50. React app runs on which port by default?
a) 8000
b) 5000
c) 3000 

d) 8080

51. Which company maintains React?
a) Google
b) Facebook 

c) Microsoft
d) Amazon

52.                   Which command starts the development server?
a) npm run dev
b) npm start 

c) npx serve
d) react-run

53.  JSX helps in writing:
a) Database code
b) HTML in JavaScript 

c) Styling only
d) APIs

54.  Which method renders a component to the DOM in React?
a) renderComponent()
b) ReactDOM.render() 

c) component.show()
d) showDOM()

55.  JSX expressions must be wrapped in:
a) Curly braces 

b) Quotes
c) Parentheses
d) Angle brackets

56.What’s the command to navigate into a newly created React app folder?
a) cd app
b) cd react-app
c) cd my-app 
️ (depends on project name)
d) goto app

57.React components are:
a) CSS Files
b) HTML Snippets
c) JavaScript Functions 

d) SQL Queries

58.How many root elements should a JSX return?
a) One 

b) Two
c) Many
d) None

59.React encourages what style of development?
a) Procedural
b) Declarative 

c) Imperative
d) Command-Line

Tags

Post a Comment

0Comments

Post a Comment (0)