DataDriven
LearnPracticeInterviewDiscussDailyJobs

The Weight of the Book

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
mid

Interview Prompt

An asset-allocation report needs each asset class placed in order of how much money sits in it, where several `holdings` can carry the same `asset_class` and their market values add up. Assign each class a position starting at 1 for the class holding the most total value, and when two classes hold the same total, give the alphabetically earlier name the stronger position. An empty book has nothing to place.

Summary

Every holding pulls its weight. Order the asset classes by what they carry, and let the ties settle by name.

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