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

Programming Exercises

Write a Ruby program to find the maximum and minimum values in a hash.

Easy

Problem Statement

Write a Ruby program to find the maximum and minimum values in a hash.

Sample Input

{a: 10, b: 20, c: 5, d: 15}

Sample Output

Maximum: 20
Minimum: 5

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
# Predefined hash hash = {a: 10, b: 20, c: 5, d: 15} # Your logic here
Log in or sign up to run or submit your code.Log inSign up
Input
{a: 10, b: 20, c: 5, d: 15}
Expected Output
Maximum: 20
Minimum: 5