Closing Bell
A medium Python mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L6
Interview Prompt
A brokerage export gives you `prices`, a dict keyed by ISO date string mapping to that day's close, and `purchases`, a list of `[date, quantity]` buy records where quantity is a whole number of shares. Mark every lot to the price on the latest date in the history and return the portfolio's total gain, where each buy contributes its quantity times how far the price has moved since the day it was bought.
Summary
Every share you own, priced at today's close. Tally the gains.
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