skip to content

Data & Analysis Libraries

The libraries that do the actual data work in code — pandas and NumPy in Python, dplyr and ggplot2 in R, plus the plotting layers on top. Interviewers ask about them because they reveal whether you think in vectorized operations or in loops.

on this pageshow

explore

questions

295 · 1 section

Two columns of 1,000 values each, taken from different tables, are added together — what decides which value pairs with which?

level: juniorimportance: must knowfreq 58%
basics
~10 s

The tool decides, not the expression. Designs that carry a per-row identifier pair the two operands by that identifier first; designs that carry none pair strictly by position and refuse operands of different lengths.

open as a page

A match of two tables on their key columns returns zero rows, though the same codes print on both sides. Why?

level: juniorimportance: must knowfreq 70%
basics
~20 s

Equality compares stored values, not the rendering. Two codes that print alike can differ by letter case, leading or trailing spaces, an invisible character, a lost leading zero, or one side holding digits as text and the other as numbers.

open as a page

Matching 1,000 orders to a customer list on customer id returns 940 rows: which match shape was used, and what do the others keep?

level: juniorimportance: must knowfreq 80%
basics
~20 s

Losing 60 rows means the match kept only rows partnered on both sides. The three alternatives keep the orders table whole, the customer list whole, or both whole, and unpartnered rows then survive with the other side's columns holding the absent-value marker.

open as a page

Twelve monthly pieces are stacked into one longer table - how does that differ from gluing two tables side by side?

level: juniorimportance: must knowfreq 66%
basics
~20 s

Stacking adds records, so the result is longer and the hazard is two pieces whose column sets do not agree. Gluing side by side adds attributes, so the result is wider and the hazard is rows paired in an order nobody checked.

open as a page

A match of 1,000 order rows against a customer reference table returns 1,340 rows - how is that possible?

level: juniorimportance: must knowfreq 76%
basics
~20 s

A key match returns, for each key value, the first side's occurrence count multiplied by the second side's. If a customer identifier appears more than once in the reference table, the orders carrying it are copied and the total grows.

open as a page