PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches

Quick Overview

This question evaluates data manipulation and aggregation skills using pandas, focusing on computing per-loan payment totals, payment success rates, and a repayment-status flag. It is commonly asked to assess applied data wrangling and numeric summarization abilities in the Data Manipulation (SQL/Python) domain, testing practical application rather than purely conceptual understanding.

  • Medium
  • Affirm
  • Data Manipulation (SQL/Python)
  • Data Scientist

Analyze Loan Payments Using Pandas for Key Insights

Company: Affirm

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

loan_payments +------------+------------+-------------+-----------+---------+ | loan_id | payment_id | payment_date | amount | status | +------------+------------+-------------+-----------+---------+ | L1 | P1 | 2023-01-15 | 250.00 | success | | L1 | P2 | 2023-02-15 | 250.00 | success | | L1 | P3 | 2023-03-15 | 250.00 | success | | L1 | P4 | 2023-04-15 | 250.00 | success | | L2 | P5 | 2023-01-20 | 500.00 | failed | +------------+------------+-------------+-----------+---------+ ##### Scenario Credit Risk – Analyze loan-payment data with pandas ##### Question Using pandas, load the loan_payments table below and compute: (a) total amount paid per loan_id, (b) payment success rate per loan_id, and (c) a flag indicating whether the loan has been fully repaid ($1,000 principal). Return the resulting DataFrame. ##### Hints Use groupby, agg, and boolean logic.

Quick Answer: This question evaluates data manipulation and aggregation skills using pandas, focusing on computing per-loan payment totals, payment success rates, and a repayment-status flag. It is commonly asked to assess applied data wrangling and numeric summarization abilities in the Data Manipulation (SQL/Python) domain, testing practical application rather than purely conceptual understanding.

Last updated: Mar 29, 2026

Related Coding Questions

  • Write SQL for Transactions and Customers - Affirm (Medium)
  • Implement and debug event filtering in Python - Affirm (Medium)

Loading coding console...

PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.