FastPrepBiggest Daily Move and Longest Rising Streak
Problems/Biggest Daily Move and Longest Rising Streak

Biggest Daily Move and Longest Rising Streak

Jane Street logoJane Street● EasyNEW GRADFULLTIMEOAONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in two Jane Street trading desk operations interview reports, posted in 2018 and 2021. One candidate got a take-home coding task about finding the largest single mover in price data, and in the final round was asked to code either the largest mover or the longest run of days a stock price goes up. The other report describes a take-home task that loops through data to find the largest and smallest values.

The reports do not give the data layout, how a move is measured, or how ties break. Here, you get one stock's daily prices in cents. A move is the absolute change from the day before, ties go to the earliest day, and you return both answers together. The limits and examples are ours. The largest and smallest value scan is not tested.

Our version is about 75% the same as the reported question.

You are given the closing price of one stock over n trading days. prices[i] is the price in cents on day i, where days are numbered from 0.

The move on day i (for i >= 1) is the absolute change from the day before, |prices[i] - prices[i - 1]|. A rising streak is a run of consecutive days on which the price is strictly higher than on the day before; its length is the number of those days.

Return an array [moveDay, longestStreak]:

  • moveDay is the day with the largest move. If several days share the largest move, use the earliest of them.
  • longestStreak is the length of the longest rising streak, or 0 if the price never rises.

Function

priceScan(prices: int[]) → int[]

Examples

Example 1

prices = [100,102,98,99,101,104,103]return = [2,3]

The daily moves are 2, 4, 1, 2, 3, 1. The biggest is 4, from 102 on day 1 to 98 on day 2, so the first value is 2. From day 2 the price rises on days 3, 4 and 5 (98 < 99 < 101 < 104), a streak of 3 rising days.

Example 2

prices = [50,40,30]return = [1,0]

Both moves are 10, so the earlier day, day 1, wins the tie. The price never rises, so the longest streak is 0.

Example 3

prices = [1,3,2,4,6]return = [1,2]

The moves are 2, 1, 2, 2 on days 1 to 4. Days 1, 3 and 4 tie for the biggest move, and day 1 is the earliest. The price rises on days 3 and 4 (2 < 4 < 6), a streak of 2.

Constraints

  • 2 <= prices.length <= 2 * 10^4
  • 1 <= prices[i] <= 10^6

More Jane Street interview questions

  • Product Profit SummaryOA · Seen Sep 2026
  • Cheating CodemakerOA · Seen Mar 2026
  • Bond Haircut by Ratings and MaturityOA · Seen Aug 2024
  • Currency Haircut with FX ForwardsOA · Seen Aug 2024
  • Transform StringOA · Seen Jul 2024
  • Price Deviation AlertsOA · Seen Nov 2023
  • Trade Blotter Summary by TickerOA · Seen Jun 2021
  • Transaction Fees by InstrumentOA · Seen Mar 2018
  • Maximum-Scoring Consecutive Tree LevelsPHONE SCREEN · Seen Nov 2026
  • Tree Selection and VisibilityPHONE SCREEN · Seen Nov 2026

Similar questions at other companies

  • Missing IntervalsIBM · OAIBM interview questions
  • Total Cost Against the Lowest Earlier PricePayPal · OAPayPal interview questions
  • Bad Request AlertsMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Confusing Bib NumbersVerily · ONSITE INTERVIEW
  • Count User Mentions in Chat MessagesRamp · OARamp interview questions
  • Group Transactions by HourAffirm · ONSITE INTERVIEWAffirm interview questions
  • Count Valid Square PairsAuxoAI · OA
  • Longest Common PrefixKotak Mahindra Bank · PHONE SCREEN · ONSITE INTERVIEWKotak Mahindra Bank interview questions
  • Rotate a Matrix by 90 DegreesIDFC Bank · ONSITE INTERVIEWIDFC Bank interview questions
  • Catch Fish with Reusable BaitsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions

Interview reports that mention this question

  • Jane Street TDO Earlier US Finals: 19 Experiences (Part 7 of 10)
  • Jane Street TDOE New Grad Interview Questions: 11 Experiences

Jane Street interview experiences

  • Jane Street TDO UK and Hong Kong: 22 Experiences (Part 10 of 10)
  • Jane Street TDOE US Final Round: 11 Experiences (Part 5 of 10)
  • Jane Street TDO Phone Math Round: 26 Experiences (Part 9 of 10)
  • Jane Street TDOE UK Phone Screen: 15 Experiences (Part 4 of 10)
All Jane Street interview questionsSee Jane Street hiring insights
Saved
class Solution {
    public int[] priceScan(int[] prices) {
      // Write your code here.
    }
}
Checking account…