Two-Tower Strategy Game
Updated
Problem statement
West and East each start with a near tower of height 5, a far tower of height 0, no dollies, and no bricks on dollies. Each unlocked turn uses one action:
BUY: acquire one permanent dolly.LOAD: add one brick to every dolly.MOVE_NEAR: move every dolly brick to the near tower and empty the dollies.MOVE_FAR: commit every dolly brick to the far tower and empty the dollies. The team is locked on the following day; those bricks arrive at the start of that locked turn.OBSERVE: consume the turn without changing state.
West acts first each day. East follows the supplied deterministic action schedule; an action listed on a locked East day is ignored. West wins after either turn when its near tower is taller than East's far tower and its far tower is taller than East's near tower.
Return a minimum-day winning West schedule of calendar-day actions within dayLimit, including WAIT on a forced locked day. Break equal-length ties lexicographically using BUY < LOAD < MOVE_FAR < MOVE_NEAR < OBSERVE < WAIT. Return an empty array when no win is possible.
Function
findWinningTowerStrategy(eastActions: String[], dayLimit: int) → String[]Examples
Example 1
eastActions = ["OBSERVE","OBSERVE","OBSERVE","OBSERVE","OBSERVE","OBSERVE","OBSERVE"]dayLimit = 7return = ["BUY","BUY","BUY","LOAD","LOAD","MOVE_FAR","WAIT"]West loads six bricks onto three dollies, commits them on day 6, and receives them on the forced wait day, making the far tower taller than East's near tower.
Example 2
eastActions = ["BUY","LOAD","MOVE_NEAR","BUY"]dayLimit = 4return = []Four days are insufficient for West to build a far tower above East's near tower.
Constraints
1 <= dayLimit <= 8.eastActions.length == dayLimit.- Every East action is one of
BUY,LOAD,MOVE_FAR,MOVE_NEAR, orOBSERVE.
More Jane Street interview questions
- Code Editor FoldingONSITE INTERVIEW · Seen Oct 2026
- Exact-Sixty Dice Game ValueONSITE INTERVIEW · Seen Oct 2026
- Expected Value of Modified DiceONSITE INTERVIEW · Seen Oct 2026
- Spaceship Equipment LoadoutONSITE INTERVIEW · Seen Oct 2026
- Wizard Scroll Allocation StrategyONSITE INTERVIEW · Seen Oct 2026
- Sort TradesPHONE SCREEN · ONSITE INTERVIEW · Seen Jul 2026
- Order Matching EngineONSITE INTERVIEW · Seen Jul 2026
- Order Book Data ValidationONSITE INTERVIEW · Seen Nov 2025
- Biggest Daily Move and Longest Rising StreakOA · ONSITE INTERVIEW · Seen Apr 2021
- Maximum-Scoring Consecutive Tree LevelsPHONE SCREEN · Seen Nov 2026
Similar questions at other companies
- Remove Invalid ParenthesesMygate · ONSITE INTERVIEWMygate interview questions
- Cats, Rabbits, and Snails Board GameAsana · ONSITE INTERVIEW
- Word Ladder II: All Shortest TransformationsPeopleStrong · ONSITE INTERVIEWPeopleStrong interview questions
- Word Ladder IIBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
- Concurrent Web Crawler SimulationOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
- Explore an Unknown Grid and Find a PathLinkedIn · ONSITE INTERVIEWLinkedIn interview questions
- Minesweeper Board UpdateUber · ONSITE INTERVIEWUber interview questions
- Minesweeper Board UpdateClay · ONSITE INTERVIEW
- Paths Between Numbers in a 3×3 GridGoogle · ONSITE INTERVIEWGoogle interview questions
- Minesweeper Board UpdateAirbyte · ONSITE INTERVIEW
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)
- Jane Street TDO Excel and VBA Test: 23 Experiences (Part 8 of 10)
- Jane Street TDOE UK Coding Round: 15 Experiences (Part 3 of 10)