FastPrepLargest Element in an Array
Problems/Largest Element in an Array

Largest Element in an Array

Deloitte logoDeloitte● EasyNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Deloitte new grad online assessment. The task asks directly for the largest value in an integer array. We only added numeric limits that work in every language. Our version is about 99% the same as the reported question.

You are given a non-empty integer array numbers. Return the largest value present in the array.

Function

largestElement(numbers: int[]) → int

Examples

Example 1

numbers = [3,7,2,9,4]return = 9

9 is greater than every other value in the array.

Example 2

numbers = [-5,-2,-9]return = -2

Among the negative values, -2 is the largest.

Example 3

numbers = [6]return = 6

The only element is also the maximum.

Constraints

  • 1 <= numbers.length <= 100000
  • -10^9 <= numbers[i] <= 10^9

More Deloitte Online Assessment questions

  • Seventh Nearest PalindromeOA · Seen May 2026
  • Minimum Deletions for a Non-PalindromeOA · Seen Jul 2025
  • Minimum-Cost Solar Rooftop AllocationOA · Seen Jul 2025
  • Pair Elements with Even SumsOA · Seen Jul 2025
  • Count Divisible PermutationsOA · Seen Jan 2025
  • Install Carbon FiltersOA · Seen Oct 2023
  • Longest Substring with Even OccurrencesOA · Seen Oct 2023
  • Maximum Sum RectangleOA · Seen Apr 2022
  • Annual Bank Balance with Monthly Card FeesOA · Seen Jan 2022
  • Count Battleships by SizeOA · Seen Jan 2022

Similar questions at other companies

  • Count User Mentions in Chat MessagesRamp · OARamp interview questions
  • Count Valid Square PairsAuxoAI · OA
  • Catch Fish with Reusable BaitsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Two SumAmazon · OA · PHONE SCREEN
  • Count Strictly Increasing Contiguous WindowsIBM · OAIBM interview questions
  • Find Words That Can Be Formed by CharactersTabaPay · OA
  • Server InvestmentRippling · OARippling interview questions
  • Book Reading EveningsGoogle · OAGoogle interview questions
  • Minimum Index Distance Between Person and CakeSnowflake · OA · PHONE SCREENSnowflake interview questions
  • Basic Item DiscountsPalantir · OAPalantir interview questions

Interview reports that mention this question

  • Deloitte New Grad Tech OA and Interview Questions: 14 Experiences
All Deloitte interview questionsSee Deloitte hiring insights
Saved
class Solution {
    public int largestElement(int[] numbers) {
        // Write your solution here.
    }
}
Checking account…