Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 1 MCQs Refreshing JavaScript and React Fundamentals

INT252 — Web App Development With Reactjs 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Arrow functions Easy

    Which arrow function correctly returns the sum of a and b?

  2. Question 2 of 60 Block-scoped variables using let and const Easy

    Which keyword declares a block-scoped variable that cannot be reassigned?

  3. Question 3 of 60 Array iteration and transformation methods Easy

    Which array method creates a new array by transforming every element?

  4. Question 4 of 60 Destructuring assignments Easy

    Given const user = { name: "Asha", age: 20 };, which statement extracts the name property?

  5. Question 5 of 60 Spread and rest operators Easy

    Which operator is used for both spread and rest syntax in JavaScript?

  6. Question 6 of 60 ES modules Easy

    Which keyword makes a function or value available to other JavaScript modules?

  7. Question 7 of 60 Immutability principles Easy

    What does immutability mean when updating React state?

  8. Question 8 of 60 Functional programming concepts relevant to React Easy

    What is a pure function?

  9. Question 9 of 60 Shallow and deep copying mechanisms Easy

    What does a shallow copy of an object do with its nested objects?

  10. Question 10 of 60 Referential equality and state comparison Easy

    When are two separate object variables referentially equal using ===?

  11. Question 11 of 60 Single Page Applications and Multi Page Applications Easy

    What is a common characteristic of a Single Page Application (SPA)?

  12. Question 12 of 60 React philosophy and declarative UI paradigm Easy

    What does declarative UI mean in React?

  13. Question 13 of 60 Component-based architecture Easy

    What is a main benefit of component-based architecture?

  14. Question 14 of 60 Setting up React applications using Vite Easy

    Which command starts the process of creating a new Vite project with npm?

  15. Question 15 of 60 Modern React development environment and tooling Easy

    What is the main purpose of a development server in a React project?

  16. Question 16 of 60 Feature-based project folder structure and best practices Easy

    How does a feature-based folder structure organize a React project?

  17. Question 17 of 60 JSX syntax and expressions Easy

    How is a JavaScript expression inserted into JSX?

  18. Question 18 of 60 Rendering components into the DOM Easy

    Which React DOM method creates a root for rendering a React application?

  19. Question 19 of 60 Functional components and render lifecycle Easy

    What usually happens when a functional component's state changes?

  20. Question 20 of 60 Introduction to Virtual DOM and reconciliation process Easy

    What does React do during reconciliation?

  21. Question 21 of 60 Arrow functions Medium

    Consider the following code:

    const team = { name: 'UI', members: ['Ana'], print() { this.members.forEach(member => console.log(this.name + ': ' + member)); } };

    Why does calling team.print() correctly log UI: Ana?

  22. Question 22 of 60 Block-scoped variables using let and const Medium

    What is printed by this code after the timers execute?

    for (let i = 0; i < 3; i++) { setTimeout(() => console.log(i), 0); }

  23. Question 23 of 60 Array iteration and transformation methods Medium

    What is the value of result?

    const items = [{ name: 'pen', active: true }, { name: 'bag', active: false }, { name: 'book', active: true }];

    const result = items.filter(item => item.active).map(item => item.name.toUpperCase());

  24. Question 24 of 60 Destructuring assignments Medium

    What does the following code print?

    const user = { name: 'Mira', address: { city: 'Pune' } };

    const { name: displayName, role = 'viewer', address: { city } } = user;

    console.log(displayName + '-' + role + '-' + city);

  25. Question 25 of 60 Spread and rest operators Medium

    What is logged by this code?

    const original = { settings: { theme: 'dark' } };

    const copy = { ...original };

    copy.settings.theme = 'light';

    console.log(original.settings.theme, copy.settings.theme);

  26. Question 26 of 60 ES modules Medium

    A file named app.js contains export default function App() {} and export const version = '1.0';. Which statement correctly imports both exports?

  27. Question 27 of 60 Immutability principles Medium

    Given state shaped as { name: 'Lee', profile: { city: 'Delhi', timezone: 'IST' } }, which update changes only the city while preserving all other fields and references appropriately?

  28. Question 28 of 60 Functional programming concepts relevant to React Medium

    Which function is pure and therefore easiest to use predictably during React rendering?

  29. Question 29 of 60 Shallow and deep copying mechanisms Medium

    An object contains nested arrays and a Date. Which approach creates an independent deep copy while preserving the Date as a Date in modern browsers?

  30. Question 30 of 60 Referential equality and state comparison Medium

    Consider an array state update:

    const next = current;

    next.push('B');

    setItems(next);

    Which statement best describes the problem?

  31. Question 31 of 60 Single Page Applications and Multi Page Applications Medium

    A dashboard must update its URL and switch views after initial loading without requesting a new HTML document for each navigation. Which architecture best matches this requirement?

  32. Question 32 of 60 React philosophy and declarative UI paradigm Medium

    Which implementation most clearly follows React's declarative UI approach for displaying an online status?

  33. Question 33 of 60 Component-based architecture Medium

    A product card containing an image, title, price, and add button appears on several pages. What is the best component-based design?

  34. Question 34 of 60 Setting up React applications using Vite Medium

    Which command sequence creates and starts a React project using Vite?

  35. Question 35 of 60 Modern React development environment and tooling Medium

    In a standard Vite React project, which command creates optimized production assets, usually in the dist directory?

  36. Question 36 of 60 Feature-based project folder structure and best practices Medium

    An application has checkout-specific components and hooks plus a generic Button used throughout the application. Which organization best follows a feature-based structure?

  37. Question 37 of 60 JSX syntax and expressions Medium

    Which JSX expression displays No items when count is 0 and displays 3 items when count is 3?

  38. Question 38 of 60 Rendering components into the DOM Medium

    Assuming createRoot is imported from react-dom/client, which code correctly mounts App into <div id='root'></div>?

  39. Question 39 of 60 Functional components and render lifecycle Medium

    A functional component receives userId as a prop and should load user data after the component is committed whenever userId changes. Which implementation is appropriate?

  40. Question 40 of 60 Introduction to Virtual DOM and reconciliation process Medium

    A rendered list can be reordered and its items have stable database IDs. Which key best helps React reconcile the list while preserving the correct item state?

  41. Question 41 of 60 Arrow functions Hard

    What does the following code print?

    const obj = { value: 10, make() { const arrow = () => this.value; return { value: 20, arrow }; } }; const { arrow } = obj.make(); console.log(arrow.call({ value: 30 }));

  42. Question 42 of 60 Block-scoped variables using let and const Hard

    What happens when this code executes?

    let value = 1; { console.log(typeof value); let value = 2; }

  43. Question 43 of 60 Array iteration and transformation methods Hard

    Given const a = [, 1, , 2]; const b = a.map(x => x * 2); const c = a.filter(() => true);, which description is correct?

  44. Question 44 of 60 Destructuring assignments Hard

    What are the final values in [a, b, c, x]?

    let x = 1; const { a = x++, b = x++, c = x++ } = { a: undefined, b: null };

  45. Question 45 of 60 Spread and rest operators Hard

    What is returned by apply()?

    function apply({ id, ...base }, patch) { return { ...base, ...patch, id }; } const result = apply({ id: 1, role: "user", active: true }, { id: 9, active: false });

  46. Question 46 of 60 ES modules Hard

    Consider these modules.

    counter.js: export let count = 0; export const increment = () => count++;

    main.js: import { count, increment } from "./counter.js"; console.log(count); increment(); console.log(count);

    What is printed?

  47. Question 47 of 60 Immutability principles Hard

    Given state = { user: { profile: { name: "Lin" }, permissions: ["read"] }, settings: { theme: "dark" } }, which update changes the name to "Ada" without mutation while preserving the original settings and permissions references?

  48. Question 48 of 60 Functional programming concepts relevant to React Hard

    A component must return products sorted by ascending score without mutating the items prop and while retaining each product object's identity. Which expression satisfies those requirements?

  49. Question 49 of 60 Shallow and deep copying mechanisms Hard

    What is true after this code runs?

    const original = { nested: { x: 1 }, list: [1, 2] }; const shallow = { ...original }; const deep = structuredClone(original); shallow.nested.x = 7; deep.list.push(3);

  50. Question 50 of 60 Referential equality and state comparison Hard

    A React component executes state.user.name = "Ada"; setState(state);, where state is the current object from useState. Which outcome best describes the problem?

  51. Question 51 of 60 Single Page Applications and Multi Page Applications Hard

    An application has many URLs, uses the History API for navigation, loads route-specific JavaScript chunks, retrieves data through APIs, and keeps the same document alive between routes. How should it be classified?

  52. Question 52 of 60 React philosophy and declarative UI paradigm Hard

    A component directly changes a rendered element using document.querySelector(...).textContent = "Saved". After an unrelated state update, React restores the previous text. What best explains this behavior?

  53. Question 53 of 60 Component-based architecture Hard

    Two sibling components must display and update the same selected product, while a third sibling only reads it. Which design best preserves a single source of truth?

  54. Question 54 of 60 Setting up React applications using Vite Hard

    A Vite React project defines VITE_API_URL=https://api.example.com in the applicable environment file. Which client-side expression accesses the value correctly?

  55. Question 55 of 60 Modern React development environment and tooling Hard

    Which statement accurately distinguishes Vite's development server from its production build process?

  56. Question 56 of 60 Feature-based project folder structure and best practices Hard

    In a feature-based application, checkout needs a stable selector owned by the cart feature. Which import strategy best protects feature boundaries?

  57. Question 57 of 60 JSX syntax and expressions Hard

    What visible content is produced by <div>{count && <span>New</span>}</div> when count is the number 0?

  58. Question 58 of 60 Rendering components into the DOM Hard

    What is the semantic effect of calling root.render(<App mode="light" />) and then root.render(<App mode="dark" />) on the same root?

  59. Question 59 of 60 Functional components and render lifecycle Hard

    Which statement about functional component rendering and effects remains valid under concurrent rendering and development StrictMode?

  60. Question 60 of 60 Introduction to Virtual DOM and reconciliation process Hard

    A list of stateful row components is reordered. Each row currently uses its array index as key. What is the most likely reconciliation issue, and what is the correct remedy?

That's unit 1

Answer a few questions and your score shows up here.