React JS MCQ
{
"questions": [
{
"question": "React is mainly used for building ____.",
"options": ["Database", "User Interface", "Server", "Operating System"],
"answer": 1
},
{
"question": "React was developed by ____.",
"options": ["Google", "Microsoft", "Facebook", "Amazon"],
"answer": 2
},
{
"question": "In React, components are ____.",
"options": ["Reusable UI pieces", "Database tables", "CSS files", "Server functions"],
"answer": 0
},
{
"question": "JSX stands for ____.",
"options": ["Java Syntax Extension", "JavaScript XML", "JSON XML", "JavaScript XHR"],
"answer": 1
},
{
"question": "Which hook is used for state management in functional components?",
"options": ["useFetch", "useState", "useEffect", "useRef"],
"answer": 1
},
{
"question": "Which hook is used for side effects?",
"options": ["useState", "useReducer", "useEffect", "useMemo"],
"answer": 2
},
{
"question": "Props are ____.",
"options": ["Mutable", "Immutable", "Functions only", "Database values"],
"answer": 1
},
{
"question": "State in React is ____.",
"options": ["Immutable", "Mutable", "Static", "External"],
"answer": 1
},
{
"question": "Virtual DOM improves ____.",
"options": ["Security", "Performance", "Storage", "Networking"],
"answer": 1
},
{
"question": "Which method is used to render React content into DOM?",
"options": ["ReactDOM.render()", "React.render()", "DOM.render()", "renderDOM()"],
"answer": 0
},
{
"question": "Keys in React lists help in ____.",
"options": ["Styling", "Identifying elements", "Fetching data", "Routing"],
"answer": 1
},
{
"question": "Which hook returns a memoized value?",
"options": ["useMemo", "useState", "useEffect", "useRef"],
"answer": 0
},
{
"question": "Which hook is used to persist values across renders without re-render?",
"options": ["useRef", "useMemo", "useState", "useEffect"],
"answer": 0
},
{
"question": "React components must return ____.",
"options": ["HTML string", "Single root element", "Array only", "JSON"],
"answer": 1
},
{
"question": "Which syntax is used to embed JavaScript inside JSX?",
"options": ["()", "[]", "{}", "<>"],
"answer": 2
},
{
"question": "Which lifecycle method runs after component mounts (class component)?",
"options": ["componentWillMount", "componentDidMount", "componentUpdate", "componentRender"],
"answer": 1
},
{
"question": "Which hook replaces lifecycle methods in functional components?",
"options": ["useState", "useEffect", "useRef", "useCallback"],
"answer": 1
},
{
"question": "Controlled components are controlled by ____.",
"options": ["DOM", "State", "CSS", "Server"],
"answer": 1
},
{
"question": "Which tool is commonly used to create React apps quickly?",
"options": ["npm start", "create-react-app", "react-cli", "node create"],
"answer": 1
},
{
"question": "Fragments in React are used to ____.",
"options": ["Add styling", "Group elements without extra DOM", "Handle routing", "Fetch data"],
"answer": 1
},
{
"question": "Which hook memoizes callback functions?",
"options": ["useMemo", "useCallback", "useState", "useEffect"],
"answer": 1
},
{
"question": "React Router is used for ____.",
"options": ["Database", "Navigation", "Authentication", "Animation"],
"answer": 1
},
{
"question": "Which prop is mandatory for list rendering?",
"options": ["id", "key", "value", "index"],
"answer": 1
},
{
"question": "Which hook manages complex state logic?",
"options": ["useReducer", "useState", "useEffect", "useRef"],
"answer": 0
},
{
"question": "React follows ____ data flow.",
"options": ["Two-way", "Circular", "One-way", "Random"],
"answer": 2
},
{
"question": "Portals in React allow rendering into ____.",
"options": ["Same component", "Different DOM subtree", "Database", "Server"],
"answer": 1
},
{
"question": "Context API is used for ____.",
"options": ["Global state sharing", "Styling", "Routing", "Testing"],
"answer": 0
},
{
"question": "Which hook gives access to context?",
"options": ["useContext", "useState", "useReducer", "useMemo"],
"answer": 0
},
{
"question": "Lazy loading components is done using ____.",
"options": ["React.lazy", "React.load", "useLazy", "lazyLoad"],
"answer": 0
},
{
"question": "Suspense is used with lazy loading for ____.",
"options": ["Routing", "Fallback UI", "State", "API calls"],
"answer": 1
}
]
}
Comments
Post a Comment