← All Python MCQ topics and your readiness dashboard
Test your Pandas and NumPy for Testers knowledge with a timed Python MCQ mock test for interviews. Each attempt gives you 20 random questions in 20 minutes from a 200-question bank covering NumPy arrays, shapes, slicing views, broadcasting, masks, aggregation by axis, NaN handling and float tolerance; pandas Series and DataFrames, loc and iloc, filtering, groupby, merge, concat, missing values, duplicates, string and date accessors, read_csv options and json_normalize, and data testing: reconciliation with outer merges, data contracts, assert_frame_equal, percentiles and flaky-test analysis. 49 questions are written from a QA and test-automation angle and the rest from a developer angle; your result shows both scores.
What this Python MCQ test covers
Revise these lessons from the free Python tutorial before or after your test:
Sample Python Pandas & NumPy questions with answers
- Q. Reconciling an export with the database. What does this code print?
import pandas as pd
db = pd.DataFrame({"id": [1, 2, 3], "total": [100, 250, 80]})
export = pd.DataFrame({"id": [1, 2, 4], "total": [100, 260, 50]})
m = db.merge(export, on="id", how="outer", suffixes=("_db", "_csv"), indicator=True)
missing = m[m["_merge"] == "left_only"]["id"].tolist()
extra = m[m["_merge"] == "right_only"]["id"].tolist()
diff = m[(m["_merge"] == "both") & (m["total_db"] != m["total_csv"])]["id"].tolist()
print(missing, extra, diff)
Answer:[3] [4] [2]
An outer merge with an indicator finds missing, extra and changed rows in one go. - Q. Checking a data contract on an API response. What does this code print?
import pandas as pd
rows = [{"id": 1, "email": "a@x.dev", "age": 30}, {"id": 2, "email": "bad", "age": -1}, {"id": 2, "email": "c@y.io", "age": 40}]
df = pd.DataFrame(rows)
problems = {
"duplicate ids": int(df["id"].duplicated().sum()),
"bad emails": int((~df["email"].str.contains("@")).sum()),
"negative ages": int((df["age"] < 0).sum()),
}
print(problems)
Answer:{'duplicate ids': 1, 'bad emails': 1, 'negative ages': 1}
Vectorised checks validate every row at once and count each kind of problem. - Q. Summarising test results from a CSV report. What does this code print?
import pandas as pd, io
csv = "test,status,secs\nlogin,passed,1.2\ncart,failed,3.5\npay,passed,2.1\nsearch,skipped,0\n"
df = pd.read_csv(io.StringIO(csv))
print(df["status"].value_counts()["passed"], round(df.loc[df.status == "passed", "secs"].sum(), 1), df.loc[df["secs"].idxmax(), "test"])
Answer:2 3.3 cart
value_counts, boolean filters and idxmax answer typical report questions quickly. - Q. What does this code print?
import numpy as np
a = np.array([1, 2, 3])
print(a * 2, a.sum())
Answer:[2 4 6] 6
NumPy arrays apply arithmetic element-wise (vectorised). - Q. What does this code print?
print([1, 2, 3] * 2)
Answer:[1, 2, 3, 1, 2, 3]
A Python list repeats; a NumPy array would multiply each element. - Q. What does this code print?
import numpy as np
a = np.array([[1, 2, 3], [4, 5, 6]])
print(a.shape, a.ndim, a.size)
Answer:(2, 3) 2 6
shape is (rows, columns); ndim is the number of dimensions; size the element count.
Every predict-the-output question in this bank was run on Python 3, so the answer is the real output. Go back to the Python MCQ dashboard to see your overall Python learning progress and interview readiness.
Frequently asked questions
How many questions does the Python Pandas & NumPy MCQ test have?
The bank has 200 questions. Each test picks 20 at random, favouring questions you have not seen yet, so about 10 attempts cover the whole bank.
How long is each test and what is the pass mark?
Each test has a 20-minute timer and submits itself when time runs out. You pass with 70%, which is 14 of 20 correct.
Is this test useful for QA and automation engineer interviews?
Yes. 49 of the questions use test-automation scenarios such as parsing UI text, test data and assertions, and your result shows your QA score separately.
Can I retake the test?
Yes, as often as you like. Every retake draws a fresh set of 20 questions and counts toward your 20-test readiness target.