Reported May 2026
Capital Onearray

Cyclic Shift to Strictly Descending Array

Reported by candidates from Capital One's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Capital One OA. Under 2s to a working solution.
Founder's read

Capital One asked this in May 2026: given an array and a shift amount t, rotate the last t elements to the front and check if the result is strictly descending. You have one shot at this during the OA. The trick is understanding what "strictly descending" means after the rotation, and avoiding off-by-one errors in the shift logic. If you blank on the rotation mechanics, StealthCoder will have the pattern locked in seconds so you can code clean.

The problem

Complete the function below. The function receives the full standard input as a single string and must return the exact standard output value for the described problem. Original prompt Problem Given an integer array nums of length n and an integer t (0 <= t < n). Define one cyclic shift as moving the last t elements of the array to the front (i.e., a right rotation by t). Determine whether applying this shift once makes the array strictly descending. Return true/false. Note: The original description is slightly ambiguous about whether t is given or you may choose t. This version assumes t is given and you check the result after one shift. Input Integer array nums Integer t Output true or false Constraints (suggested) 1 <= n <= 2e5 0 <= t < n -1e9 <= nums[i] <= 1e9 Examples nums=[3,2,1], t=0 → true nums=[1,3,2], t=1 → false nums=[2,1,3], t=2 → false nums=[4,3,2,1], t=1 → false nums=[2,1], t=1 → false Function Description Complete solveOneCyclicShiftStrictlyDescending. It has one parameter, String input, containing the full stdin payload. Return the exact stdout value as a string, either "true" or "false". The returned string must match the expected standard output for the sample input. Use the limits and requirements stated in the prompt.

Reported by candidates. Source: FastPrep

Pattern and pitfall

This is a straightforward array rotation problem disguised as a validation check. After rotating right by t positions, you need to verify every element is strictly greater than the next. The rotation itself is the trap: moving the last t elements to the front means index i in the rotated array comes from index (i - t + n) % n in the original. Don't overthink it. Build the rotated array or just validate the condition without materializing it, then check nums[rotated[i]] > nums[rotated[i+1]] for all i. The edge case is t=0, which means no rotation at all. StealthCoder eliminates the risk of implementing rotation backwards or off-by-one during the live OA.

If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.

If this hits your live OA

You can drill Cyclic Shift to Strictly Descending Array cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as rotate array. If you have time before the OA, drill that.

⏵ The honest play

You've seen the question. Make sure you actually pass Capital One's OA.

Capital One reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Cyclic Shift to Strictly Descending Array FAQ

What does 'cyclic shift' mean exactly?+

Moving the last t elements to the front. If nums=[1,2,3] and t=1, the last 1 element (3) moves front, giving [3,1,2]. It's a right rotation by t positions. Not a left rotation.

Do I need to actually create the rotated array?+

No. You can check strict descent without building it. Use (i - t + n) % n to map rotated indices back to original indices. Or build it if it's simpler for you. Both are O(n) time, O(n) or O(1) space.

What if t=0?+

No rotation happens. Just check if the original array is strictly descending. This is your sanity check case. nums=[3,2,1] with t=0 returns true. nums=[1,2,3] with t=0 returns false.

Will negative numbers or duplicates trip me up?+

Negatives are fine. Duplicates fail strict descent, so [2,2,1] after any rotation is false. That's a quick mental check if you're unsure about your logic.

How do I avoid rotation bugs in 2 minutes?+

Write the rotation as rotated[i] = nums[(i - t + n) % n] or use Python's deque.rotate(). Test t=0 and t=n-1 on the examples. If both pass, submit. Don't get clever.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Capital One.

OA at Capital One?
Invisible during screen share
Get it