DataDrivenDataDriven
LearnPracticeInterviewDiscussDailyJobs

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

  1. Read the vague prompt (just like a real interview)
  2. Ask clarifying questions to the AI interviewer
  3. Write your python solution with real code execution
  4. Get instant feedback and a hire/no-hire decision

Related

  • All Mock Interviews
  • Practice Mode (untimed)
  • Python Interview Questions
  • Data Engineering Interview Prep Guide
  • Practice Problems
  • Daily Challenge