Machine Learning Engineer

20+ Machine Learning Engineer Interview Questions and Answers for Freshers

Updated 13 Jul 2025
search-icon
1d ago

Q. Find Permutation Problem Statement

Given an integer N, determine an array of size 2 * N that satisfies the following conditions:

  1. Each number from 1 to N appears exactly twice in the array.
  2. The distance between...read more
Ans.

The task is to find a permutation array of size 2*N with specific conditions.

  • Create an array of size 2*N to store the permutation.

  • Ensure each number from 1 to N appears exactly twice in the array.

  • Check that the distance between the second and first occurrence of each number is equal to the number itself.

  • Return the array if conditions are met, else return an empty array.

1d ago

Q. Maximum Number by One Swap

You are provided with an array of N integers representing the digits of a number. You are allowed to perform an operation where you can swap the values at two different indices to for...read more

Ans.

Given an array of integers representing digits of a number, swap two values to form the maximum possible number.

  • Iterate through the array to find the maximum digit.

  • Swap the maximum digit with the first digit if it is not already at the first position.

  • Handle cases where there are multiple occurrences of the maximum digit.

Asked in Paytm

1d ago

Q. Subset Sum Equal To K Problem Statement

Given an array/list of positive integers and an integer K, determine if there exists a subset whose sum equals K.

Provide true if such a subset exists, otherwise return f...read more

Ans.

Given an array of positive integers and an integer K, determine if there exists a subset whose sum equals K.

  • Use dynamic programming to solve this problem efficiently

  • Create a 2D array to store if a subset sum is possible for each element and target sum

  • Iterate through the array and update the 2D array based on current element and target sum

  • Check if the last element of the 2D array is true for the given target sum

Asked in Amazon

6d ago

Q. Paths in a Matrix Problem Statement

Given an 'M x N' matrix, print all the possible paths from the top-left corner to the bottom-right corner. You can only move either right (from (i,j) to (i,j+1)) or down (fro...read more

Ans.

Find all possible paths from top-left to bottom-right in a matrix by moving only right or down.

  • Use backtracking to explore all possible paths from top-left to bottom-right in the matrix

  • At each cell, recursively explore moving right and down until reaching the bottom-right corner

  • Keep track of the current path and add it to the result when reaching the destination

Are these interview questions helpful?

Q. What are the different types of learning?

Ans.

Different types of learning include supervised learning, unsupervised learning, semi-supervised learning, reinforcement learning, and transfer learning.

  • Supervised learning: Training a model using labeled data to make predictions or classifications.

  • Unsupervised learning: Training a model on unlabeled data to discover patterns or relationships.

  • Semi-supervised learning: Combining labeled and unlabeled data for training.

  • Reinforcement learning: Training a model to make decisions b...read more

Q. What are the different ML algorithms?

Ans.

ML algorithms are techniques used to train models to make predictions or decisions based on data.

  • Supervised learning algorithms: Linear regression, logistic regression, decision trees, random forests, support vector machines, k-nearest neighbors

  • Unsupervised learning algorithms: K-means clustering, hierarchical clustering, principal component analysis

  • Reinforcement learning algorithms: Q-learning, SARSA

  • Deep learning algorithms: Convolutional neural networks, recurrent neural ne...read more

Machine Learning Engineer Jobs

Red Hat India Pvt Ltd logo
Senior / Principal Machine Learning Engineer, Pytorch Engineering 7-12 years
Red Hat India Pvt Ltd
4.3
Bangalore / Bengaluru
Apple India Pvt Ltd logo
Machine Learning Engineer, Search & AI 7-12 years
Apple India Pvt Ltd
4.3
Bangalore / Bengaluru
Infosys Limited logo
Python Machine learning Engineer 3-5 years
Infosys Limited
3.6
₹ 5 L/yr - ₹ 15 L/yr
(AmbitionBox estimate)
Bangalore / Bengaluru

Asked in Fynd

6d ago

Q. Write a code for pre processing the image data before feeding it to model. The image ratios should be maintained. And the basics of django, like how to register more than one model in django.

Ans.

Preprocess image data while maintaining ratios and register multiple models in Django.

  • Resize images while maintaining aspect ratio using libraries like PIL or OpenCV

  • Normalize pixel values to a range of 0-1 for better model performance

  • Augment data using techniques like rotation, flipping, or cropping to increase dataset size

  • Use data generators in Keras to efficiently load and preprocess images in batches

  • Register multiple models in Django by creating separate model classes in m...read more

6d ago

Q. What are the basic Python fundamentals for creating a DataFrame using the Iris dataset and how can I extract common X and Y columns for visualizations?

Ans.

Creating a DataFrame from the Iris dataset and extracting columns for visualization.

  • Import necessary libraries: `import pandas as pd` and `import seaborn as sns`.

  • Load the Iris dataset: `iris = sns.load_dataset('iris')`.

  • Create a DataFrame: `df = pd.DataFrame(iris)`.

  • Extract common X and Y columns for visualization: `X = df[['sepal_length', 'sepal_width']]` and `Y = df['species']`.

  • Use visualization libraries like Matplotlib or Seaborn to plot: `sns.scatterplot(x='sepal_length', ...read more

Share interview questions and help millions of jobseekers 🌟

man-with-laptop
3d ago

Q. What are the evaluation metrics commonly used for machine learning models, and how can they be implemented in Python code?

Ans.

Common evaluation metrics for ML models include accuracy, precision, recall, F1-score, and AUC-ROC, implemented using libraries like scikit-learn.

  • Accuracy: Measures the proportion of correct predictions. Example: accuracy_score(y_true, y_pred).

  • Precision: Indicates the accuracy of positive predictions. Example: precision_score(y_true, y_pred).

  • Recall: Measures the ability to find all relevant instances. Example: recall_score(y_true, y_pred).

  • F1-Score: Harmonic mean of precision ...read more

4d ago

Q. How would you detect and identify what's written on a doctor's prescription, given some initial letters, and predict what medicine it will be?

Ans.

Use natural language processing techniques to detect and identify medicines on a doctor's prescription.

  • Preprocess the text by removing noise and irrelevant information.

  • Tokenize the text to break it down into individual words or characters.

  • Use a language model or dictionary to match the tokens with known medicines.

  • Apply machine learning algorithms like NER (Named Entity Recognition) to identify medicine names.

  • Consider context and surrounding words to improve accuracy of predic...read more

Q. What is Naive Bayes in ML?

Ans.

Naive Bayes is a probabilistic algorithm that uses Bayes' theorem to classify data based on prior knowledge.

  • Naive Bayes assumes that all features are independent of each other.

  • It is commonly used for text classification and spam filtering.

  • There are three types of Naive Bayes classifiers: Gaussian, Multinomial, and Bernoulli.

  • It is a fast and simple algorithm that works well with high-dimensional datasets.

  • Naive Bayes can handle missing data and is not affected by irrelevant fea...read more

Asked in Typeface

4d ago

Q. Describe the architecture you designed for your project, outlining your key assumptions.

Ans.

Designing a machine learning architecture for a predictive maintenance project in manufacturing.

  • Data Collection: Use IoT sensors to gather real-time data from machinery.

  • Data Preprocessing: Clean and normalize data to handle missing values and outliers.

  • Feature Engineering: Extract relevant features like temperature, vibration, and operational hours.

  • Model Selection: Choose algorithms like Random Forest or LSTM for time-series predictions.

  • Model Training: Split data into training...read more

3d ago

Q. How many tennis balls can you fit in a plane?

Ans.

The answer depends on the size of the plane and the size of the tennis balls.

  • The size of the plane and the size of the tennis balls are important factors to consider.

  • The packing method used to fit the tennis balls in the plane also matters.

  • Assuming a standard commercial plane and tennis ball size, approximately 50,000 tennis balls can fit in the plane.

Asked in Ishango.ai

2d ago

Q. What is Regression?

Ans.

Regression is a statistical method used to analyze the relationship between a dependent variable and one or more independent variables.

  • Regression is used to predict continuous numerical values.

  • It helps in identifying the strength and direction of the relationship between variables.

  • Linear regression is a common type of regression used to model the relationship between two variables.

  • Examples of regression include predicting housing prices based on square footage and predicting ...read more

5d ago

Q. How would you approach sound classification?

Ans.

Sound classification can be done using machine learning algorithms to analyze audio data and classify it into different categories.

  • Preprocess the audio data by extracting relevant features such as MFCCs, spectrograms, or mel spectrograms.

  • Split the data into training and testing sets to train the machine learning model.

  • Choose a suitable classification algorithm such as SVM, Random Forest, or CNN for audio data.

  • Train the model on the training data and evaluate its performance o...read more

Q. What are L1 and L2 regularizations?

Ans.

L1 and L2 regularizations are techniques to prevent overfitting in machine learning models by adding penalties to the loss function.

  • L1 regularization (Lasso) adds the absolute value of coefficients to the loss function, promoting sparsity.

  • L2 regularization (Ridge) adds the squared value of coefficients, which discourages large weights but retains all features.

  • L1 can lead to feature selection by driving some coefficients to zero, while L2 tends to distribute weights more evenl...read more

Asked in Capgemini

4d ago

Q. What is overfitting and underfitting?

Ans.

Overfitting occurs when a model learns the training data too well, leading to poor generalization. Underfitting happens when a model is too simple to capture the underlying patterns.

  • Overfitting: Model performs well on training data but poorly on unseen data. Can be caused by a model being too complex or training for too long.

  • Underfitting: Model is too simple to capture the underlying patterns in the data. Results in poor performance on both training and unseen data.

  • Examples: ...read more

6d ago

Q. What is the accuracy paradox?

Ans.

Accuracy paradox is a phenomenon where high accuracy can be achieved even with a flawed model.

  • Accuracy paradox occurs when the accuracy of a model is high but the model is flawed.

  • It happens when the dataset is imbalanced and the model predicts the majority class accurately while ignoring the minority class.

  • For example, a model predicting that all patients are healthy when only 5% of them are sick can have high accuracy but is not useful in practice.

Q. OOPs, 4 pillars of OOPs

Ans.

OOPs stands for Object-Oriented Programming and its 4 pillars are Inheritance, Encapsulation, Abstraction, and Polymorphism.

  • Inheritance allows a class to inherit properties and behavior from another class.

  • Encapsulation restricts access to certain components of an object, protecting its integrity.

  • Abstraction hides complex implementation details and only shows the necessary features.

  • Polymorphism allows objects to be treated as instances of their parent class, enabling flexibili...read more

Q. Explain Gradient Descent.

Ans.

Gradient descent is an optimization algorithm used to minimize a function by iteratively moving towards the steepest descent.

  • Gradient descent updates parameters in the opposite direction of the gradient of the loss function.

  • The learning rate determines the size of the steps taken towards the minimum.

  • There are different variants: Batch Gradient Descent, Stochastic Gradient Descent (SGD), and Mini-batch Gradient Descent.

  • Example: In linear regression, gradient descent helps find...read more

Interview Experiences of Popular Companies

TCS Logo
3.6
 • 11.1k Interviews
Accenture Logo
3.7
 • 8.7k Interviews
Wipro Logo
3.7
 • 6.1k Interviews
Google Logo
4.4
 • 899 Interviews
Tiger Analytics Logo
3.7
 • 232 Interviews
View all
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
Machine Learning Engineer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits