Tip 1 : Read basic theory of Machine learning
Tip 2 : Do at least 1 good project on ML
Tip 3 : Practice ML libraries like pandas, numpy etc
Tip 1 : Have at least one good project related to ML on your resume.
Tip 2 : Keep the technical skills highlighted.
No, it was not late at night. It started at 7 pm and lasted till 8 pm.
The test had separate times for separate questions.



Stepwise solution of the problem:
1. Define a function named is_prime that takes an integer n as input.
2. Check if the input number n is less than or equal to 1. If it is, return False since 1 and all non-positive integers are not prime.
3. Use a loop that iterates from 2 to the square root of n. To optimize the loop, you can iterate up to the integer value of the square root of n (rounded down).
4. For each iteration, check if n is divisible by the current I value (i.e. if n % i == 0). If it is, return False, which means n is not prime.
5. If the loop completes without finding any divisors for n, return True, indicating that n is a prime number.
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n - 1)
a) Calculates the factorial of a given number
b) Calculates the sum of all numbers up to a given number
c) Checks if a number is a prime number
d) Calculates the average of a list of numbers
Ans:- Calculates the factorial of a given number
In data science, what does the term "feature" refer to?
a) The outcome or target variable in a dataset
b) The primary axis in data visualization
c) The characteristics or variables used for modeling
d) The quality of data accuracy and completeness
Answer: c) The characteristics or variables used for modeling
Which algorithm is commonly used for outlier detection?
a) k-Nearest Neighbors (k-NN)
b) Support Vector Machine (SVM)
c) Random Forest
d) Isolation Forest
Answer: d) Isolation Forest
Question: You are building a decision tree classifier with a maximum depth of 4. How many leaves will the decision tree have?
Answer: The number of leaves in a decision tree depends on the complexity of the data and the splitting criteria. However, in this case, with a maximum depth of 4, the decision tree will have 2^4 = 16 leaves, assuming that all possible splits are utilized to the maximum depth.
You have a regression model with the following coefficients: β₀ = 2.5, β₁ = 1.8, and β₂ = -0.3. What would be the predicted output (ŷ) for an input with x₁ = 5.2 and x₂ = 3.0?
The predicted output (ŷ) can be calculated using the formula: ŷ = β₀ + β₁ * x₁ + β₂ * x₂
Substituting the values: ŷ = 2.5 + 1.8 * 5.2 + (-0.3) * 3.0
ŷ = 2.5 + 9.36 - 0.9
ŷ = 10.96
Which data structure uses the Last In First Out (LIFO) principle?
a) Queue
b) Stack
c) Linked List
d) Hash Table
Answer: b) Stack
What is the time complexity of inserting an element at the end of an array with n elements?
a) O(1)
b) O(n)
c) O(log n)
d) O(n^2)
Answer: a) O(1)
The time complexity of a binary search algorithm is:
a) O(1)
b) O(log n)
c) O(n)
d) O(n^2)
Answer: b) O(log n)
Which OOP principle ensures that an object's internal representation and behavior are hidden from the outside world?
a) Abstraction
b) Encapsulation
c) Polymorphism
d) Inheritance
Answer: b) Encapsulation
What is a class in OOPs?
a) A template that defines the structure and behavior of objects
b) A specific instance of an object
c) A function defined inside a class
d) A data structure that holds only primitive data types
Answer: a) A template that defines the structure and behavior of objects
In OOPs, what is the process of creating an object from a class called?
a) Abstraction
b) Encapsulation
c) Polymorphism
d) Instantiation
Answer: d) Instantiation
What is the purpose of using the if __name__ == "__main__": block in a Python script?
a) It is a special block that allows the script to be executed from the command line.
b) It is used to define the main function of the script.
c) It ensures that the script's code inside the block is only executed when the script is run directly, not when it is imported as a module in another script.
d) It is a requirement for all Python scripts to have this block for proper execution.
The correct answer is c) It ensures that the script's code inside the block is only executed when the script is run directly, not when it is imported as a module in another script.
What is the primary goal of data preprocessing in data science?
a) To collect data from various sources
b) To transform raw data into a structured format
c) To build machine learning models
d) To visualize data
Ans:- To transform raw data into a structured format
Which of the following is an example of supervised learning?
a) Clustering
b) Regression
c) Association rule mining
d) Principal Component Analysis (PCA)
Ans:- Regression
Interview timing was okay
Environment was good. There were 2 interviewer. Interviewer was helping in nature.
Write code to implement linear regression from scratch or use libraries like NumPy and sci-kit-learn to fit a line to a given dataset. (Learn)
Import Libraries: Import the necessary libraries, such as NumPy and scikit-learn, to use their functionalities for linear regression.
Prepare Data: Prepare your dataset with input features X and target variable y. Ensure that the data is in a suitable format for the chosen library.
Define Model: Choose whether you want to implement linear regression from scratch using NumPy or use scikit-learn's built-in Linear Regression model.
Fit the Model: For both approaches, fit the model to the data by calling the fit() method of the chosen model with the input features X and target variable y.
Get Coefficients: After fitting the model, you can access the coefficients (intercept and slope) of the fitted line. In NumPy, these coefficients are obtained through mathematical calculations, while in scikit-learn, you can retrieve them from the intercept_ and coef_ attributes of the fitted model.
Make Predictions: With the fitted model, you can use it to make predictions on new data or evaluate its performance on the training data.
Visualize Results: Optionally, you can visualize the data points and the fitted line to understand the quality of the linear regression model's fit.
Implement Principal Component Analysis (PCA) to reduce the dimensionality of a dataset while preserving its essential features. (Learn)
Import Libraries: Import the necessary libraries, such as NumPy and scikit-learn, to use their functionalities for PCA and data manipulation.
Prepare Data: Load or create the dataset that you want to apply PCA to. Ensure that the data is organized with rows representing samples and columns representing features.
Standardize Data: If necessary, standardize the data by subtracting the mean and dividing by the standard deviation for each feature. Standardization is essential when features are on different scales to ensure a fair contribution of all features during PCA.
Compute Covariance Matrix: Calculate the covariance matrix of the standardized data. The covariance matrix represents the relationships between different features and serves as the basis for PCA.
Compute Eigenvectors and Eigenvalues: Find the eigenvectors and eigenvalues of the covariance matrix. Eigenvectors represent the principal components, and eigenvalues represent the variance explained by each principal component.
Select Principal Components: Decide on the number of principal components to retain. Usually, you choose the top 'k' principal components that explain most of the variance (e.g., 95% or 99%).
Project Data onto New Space: Project the original data onto the new space spanned by the selected principal components. This reduces the dimensionality of the data while preserving its important features.
Inverse Transform (Optional): If necessary, you can also perform an inverse transform to obtain the reconstructed data in the original feature space. This allows you to understand how the data looks after dimensionality reduction.
Analyze Results: Evaluate the results, check the variance explained by the selected principal components, and understand how the data is distributed in the reduced space.
Timing was a little late night.
Environment was okay.
Interview panel had 2 people. Among them one was HR and other was Manager. They were good.
What are the projects that you have done?
Tip 1: Explain your projects clearly
Tip 2: Keep the interviewer involved in your explanations
Tip 3: Be confident and don't fake while explaining your skillset.
How do you handle working in a team?
Tip 1 : Highlight your experience of collaborating in a team, emphasizing your ability to communicate effectively, listen to others' perspectives, and contribute to achieving team goals.
My Answer - I had worked in college fests with multiple teams. I had lead a team of 50 people being the sponsorship head of technical fest of IIT Mandi.
What are your strengths and weaknesses?
Tip 1 : Discuss a couple of your strengths that are relevant to the job, such as problem-solving or leadership. When discussing weaknesses, focus on areas where you have made improvements and demonstrate a willingness to learn and grow
Describe a challenging situation you faced at work and how you resolved it.
Tip 1 : Share a work-related challenge, explain the steps you took to address it, and emphasize the positive outcome. Showcase your problem-solving skills and ability to remain composed in difficult situations.
Tell me about yourself.
Tip 1 : Start by providing a brief overview of your background, education, and work experience. Highlight your key skills and achievements relevant to the job you are interviewing for. Keep it concise and focus on your professional attributes.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?