FastPrepMaximum Frog Separation with One Upward Jump (Practice Reconstruction)
Problems/Maximum Frog Separation with One Upward Jump (Practice Reconstruction)

Maximum Frog Separation with One Upward Jump (Practice Reconstruction)

Marshall Wace logoMarshall Wace● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The short recollection mentions strictly higher adjacent blocks and one jump, but omits starting positions, staying and the distance definition. This reconstruction uses a shared chosen start, optional staying, at most one jump each and index distance; exact interview rules remain unverified. It matches at about 60%.

A row of blocks has heights blocks[i]. For this exercise, assume two frogs begin together on one block of your choice.

Each frog may stay or make at most one jump. A jump moves to an adjacent block whose height is strictly greater than the starting block height. The frogs may occupy the same block.

For this exercise, measure their final distance as the absolute difference between their final block indices. Return the maximum possible distance after choosing the shared start and each frog's allowed move.

Function

solution(blocks: int[]) → int

Examples

Example 1

blocks = [4,1,5]return = 2

This example starts at index 1. The frogs jump to indices 0 and 2, whose distance is 2.

Example 2

blocks = [1,2,3,4]return = 1

This example allows only one adjacent jump per frog. Choose any lower block, keep one frog there and move the other right by one.

Example 3

blocks = [5,5]return = 0

This example has no strictly higher neighbour. Both frogs stay together, giving distance zero.

Constraints

  • For this exercise, assume 1 <= blocks.length <= 100000.
  • For this exercise, assume 0 <= blocks[i] <= 10^9.

More Marshall Wace interview questions

  • Maximum Sum with at Most Three Two-Element TilesPHONE SCREEN · Seen Sep 2025
  • Minimum Full Glasses for an Exact Water VolumePHONE SCREEN · Seen Sep 2025
  • Smallest Absolute Difference Between Two Array ElementsPHONE SCREEN · Seen Sep 2025
  • Minimum Deletions Before Rearranging into a PalindromePHONE SCREEN · Seen Jul 2023
  • Smallest Larger Integer with Twice the Digit SumPHONE SCREEN · Seen Jul 2023
  • Count Squares of Any OrientationPHONE SCREEN · Seen Oct 2019
  • Count Letters with Ordered Lowercase and Uppercase OccurrencesOA · Seen Oct 2025
  • Maximum Trailing Zeros on a Path with at Most One TurnOA · Seen Oct 2025
  • Shortest Subarray Covering an Integer RangeOA · Seen Oct 2025
  • Maximum Events in a 60-Second WindowOA · Seen Aug 2025

Similar questions at other companies

  • Automation Pipeline, Part 1: Single WorkerPlaid · PHONE SCREENPlaid interview questions
  • Search and Format ContactsAdyen · PHONE SCREENAdyen interview questions
  • Array-Backed Set Without Library CollectionsOde with Anthropic · PHONE SCREEN
  • Paginate Retained Conversation HistorySierra · PHONE SCREENSierra interview questions
  • Validate a Chess Bishop, Rook, or Queen MoveGlean · PHONE SCREENGlean interview questions
  • Count Distinct Underwriting PII ValuesAffirm · PHONE SCREEN · ONSITE INTERVIEWAffirm interview questions
  • Apply Affine Array TransformationsByteDance · PHONE SCREENByteDance interview questions
  • Match a Variadic Function SignatureConfluent · PHONE SCREENConfluent interview questions
  • Bounded IPv4 FilterAmazon · PHONE SCREEN
  • Partition and Group Values by ParityEPAM · PHONE SCREENEPAM interview questions

Interview reports that mention this question

  • Marshall Wace Coding Tests: 11 Experiences (Part 2 of 3)
  • Marshall Wace Quant and Coding OA: 19 Experiences (Part 1 of 3)

Marshall Wace interview experiences

  • Marshall Wace Older Quant Tests: 5 Experiences (Part 3 of 3)
All Marshall Wace interview questionsSee Marshall Wace hiring insights
Saved
class Solution {
    public int solution(int[] blocks) {
        // Write your solution here.
    }
}
Checking account…