FastPrepLeft Rotation to a Strictly Increasing Array
Problems/Left Rotation to a Strictly Increasing Array

Left Rotation to a Strictly Increasing Array

ZipRecruiter logoZipRecruiter● EasyNEW GRADOA

Updated Sep 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Two ZipRecruiter new-grad OA reports preserve cyclic left rotation to ascending order; the stronger report supplies -1 and [3,4,5,1,2] -> 3. This practice version resolves ascending as strict, matching the corroborating index-order description.

Given a nonempty integer array numbers, return how many cyclic left shifts make it strictly increasing.

If no cyclic left rotation works, return -1. Return the unique valid shift when one exists.

Function

rotationToIncreasing(numbers: int[]) → int

Examples

Example 1

numbers = [3,4,5,1,2]return = 3

Rotating left by three produces [1,2,3,4,5].

Example 2

numbers = [1,2,3]return = 0

The array is already strictly increasing.

Constraints

  • 1 <= numbers.length <= 100000

More ZipRecruiter Online Assessment questions

  • Four-Level Banking System with Scheduled PaymentsOA · Seen Oct 2026
  • Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
  • Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
  • Minimum Changes to Draw a YOA · Seen Oct 2024
  • Apply Binary State OperationsOA · Seen Sep 2024
  • Simulate Orchard Rot SpreadOA · Seen Sep 2024
  • Compare Odd- and Even-Index SumsOA · Seen Sep 2024
  • Coordinate Removals with Column GravityOA · Seen Sep 2024
  • Lexicographically Smallest End ReversalOA · Seen Sep 2024
  • Recursively Expanded Shell Command CountsOA · Seen Sep 2024

Similar questions at other companies

  • Build the Task HierarchyPendo · OA
  • Lowest Number in an Open RangeCapital One · OACapital One interview questions
  • Missing IntervalsIBM · OAIBM interview questions
  • Total Cost Against the Lowest Earlier PricePayPal · OAPayPal interview questions
  • 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
  • Competition Winner and Runner-Up (Forward Deployed Engineer)Boston Consulting Group · OABoston Consulting Group interview questions
  • Find Words That Can Be Formed by CharactersTabaPay · OA

ZipRecruiter interview experiences

  • ZipRecruiter SWE OA, Level Not Reported: 23 Experiences
  • ZipRecruiter SWE Intern OA Scores: 4 Experiences
  • ZipRecruiter SWE New Grad OA: 9 Experiences
All ZipRecruiter interview questionsSee ZipRecruiter hiring insights
Saved
class Solution {
    public int rotationToIncreasing(int[] numbers) {
        // Write your code here.
    }

}
Checking account…