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

Programming Exercises

Create a component that displays an image from a given hardcoded URL using props.

Easy

Problem Statement

Create a component that displays an image from a given hardcoded URL using props.

Sample Input

imageUrl = 'https://via.placeholder.com/150'

Sample Output

An image is displayed on the screen.

Limits

Time: 2s · Memory: 256 MB

Code Editor

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

import React from "react";
 
 const ImageDisplay = (props) => {
  // Use props.imageUrl to render an <img> tag
 };
 
 export default ImageDisplay;