Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Create a component that fetches and displays a list of hardcoded items from a mock API.

Medium

Problem Statement

Create a component that fetches and displays a list of hardcoded items from a mock API.

Sample Input

[{ "id": 1, "title": "Item 1" }, { "id": 2, "title": "Item 2" }]

Sample Output

Item 1
 Item 2

Limits

Time: 2s · Memory: 256 MB

Code Editor

Try your code in this preview. Submit marks it done.

import React, { useState, useEffect } from "react";
 
 const FetchItems = () => {
  return (
  <div>
  {/* Render fetched items here */}
  </div>
  );
 };
 
 export default FetchItems;