0% found this document useful (0 votes)
104 views1 page

MR Cooper Coding Questions

The document presents three coding questions categorized by difficulty: Easy, Medium, and Hard. The Easy question involves calculating the sum of even numbers in an array, the Medium question requires finding indices of two numbers that sum to a target value, and the Hard question focuses on determining the length of the longest substring without repeating characters. Each question includes example inputs and outputs for clarity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views1 page

MR Cooper Coding Questions

The document presents three coding questions categorized by difficulty: Easy, Medium, and Hard. The Easy question involves calculating the sum of even numbers in an array, the Medium question requires finding indices of two numbers that sum to a target value, and the Hard question focuses on determining the length of the longest substring without repeating characters. Each question includes example inputs and outputs for clarity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Coding Questions – Easy, Medium, Hard

Easy Level Question


Given an array of integers, write a program to calculate the sum of all even numbers present
in the array.

Input: An array of integers


Output: An integer representing the sum of even numbers

Example:
Input: [1, 2, 3, 4, 5]
Output: 6

Medium Level Question


Given an array of integers and a target value, write a program to find the indices of two
numbers in the array such that their sum is equal to the target value. Assume that exactly
one solution exists.

Input: An array of integers and a target integer


Output: Indices of the two numbers

Example:
Input: nums = [3, 5, 2, 7], target = 9
Output: [1, 2]

Hard Level Question


Given a string, write a program to find the length of the longest substring without repeating
characters.

Input: A string
Output: An integer representing the length of the longest substring

Example:
Input: "abcabcbb"
Output: 3

You might also like