InterviewStack.io LogoInterviewStack.io

Python Programming & ML Libraries Questions

Python programming language fundamentals (syntax, data structures, control flow, error handling) with practical usage of machine learning libraries such as NumPy, pandas, scikit-learn, TensorFlow, and PyTorch for data manipulation, model development, training, evaluation, and lightweight ML tasks.

MediumTechnical
0 practiced
Describe grid search vs randomized search for hyperparameter tuning. Provide a short code example using `RandomizedSearchCV` with a custom scorer and explain when randomized search is more efficient than exhaustive grid search.
EasyTechnical
0 practiced
Explain differences in Python between list, tuple, set, and dict in terms of mutability, typical use cases, and average time complexity for membership test, insertion, and deletion. For each type give a one-sentence example where a data scientist would prefer it during preprocessing or feature engineering.
MediumTechnical
0 practiced
Implement gradient accumulation in a PyTorch training loop to emulate a larger effective batch size when GPU memory is limited. Provide code showing accumulation steps, optimizer.step(), and proper zeroing of gradients. Explain when gradient accumulation interacts poorly with BatchNorm.
MediumTechnical
0 practiced
Design an approach to train a scikit-learn model incrementally on a very large CSV that doesn't fit in memory by reading the file in chunks and using `partial_fit` or online algorithms. Outline code structure, checkpointing, and how you'd validate on a holdout set.
HardTechnical
0 practiced
Implement a simple data loader in PyTorch `Dataset`/`DataLoader` that reads from multiple CSV files lazily, parses and tokenizes text columns, and batches examples. Make sure it supports shuffling and deterministic behavior when given a seed.

Unlock Full Question Bank

Get access to hundreds of Python Programming & ML Libraries interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.