Generate 10 multiple choice questions about "React" (react for beginners). Each…
- User
User: Generate 10 multiple choice questions about "React" (react for beginners). Each question must have: - 4 distinct options (a-d) - 1 correct answer - Cover different aspects of the topic
Format exactly like this: Q1. What is the primary purpose of React? a) Option 1 b) Option 2 c) Option 3 d) Option 4 Answer: bUser: Generate 10 multiple choice questions about "React" (react for beginners). Each question must have: - 4 distinct options (a-d) - 1 correct answer - Cover different aspects of the topic
Format exactly like this: Q1. What is the primary purpose of React? a) Option 1 b) Option 2 c) Option 3 d) Option 4 Answer: bAssistant:
- Assistant
Q1. What is the primary purpose of React?
a) Styling web pages
b) Building user interfaces
c) Managing databases
d) Writing server-side logic
Answer: bQ2. In React, what is a component?
a) A reusable piece of UI
b) A type of database
c) A server configuration file
d) A CSS stylesheet
Answer: aQ3. Which of the following is used to create a React component?
a) function or class
b) JSON object
c) HTML tag
d) CSS selector
Answer: aQ4. What does JSX stand for in React?
a) JavaScript XML
b) Java Standard eXecute
c) JavaScript eXtensible
d) Java Service eXchange
Answer: aQ5. How do you pass data from a parent component to a child component in React?
a) Using state
b) Using props
c) Using variables
d) Using functions
Answer: bQ6. What hook is commonly used to add state in a functional component?
a) useEffect
b) useState
c) useReducer
d) useContext
Answer: bQ7. Which method is called to update the state in a class component?
a) setState()
b) updateState()
c) changeState()
d) modifyState()
Answer: aQ8. What is the virtual DOM in React?
a) An actual DOM on the server
b) A copy of the real DOM kept in memory
c) A new CSS styling method
d) A database storage method
Answer: bQ9. What does React use to efficiently update the browser UI?
a) Direct DOM manipulation
b) Virtual DOM diffing
c) Server-side rendering only
d) Manual HTML updates
Answer: bQ10. How do you handle events in React components?
a) Using inline JavaScript events like onclick
b) By passing event handlers as props in camelCase like onClick
c) Using CSS pseudo-classes
d) By editing the HTML event attributes directly
Answer: b