Jump Trading–styleSoftware EngineerC++ Software EngineerQuestion #50

Task 1: You are given a string containing only numbers and the mathematical operators '+' and '*'. Read the string character by character. If it is a digit, push it onto a stack. If it is an operator, pop two elements from the stack, apply the operator, and push the result onto the stack. If there are not enough elements on the stack or no operator to apply, return -1. For example, for '12+4*7*', the result should be 84. Task 2: You have three ticket options: a 1-day ticket for $2, a 7-day ticket for $7 (valid for 7 consecutive days), and a 30-day ticket for $25. Given a list of days (integers in increasing order) on which you plan to travel, return the minimum possible amount of money you need to spend on tickets. For example, given [1,2,3,4,5,11,12,25], the minimum possible cost is 13.

Build Your Approach

State the assumptions, try a simple case, then work toward a general solution. Check the result and explain how it changes if an assumption changes.

Try the free diagnostic with worked solutions →

Get Free Interview Prep Resources

Practice the Reasoning Behind the Answer

Bring your target roles and interview timeline to a free quant consult. Discuss your preparation priorities and how Quant Blueprint’s lessons, practice and mock interviews can help.

Book a Free Quant Consult

Your goals · your preparation · your next steps