Home › Blog › 30 Days of Pandas

LeetCode 30 Days of Pandas: A Day-by-Day Study Guide

What is in the plan, the pandas concept behind each day, the traps that fail correct-looking answers, how it pairs with SQL 50, and how much it helps for data interviews.

LeetCode 30 Days of Pandas is LeetCode’s free study plan for pandas interview questions: 30 core problems in six sections (Data Filtering, String Methods, Data Manipulation, Statistics, Data Aggregation and Data Integration), plus three bonus questions, for 33 in total. As of October 2026 the mix is 25 Easy and 8 Medium with no Hard, and five of the problems are marked Premium. One problem a day takes a month; if you already know SQL, three a day gets you through in about ten days. Sixteen of the 33 problems also appear in LeetCode SQL 50, which makes the two plans a natural pair for data roles.

Below: the plan’s structure, a day-by-day map with the pandas concept each problem teaches, the traps that fail answers that look right, how to combine it with SQL 50, and what else data analyst, data scientist and data engineer interviews expect.

What is in 30 Days of Pandas

On the study plan page, LeetCode says the plan covers the essential topics often asked in pandas interviews, and that you should know basic Python (syntax, data types, conditionals, loops, functions, lists) before starting. The plan defaults to the Pandas language, and finishing it earns a badge. Here is how the 33 problems break down, as of October 2026:

SectionProblemsDifficultyCore pandas skills
Data Filtering44 EasyBoolean masks, isin, column selection
String Methods55 EasyThe .str accessor, regex matching
Data Manipulation64 Medium, 2 EasyNth-highest values, ranking, in-place deletes, melt
Statistics32 Easy (both Premium), 1 MediumCounting, percentages, binning
Data Aggregation77 Easygroupby, agg, nunique, value_counts
Data Integration54 Easy, 1 Mediummerge: left, cross, self and anti-joins
Bonus (“Strengthen Your Learning”)31 Easy, 2 Medium, all PremiumExtra practice after String Methods, Statistics and Data Integration

The 28 free problems all accept MySQL, MS SQL Server, PostgreSQL and Oracle as well as Pandas, so you can check a pandas answer against a SQL one. If pandas is brand new to you, LeetCode’s separate Introduction to Pandas plan is a gentler start: 15 Easy problems on creating DataFrames, selecting data, cleaning (duplicates, missing values, renaming, type changes), reshaping (concat, pivot, melt) and method chaining. LeetCode describes it as preparation for 30 Days of Pandas.

The day-by-day map

This follows LeetCode’s order, one core problem per day. The last column marks the 16 problems that also appear in SQL 50.

DayProblemLevelWhat it teachesIn SQL 50
1Big CountriesEasyBoolean masks with | and parentheses; selecting columnsYes
2Recyclable and Low Fat ProductsEasyCombining conditions with &Yes
3Customers Who Never OrderEasyAnti-join with ~isin()No
4Article Views IEasyComparing two columns, drop_duplicates, sorting, renamingYes
5Invalid TweetsEasy.str.len()Yes
6Calculate Special BonusEasyConditional column with np.where; .str.startswithNo
7Fix Names in a TableEasy.str.capitalize()Yes
8Find Users With Valid E-MailsEasy.str.match with an anchored regexYes
9Patients With a ConditionEasy.str.contains with a regex for a code at the start of any wordYes
10Nth Highest SalaryMediumDistinct values, sorting, returning null when there are fewer than NNo
11Second Highest SalaryMediumSame pattern; LeetCode asks for None in Pandas when there is no answerYes
12Department Highest SalaryMediummerge, then groupby().transform('max')No
13Rank ScoresMediumrank(method='dense', ascending=False)No
14Delete Duplicate EmailsEasyModifying the DataFrame in place, keeping the smallest idYes
15Rearrange Products TableEasymelt from wide to long, then dropnaNo
16The Number of Rich CustomersEasy (Premium)Statistics section; swap in a free problem if needed (see below)No
17Immediate Food Delivery IEasy (Premium)Statistics section; swap in a free problem if neededNo
18Count Salary CategoriesMediumBinning into three categories and keeping categories with zero accountsYes
19Find Total Time Spent by Each EmployeeEasyDerived column, groupby on two keys, sumNo
20Game Play Analysis IEasygroupby().min() on datesNo
21Number of Unique Subjects Taught by Each TeacherEasynuniqueYes
22Classes With at Least 5 StudentsEasyGroup counts, then a HAVING-style filterYes
23Customer Placing the Largest Number of OrdersEasyvalue_counts; the follow-up asks about tiesNo
24Group Sold Products By The DateEasyagg with nunique plus sorted, joined namesYes
25Daily Leads and PartnersEasyTwo keys, two distinct countsNo
26Actors and Directors Who Cooperated At Least Three TimesEasyGroup by a pair, filter on sizeNo
27Replace Employee ID With The Unique IdentifierEasyLeft merge; missing matches become nullYes
28Students and ExaminationsEasymerge(how='cross'), counts, fillna(0), two-key sortYes
29Managers with at Least 5 Direct ReportsMediumSelf-join: count reports, then map back to namesYes
30Sales PersonEasyThree-table merge and an anti-joinNo

The three bonus problems (Count Occurrences in Text after String Methods, Ads Performance after Statistics, and Accepted Candidates From the Interviews after Data Integration) are all Premium. We could not open their statements without a subscription, so we do not describe them here.

Tip: No Premium? Replace days 16 and 17 with three free SQL 50 problems that also accept Pandas and drill the same statistics skills: Percentage of Users Attended a Contest, Queries Quality and Percentage, and Immediate Food Delivery II. Whether LeetCode Premium is worth it for the rest is covered in is LeetCode Premium worth it.

The pandas concepts that matter most

Thirty problems sound like a lot, but they drill about six ideas. If you can write each of these from memory, most problems become a few lines.

Filtering with boolean masks

Days 1 to 4. Conditions combine with &, | and ~, never and or or, and each condition needs parentheses: world.loc[(world['area'] >= 3000000) | (world['population'] >= 25000000), ['name', 'population', 'area']]. Anti-joins (“customers who never order”) are ~customers['id'].isin(orders['customerId']).

String methods and regex

Days 5 to 9. The .str accessor gives you len, startswith, capitalize, match and contains. The email problem is the one to slow down on: the prefix must start with a letter, may contain letters, digits, underscore, period and dash, and the domain must be exactly @leetcode.com, so anchor the pattern and escape the dots.

Ranking and nth-highest values

Days 10 to 13. Drop duplicate salaries before sorting, handle “fewer than N values” explicitly, and know rank(method='dense'), which gives tied scores the same rank with no gaps, exactly what Rank Scores asks for.

Reshaping and in-place edits

Days 14 and 15. Delete Duplicate Emails tells Pandas users to modify the table in place, so sort by id and call drop_duplicates(subset='email', keep='first', inplace=True) rather than returning a new DataFrame. Rearrange Products Table is a textbook melt followed by dropna.

Group-by and aggregation

Days 18 to 26. The workhorse pattern is df.groupby(keys).agg(new_col=('col', 'func')).reset_index(). Named aggregation gives you the output column names the problem asks for in one step.

Merges

Days 27 to 30. Left merges keep unmatched rows as null, how='cross' builds every student and subject pair before counting, a self-merge links employees to managers, and Sales Person needs a three-table merge followed by an anti-join.

Traps that fail correct-looking answers

How it pairs with SQL 50

Sixteen problems sit in both plans, so the fastest route for a data role is to treat them as one set. Our LeetCode SQL 50 guide covers the SQL side; this table translates the core moves.

SQLpandas
WHEREBoolean mask or .query()
SELECT DISTINCTdrop_duplicates()
JOIN / LEFT JOINmerge(how='inner') / merge(how='left')
LEFT JOIN … WHERE b.id IS NULL~isin() or merge(indicator=True)
CROSS JOINmerge(how='cross')
GROUP BY … HAVINGgroupby().agg(), then filter
COUNT(DISTINCT x)nunique()
DENSE_RANK() OVER (…)rank(method='dense')
CASE WHENnp.where or np.select
UNION ALLpd.concat
ORDER BYsort_values()

A combined order that works: do SQL 50 first using the two-week plan in that guide, then run 30 Days of Pandas in about ten days. For the 16 shared problems, rewrite your SQL solution in pandas and compare. The 14 pandas-only core problems (Customers Who Never Order, Rank Scores, Rearrange Products Table, the salary ranking problems and the group-by sets) get your fresh attention. If your interviews are SQL-first, stop after SQL 50 plus the pandas-only problems.

Is it enough for data-role interviews?

It covers the core of a pandas manipulation round: filter, join, group and reshape a few small tables. It does not cover everything data interviews ask.

RoleHow much the plan coversWhat to add
Data analystMost of the pandas you needSQL 50, pivot_table, dates and time series, explaining results to non-technical stakeholders
Data scientistThe data-wrangling partStatistics, experiments and A/B testing, modeling questions, product sense
Data engineerBasic transformationsAdvanced SQL, data modeling, pipeline and system design, performance at scale
ML engineerFeature-prep basicsAlgorithms and data structures, ML theory, ML system design

Topics the plan skips that are worth an hour each: missing-data handling beyond fillna, pivot_table, resample and rolling for time series, and window-style operations with groupby().cumsum() and shift. Role-specific prep is on our data science interview help page and in the guides for data analysts and data scientists.

How to work each problem so it transfers

  1. Read the expected output first. Column names, ordering and null handling decide most failures.
  2. Write the SQL in your head, then the pandas. Thinking in joins and groups first keeps the pandas code short.
  3. Explain it out loud. In an interview you will be asked why merge beat a loop, or why dense ranking. Practice saying it in two sentences.
  4. Re-solve the Mediums from a blank editor a few days later, without looking at your old code.
  5. Practice under interview conditions. A free AI mock interview in CoPilot Interview builds coding and technical questions from your résumé and the job description, lets you pick Python as your coding language, and scores each answer out of 10 with what to fix and a model answer. Coding questions never auto-submit, so you can think in silence. The browser version also includes SQL and data science tracks.

For general Python and SQL round prep, see Python interview help and SQL interview help.

Explain your pandas solutions out loud

Paste a data role’s job description and your résumé, choose Python, and answer an AI interviewer’s technical and coding questions. Each answer gets a score out of 10, what to fix and a model answer. Free for 15 minutes a day, no credit card.

Try a free AI mock interview

FAQ

Is LeetCode 30 Days of Pandas free?

The study plan itself is free, but as of October 2026 LeetCode marks five of its 33 problems as Premium: two in the Statistics section and all three bonus questions. The other 28 are free, and free SQL 50 problems can stand in for the Premium ones.

How many problems are in 30 Days of Pandas?

There are 30 core problems in six sections plus three bonus questions, 33 in total. As of October 2026 the mix is 25 Easy and 8 Medium, with no Hard problems.

How long does 30 Days of Pandas take?

One problem a day takes a month. If you already know SQL or basic pandas, three problems a day gets you through in about ten days, with a review day for the Medium problems.

Should I do SQL 50 or 30 Days of Pandas first?

For most data roles, start with SQL 50, because SQL rounds are more common and 16 of the pandas problems repeat SQL 50 problems. Then do 30 Days of Pandas, rewriting your SQL answers in pandas for the shared problems.

What is the difference between Introduction to Pandas and 30 Days of Pandas?

Introduction to Pandas is a 15-problem beginner plan on creating, inspecting, cleaning and reshaping DataFrames. 30 Days of Pandas is the interview-style plan with filtering, string, ranking, aggregation and merge problems. LeetCode presents the first as preparation for the second.

Is 30 Days of Pandas enough for a data science interview?

It covers the data-manipulation part well, but data science loops usually add statistics, experiment design, modeling and product questions. Treat it as one piece of your prep, alongside SQL practice and mock interviews.