PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Coding & Algorithms/Jump Trading

Solve stock trading with pattern rules

Last updated: May 16, 2026

Quick Overview

This set of problems evaluates algorithmic skills in pattern recognition, state management, and sequence processing, specifically testing pattern-based decision rules on time-series stock data and iterative substring elimination in string processing within the Coding & Algorithms domain.

  • Medium
  • Jump Trading
  • Coding & Algorithms
  • Machine Learning Engineer

Solve stock trading with pattern rules

Company: Jump Trading

Role: Machine Learning Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

##### Question Given an array of daily stock prices and two pattern arrays: sellPattern and buyPattern, each consisting of 1 (price up) and -1 (price down) representing the required consecutive daily movements that must appear immediately before a sell or buy action respectively. On any day you may execute both a buy and a sell if both patterns match ending that day. Return an integer array shares[0..n-1] where shares[i] is the number of shares held after processing day i. Example: prices = ?, sellPattern = [1,1], buyPattern = [...]; expected output [0,0,1,2,1,0]. —— Given a string s and a fixed set of substrings combos (e.g., {"bc", "ab", "cd"}), repeatedly remove every occurrence of any combo from s until no such substring remains. Return the resulting string.

Quick Answer: This set of problems evaluates algorithmic skills in pattern recognition, state management, and sequence processing, specifically testing pattern-based decision rules on time-series stock data and iterative substring elimination in string processing within the Coding & Algorithms domain.

Related Interview Questions

  • Identify read-only files from permission records - Jump Trading (nan)
  • Solve stock-pattern trading and substring elimination - Jump Trading (Medium)
  • Explain C++ vector, unordered_map, and virtual functions - Jump Trading (Medium)
Jump Trading logo
Jump Trading
Aug 4, 2025, 10:55 AM
Machine Learning Engineer
Take-home Project
Coding & Algorithms
5
0
Question

Given an array of daily stock prices and two pattern arrays: sellPattern and buyPattern, each consisting of 1 (price up) and -1 (price down) representing the required consecutive daily movements that must appear immediately before a sell or buy action respectively. On any day you may execute both a buy and a sell if both patterns match ending that day. Return an integer array shares[0..n-1] where shares[i] is the number of shares held after processing day i. Example: prices = ?, sellPattern = [1,1], buyPattern = [...]; expected output [0,0,1,2,1,0].

——

Given a string s and a fixed set of substrings combos (e.g., {"bc", "ab", "cd"}), repeatedly remove every occurrence of any combo from s until no such substring remains. Return the resulting string.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Jump Trading•More Machine Learning Engineer•Jump Trading Machine Learning Engineer•Jump Trading Coding & Algorithms•Machine Learning Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.