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

Programming Exercises

Write a React component that accepts a hardcoded name prop and displays 'Hello, {name}!'.

Easy

Problem Statement

Write a React component that accepts a hardcoded name prop and displays 'Hello, {name}!'.

Sample Input

name = 'John'

Sample Output

Hello, John!

Limits

Time: 2s · Memory: 256 MB

Code Editor

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

import React from "react";
 
 const Greeting = (props) => {
  // Return JSX to display the greeting using props.name
 };
 
 export default Greeting;