The Trade Signal
A easy Python mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- Python
- Difficulty
- easy
- Seniority
- L4
Interview Prompt
Given a list of prices, find the max gain of a single buy-then-sell window. Return a 3-element list [gain, buy_day_index, sell_day_index]. If no profit is possible (gain <= 0), return [0, 0, 0]. Among multiple windows tied for max gain, return the one with the earliest buy index then earliest sell index.
Summary
Buy low, sell high. Identify the ideal moment.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write your python solution with real code execution
- Get instant feedback and a hire/no-hire decision