PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches

Quick Overview

This question evaluates proficiency in Python data manipulation, including memory and evaluation differences between list comprehensions and generators, CPython integer semantics, mutable argument behavior, and idiomatic pandas groupby and boolean indexing, and is commonly asked to assess performance awareness, understanding of language internals, debugging of mutable state, and practical data-aggregation skills. It belongs to the Data Manipulation (SQL/Python) domain and tests both conceptual understanding of language semantics and practical application of Python and pandas for efficient data processing.

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

Manipulate data efficiently in Python

Company: Other

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

Answer the following: (a) Contrast list comprehensions and generators with respect to memory and evaluation; write a generator that yields rolling windows of size k over a list. (b) In CPython 3.x, what is the maximum integer value and why? (c) Demonstrate a bug caused by Python’s pass-by-object-reference when mutating a list argument inside a function; fix it. (d) Given a pandas DataFrame of the events table (columns: user_id, event_date, event_type, revenue), compute per-country 7-day conversion on 2025-09-01 and total revenue using idiomatic groupby and boolean indexing; avoid apply for row-wise operations.

Quick Answer: This question evaluates proficiency in Python data manipulation, including memory and evaluation differences between list comprehensions and generators, CPython integer semantics, mutable argument behavior, and idiomatic pandas groupby and boolean indexing, and is commonly asked to assess performance awareness, understanding of language internals, debugging of mutable state, and practical data-aggregation skills. It belongs to the Data Manipulation (SQL/Python) domain and tests both conceptual understanding of language semantics and practical application of Python and pandas for efficient data processing.

Last updated: Mar 29, 2026

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.

Related Coding Questions

  • Solve window-function SQL without joins - Other (Medium)
  • Build SQL pivot with lookups and currency conversion - Other (Medium)
  • Write SQL to analyze response accuracy and speed - Other (Medium)
  • Design MapReduce and Spark jobs - Other (Medium)
  • Query conversion and retention with SQL windows - Other (Medium)