Scikit Learn, Pandas, and NumPy Usage Questions
Practical proficiency with these core libraries. Pandas: DataFrames, data manipulation, handling missing values. NumPy: arrays, vectorized operations, mathematical functions. Scikit-learn: preprocessing, model fitting, evaluation metrics, pipelines. Knowing standard patterns and APIs. Writing efficient, readable code using these libraries.
MediumTechnical
59 practiced
Using NumPy, implement an efficient method to compute pairwise squared Euclidean distances between two arrays A (shape 10000x128) and B (shape 500x128) without explicit Python loops. Provide code and explain memory and computational complexity; suggest batching if necessary.
EasyTechnical
66 practiced
Given a transactions DataFrame with columns ['user_id', 'transaction_id', 'amount', 'transaction_date'], write pandas code to compute for each user:- total_amount- transaction_count- average_amount- most_recent_transaction_dateReturn a DataFrame indexed by user_id with these columns. Provide an explanation of any aggregation choices.
MediumTechnical
69 practiced
You join sales and customers tables and find inconsistent timestamps and duplicated customer IDs across sources. Outline a step-by-step data-cleaning plan using pandas to deduplicate records and reconcile timestamps, including code snippets for deduplication criteria and timestamp alignment. Consider business keys and auditability.
MediumTechnical
53 practiced
You must process a 50GB CSV file that won't fit into memory. Describe with code how you'd use pandas.read_csv with chunksize to compute per-user total transaction amount, returning the final aggregated Series or DataFrame. Explain how to combine chunk results efficiently.
MediumTechnical
67 practiced
Discuss trade-offs between one-hot encoding and target encoding for a categorical feature with high cardinality (~10,000 categories). In what situations is target encoding appropriate? How do you avoid target leakage when applying target encoding in cross-validation or production?
Unlock Full Question Bank
Get access to hundreds of Scikit Learn, Pandas, and NumPy Usage interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.