CR_MS_Assessment2 CR_MS_Assessment2 CR_MS_Assessment2 The number of attempts remaining is 4 1 / 29 1. Correct fix a. onClick={setCount(count+1)} b. onClick={count+1} c. None d. onClick={()=>setCount(count+1)} 2 / 29 2. What is useState used for? a. Styling b. State management c. API calls d. Routing 3 / 29 3. Why are callback props used? a. Routing b. API calls c. Styling d. Child to Parent communication 4 / 29 4. What is conditional rendering? a. Rendering API b. Rendering based on condition c. Rendering hooks d. Rendering CSS 5 / 29 5. Editing a ticket is a. Delete b. Read c. Update d. Create 6 / 29 6. What does this return? (Coding) const [count,setCount]=useState(0); a. Function b. Two values c. Object d. One value 7 / 29 What will this show? (Coding) const rating = 4.8; return 7. {rating > 4.5 && "Recommended"} ; a. Nothing b. Recommended c. 4.8 d. Error 8 / 29 8. What is required when rendering lists? a. key prop b. class c. style d. id 9 / 29 What will this render? (Coding) function App() { return 9. Hello ; } a. Hello b. Error c. Undefined d. Nothing 10 / 29 10. What does JSX stand for? a. Java Extension b. Java Syntax Extension c. JavaScript XML d. JSON XML 11 / 29 What will this show? (Coding) const isSunny=true; return 11. {isSunny && 'Sunny Day'} ; a. Error b. true c. Sunny Day d. false 12 / 29 12. Props are a. Immutable b. Arrays only c. Numbers only d. Mutable 13 / 29 13. What does map() do in React? a. Styles UI b. Calls API c. Updates state d. Loops and renders lists 14 / 29 14. Correct approach : a. setItems(items); b. items.push(newItem); c. None d. setItems([...items,newItem]) 15 / 29 15. Props are used to a. Fetch API b. Style components c. Store state d. Pass data between components 16 / 29 16. What is a React component? a. API b. CSS file c. Database d. Reusable UI block 17 / 29 17. What does useEffect do? a. Handle props b. Handle side effects c. Manage state d. Render UI 18 / 29 18. What will happen here? (Coding) useEffect(() => { console.log("Hello"); }, []); a. Error b. Never runs c. Runs every render d. Runs once 19 / 29 What will be displayed? (Coding) const name='Rahul'; return 19. {name} ; a. undefined b. name c. Rahul d. Error 20 / 29 What will this render? (Coding) const items = []; return 20. {items.length && "Items exist"} ; a. Nothing b. Items exist c. Error 21 / 29 What is wrong here? (Coding) 21. Click a. Runs immediately b. Syntax error c. Nothing happens d. Works fine 22 / 29 22. Correct fix: a. setCount(count+2) b. Reload page c. setCount(prev => prev + 1); setCount(prev => prev + 1); d. useEffect 23 / 29 What will this render? (Coding) const rating = 4.5; return 23. {rating > 4.5 ? "Recommended" : "Normal"} ; a. Recommended b. Nothing c. Normal d. Error 24 / 29 24. What is wrong here? (Coding) setItems(items.push(newItem)); a. Syntax error b. Correct c. Missing key d. Mutating state 25 / 29 25. What will this do? (Coding) setCount(count + 1); setCount(count + 1); a. +1 b. Error c. +2 d. Reset 26 / 29 26. What is props drilling? a. Mapping b. Styling c. API calling d. Passing props deeply through components 27 / 29 27. What is CRUD? a. Create Render Use Delete b. Create Read Update Delete c. Copy Remove Update Delete d. None 28 / 29 28. What is a callback prop? a. Hook b. Function passed as prop c. API d. State 29 / 29 What will this render? (Coding) const items = ["A", "B"]; return items.map((item, i) => 29. {item} ); a. A B b. ['A','B'] c. Nothing d. Error Your score is