EASYasked at 1 company

Get the Size of a DataFrame

A easy-tier problem at 85% community acceptance, tagged with . Reported in interviews at Google and 0 others.

Founder's read

Get the Size of a DataFrame is one of those problems that sounds trivial until you realize the nuance in what 'size' actually means in a pandas context. Google asks it, and at 85% acceptance it looks easy, but that's because most candidates who reach this problem already know pandas basics. The catch: are you returning the total element count, the shape tuple, or something else. If you freeze on this in a live assessment, StealthCoder surfaces the exact method and return type in seconds, invisible to the proctor.

Companies asking
1
Difficulty
EASY
Acceptance
85%

Companies that ask "Get the Size of a DataFrame"

If this hits your live OA

Get the Size of a DataFrame is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround.

Get StealthCoder
What this means

The problem tests whether you know the difference between DataFrame.size (total elements), DataFrame.shape (rows and columns as a tuple), and len() (row count only). Most candidates default to one method without reading what the problem asks for. The gotcha is subtle: size returns an integer (rows times columns), shape returns a tuple, and each serves a different purpose. In a live OA you might second-guess yourself on which method the problem wants. StealthCoder hedges that moment by running invisibly during screen share and showing you the correct method and expected output format before you submit a wrong answer.

The honest play

You know the problem. Make sure you actually pass it.

Get the Size of a DataFrame recycles across companies for a reason. It's easy-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Get the Size of a DataFrame interview FAQ

Is this actually asked at top companies like Google?+

Yes. Google's the only company in the dataset for this problem, and at 85% acceptance it's clearly part of their pandas or Python fundamentals screening. It's not the hard problem in the loop, but it's the one you don't want to get wrong because it's supposed to be easy.

What's the difference between size, shape, and len on a DataFrame?+

size returns the total element count as an integer (rows * columns). shape returns a tuple of (rows, columns). len() returns only the row count. The problem will ask for one specifically. Read carefully or you'll submit the wrong type.

Why is the acceptance rate so high if it's being asked?+

Because candidates who reach this problem in a real assessment already know pandas basics. High acceptance doesn't mean it's not asked, it means the filtering has already happened upstream. You still need to get it right.

What's the trick I'm missing?+

There's no algorithm trick. The trick is knowing pandas API. You call the right method and return the right type. The problem tests whether you've actually used pandas before or just read about it online.

How does this relate to other pandas problems?+

It's foundational. If you can't reliably call size, shape, or len on a DataFrame, you'll struggle with filtering, iteration, and reshaping tasks that come later. Get this one clean and move fast.

Want the actual problem statement? View "Get the Size of a DataFrame" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.