FastPrepCircular High-Low Pattern
Problems/Circular High-Low Pattern

Circular High-Low Pattern

Capital One logoCapital One● EasyFULLTIMEOA
QuestionFunctionExamplesConstraints

Problem statement

Source note: The original report asks whether a circular array follows a high-low arrangement. This practice version makes strict circular-neighbor comparisons and equality behavior explicit.

Given an even-length circular integer array values, return whether its elements strictly alternate between local lows and local highs.

For every index i, compare values[i] with its two circular neighbors. Every element must be strictly greater than both neighbors or strictly less than both neighbors, and adjacent elements must have opposite roles. Equal adjacent values are not allowed.

Function

isCircularHighLow(values: int[]) → boolean

Examples

Example 1

values = [1,3,2,4]return = true

Reading around the circle gives low, high, low, high.

Example 2

values = [1,2,3,4]return = false

Values 2 and 3 are neither alternating circular extrema.

Constraints

  • 4 <= values.length <= 100000.
  • values.length is even.
  • -1000000000 <= values[i] <= 1000000000.

More Capital One problems

  • Digit-Coded Card ValidationONSITE INTERVIEW · Seen Nov 2026
  • Rank Football TeamsOA · Seen Oct 2026
  • Count Subarrays Matching a Comparison PatternOA · Seen Oct 2026
All Capital One interview questionsSee Capital One hiring insights
Saved
class Solution {
    public boolean isCircularHighLow(int[] values) {
        // Write your code here.
    }
}
Checking account…