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

Programming Exercises

Write a component that calculates the Fibonacci sequence up to a given hardcoded number and displays the sequence.

Hard

Problem Statement

Write a component that calculates the Fibonacci sequence up to a given hardcoded number and displays the sequence.

Sample Input

7

Sample Output

Fibonacci Sequence: [0, 1, 1, 2, 3, 5, 8]

Limits

Time: 2s · Memory: 256 MB

Code Editor

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

import React from "react";
 
 const FibonacciSequence = () => {
  return (
  <div>
  {/* Display the Fibonacci sequence */}
  </div>
  );
 };
 
 export default FibonacciSequence;