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

Programming Exercises

Write a React component that conditionally displays 'Logged In' or 'Logged Out' based on a hardcoded boolean state.

Easy

Problem Statement

Write a React component that conditionally displays 'Logged In' or 'Logged Out' based on a hardcoded boolean state.

Sample Input

isLoggedIn = true

Sample Output

Logged In (if true) or Logged Out (if false).

Limits

Time: 2s · Memory: 256 MB

Code Editor

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

import React from "react";
 
 const LoginStatus = () => {
  const isLoggedIn = true; // Hardcoded state
 
  return (
  // Conditionally display "Logged In" or "Logged Out"
    <></>
  );
 };
 
 export default LoginStatus;