PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Data Manipulation (SQL/Python)/PayPal

Write conditional aggregates with CASE WHEN

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's ability to implement conditional aggregation in SQL using CASE WHEN, assessing practical query-writing skills and understanding of conditional expressions for grouped counts and conditional sums.

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

Write conditional aggregates with CASE WHEN

Company: PayPal

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

Write a query that produces conditional aggregates using CASE WHEN (e.g., counts of approved vs declined transactions per merchant and the sum of amounts flagged for review). Explain why CASE WHEN is the portable approach across SQL dialects compared with dialect-specific boolean-to-integer coercion (e.g., SUM(column = 'x')). Discuss readability and maintainability trade-offs.

Quick Answer: This question evaluates a candidate's ability to implement conditional aggregation in SQL using CASE WHEN, assessing practical query-writing skills and understanding of conditional expressions for grouped counts and conditional sums.

Related Interview Questions

  • Write SQL using HAVING and window functions - PayPal (easy)
  • Write SQL for top drivers and cancellation rates - PayPal (easy)
  • Compute top orders and cancellation rate - PayPal (easy)
  • Write SQL to flag Venmo ATO - PayPal (Medium)
  • Write conditional aggregation SQL queries - PayPal (Medium)
PayPal logo
PayPal
Jul 31, 2025, 12:00 AM
Data Scientist
Onsite
Data Manipulation (SQL/Python)
2
0

Write a query that produces conditional aggregates using CASE WHEN (e.g., counts of approved vs declined transactions per merchant and the sum of amounts flagged for review). Explain why CASE WHEN is the portable approach across SQL dialects compared with dialect-specific boolean-to-integer coercion (e.g., SUM(column = 'x')). Discuss readability and maintainability trade-offs.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Data Manipulation (SQL/Python)•More PayPal•More Data Scientist•PayPal Data Scientist•PayPal Data Manipulation (SQL/Python)•Data Scientist Data Manipulation (SQL/Python)
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.