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.

HardTechnical
0 practiced
Implement the Adam optimizer update step in NumPy for parameters represented as arrays. Given gradients `g`, previous first and second moment estimates `m` and `v`, implement updates for `m`, `v`, compute bias-corrected estimates, and return the parameter delta for a given learning rate and eps. Explain impact of beta1/beta2 on convergence.
MediumTechnical
0 practiced
Given a pandas `merge` that is unexpectedly slow, outline a step-by-step debugging checklist to speed it up: inspect dtypes, index usage, join keys cardinality, sorting, and alternatives such as using database joins or category encoding. Include practical code snippets to implement fixes.
EasyTechnical
0 practiced
Given a pandas DataFrame sample below, write code to impute missing values: numeric columns with median grouped by `category`, categorical columns with a new category 'missing', and timestamp columns with forward fill within each `user_id`.
Sample schema: user_id, category, numeric1, cat1, event_timeExplain assumptions and edge cases you handle.
EasyTechnical
0 practiced
Given a pandas DataFrame `df` with columns ['user_id','event','value'], write code to compute for each user the average `value` per event type and return a pivoted DataFrame where rows are user_id and columns are event types. Include handling for missing event types and show example input and output behavior.
EasyTechnical
0 practiced
Describe steps you would take to ensure reproducible experiments in Python and ML libraries. Include how to set seeds for `random`, `numpy`, `tensorflow`, `torch`, and what additional environmental factors to control (CUDA/CuDNN nondeterminism, versions, hardware).

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.