PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches

Quick Overview

This question evaluates proficiency in Python data manipulation and pandas DataFrame construction, specifically handling nested list structures and aligning rows by identifiers.

  • hard
  • Walmart Labs
  • Data Manipulation (SQL/Python)
  • Data Scientist

Convert Dictionary to DataFrame

Company: Walmart Labs

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: hard

Interview Round: Technical Screen

Using Python and pandas, convert the following dictionary into a DataFrame. Each top-level key is a target column name, and each value is a list of `[row_id, cell_value]` pairs. Use the first element of each pair as the row identifier, align rows by `row_id` across all keys, and produce a wide DataFrame with one row per `row_id` and one column per top-level key. Input: ```python data = { 'text1': [[123, '2'], [345, '3']], 'text2': [[123, '4'], [345, '4']] } ``` Expected structure: - `row_id = 123` -> `text1 = '2'`, `text2 = '4'` - `row_id = 345` -> `text1 = '3'`, `text2 = '4'` Write Python code to create the DataFrame.

Quick Answer: This question evaluates proficiency in Python data manipulation and pandas DataFrame construction, specifically handling nested list structures and aligning rows by identifiers.

Last updated: May 7, 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.