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.
HardTechnical
111 practiced
You have a long-running pandas preprocessing step that's the bottleneck in a pipeline. Explain how you would profile the code to find hotspots (CPU and memory), and give concrete optimizations such as using vectorized operations, replacing apply with Cython/numba, or using chunked processing with generators. Mention tools like %timeit, line_profiler, and memory_profiler.
HardTechnical
65 practiced
Explain how feature selection inside cross-validation can leak information if done incorrectly. Show how to use sklearn Pipeline to include feature selection (e.g., SelectKBest or a model-based selector) safely inside cross-validation so the selection is performed within each fold only.
MediumTechnical
64 practiced
Describe how to use sklearn.feature_extraction.text.HashingVectorizer vs TfidfVectorizer. Explain trade-offs with respect to memory, collision risk, ability to inverse-transform, and suitability for production pipelines that need to remain constant between train and inference.
HardTechnical
66 practiced
Demonstrate how to use NumPy advanced indexing and broadcasting to normalize rows of a 2D array so each row has zero mean and unit variance (per-row standardization), without using explicit Python loops. Show code and explain in-place vs. copy behavior and memory implications.
HardTechnical
62 practiced
Describe practical approaches to time-series cross-validation using pandas and scikit-learn. Explain TimeSeriesSplit behavior, how to include expanding windows or rolling windows, and how to incorporate feature engineering steps (lag features) without leaking future information.
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.