PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates a candidate's ability to perform vectorized data manipulation and numerical validation with Python/NumPy, covering random matrix generation, column normalization, handling edge cases like all-zero columns, and producing unit tests plus time and space complexity analysis.

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

Generate binomial matrix and column-normalize

Company: Google

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

Using Python with NumPy, generate a 100×100 matrix of Binomial(n = 10, p = 0.3) draws with a fixed random seed, then normalize each column so it sums to 1. Ensure vectorized code, guard against any all-zero column by leaving it as all zeros or replacing with a uniform distribution (state your choice), and verify numerically that column sums are 1 within floating-point tolerance. Provide time and space complexity and a brief unit test.

Quick Answer: This question evaluates a candidate's ability to perform vectorized data manipulation and numerical validation with Python/NumPy, covering random matrix generation, column normalization, handling edge cases like all-zero columns, and producing unit tests plus time and space complexity analysis.

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

  • Analyze video flags and reviews with SQL - Google (Medium)
  • Write SQL/Python for messy event data - Google (Medium)
  • Add a conditional column in Python - Google (Medium)
  • Find most co‑purchased product pairs in SQL - Google (Medium)
  • Design a scalable video platform database - Google (Medium)