0% found this document useful (0 votes)
27 views

MCQ Interview Questions

Uploaded by

ShuBh Rj
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

MCQ Interview Questions

Uploaded by

ShuBh Rj
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Screening Questions

Question 1:
Which of the following is NOT a common step in the data science process?
A. Data Collection
B. Data Cleaning
C. Model Deployment
D. User Interface Design
Answer: D. User Interface Design

Question 2:
What is the purpose of a for loop in programming?
A. To define a variable
B. To repeat a block of code multiple times
C. To check conditions continuously
D. To call a function
Answer: B. To repeat a block of code multiple times

Question 3:
Which of the following is a type of supervised learning in data science?
A. K-Means Clustering
B. Principal Component Analysis (PCA)
C. Linear Regression
D. Apriori Algorithm
Answer: C. Linear Regression

Question 4:
In Python, which data structure allows you to store a collection of unique
elements?
A. List
B. Tuple
C. Set
D. Dictionary
Answer: C. Set

Question 5:
What does CSV stand for in data management?
A. Column Separated Values
B. Character Separated Values
C. Comma Separated Values
D. Code Separated Variables
Answer: C. Comma Separated Values

Question 6:
Which of the following is used to handle missing values in a dataset?
A. Deleting rows with missing data
B. Replacing missing values with the mean
C. Predicting missing values using a model
D. All of the above
Answer: D. All of the above

Question 7:
What is the output of the following Python code?
print(2**3)
A. 6
B. 8
C. 9
D. 16
Answer: B. 8

Question 8:
Which of the following is a measure of how well a regression model fits the
data?
A. R-squared
B. Mean Absolute Error
C. Cross Entropy
D. AUC-ROC
Answer: A. R-squared

Question 9:
Which of the following is an example of an unsupervised learning algorithm?
A. Decision Trees
B. Random Forest
C. K-Means Clustering
D. Support Vector Machines
Answer: C. K-Means Clustering

Question 10:
In which programming language is numpy a common library for numerical
computations?
A. R
B. Python
C. Java
D. C++
Answer: B. Python

Question 11:
Which of the following correctly describes a key difference between
classification and regression?
A. Classification is used for predicting continuous values, while regression is for
categorical labels.
B. Classification predicts discrete labels, while regression predicts continuous
values.
C. Both classification and regression predict continuous values.
D. Both classification and regression predict discrete labels.
Answer: B. Classification predicts discrete labels, while regression predicts
continuous values.

Question 12:
Which of the following libraries is commonly used for data visualization in
Python?
A. Pandas
B. TensorFlow
C. Matplotlib
D. Scikit-learn
Answer: C. Matplotlib

Question 13:
What does SQL stand for?
A. Structured Query Language
B. Simple Query Logic
C. Stored Query List
D. Standard Query Language
Answer: A. Structured Query Language

Question 14:
What is the time complexity of accessing an element in a Python dictionary?
A. O(1)
B. O(n)
C. O(log n)
D. O(n^2)
Answer: A. O(1)
Question 15:
Which of the following statements about machine learning models is true?
A. Overfitting occurs when a model performs well on training data but poorly
on unseen data.
B. Overfitting occurs when a model performs poorly on training data and well
on unseen data.
C. Underfitting occurs when the model performs too well on both training and
testing data.
D. Underfitting means the model is too complex for the given data.
Answer: A. Overfitting occurs when a model performs well on training data but
poorly on unseen data.

Question 16:
Which of the following commands is used to create a new Git repository?
A. git commit
B. git init
C. git merge
D. git push
Answer: B. git init

Question 17:
Which of the following is NOT a popular data format for storing structured
data?
A. JSON
B. XML
C. CSV
D. JPEG
Answer: D. JPEG

Question 18:
Which Python library is commonly used for machine learning?
A. Matplotlib
B. Numpy
C. Pandas
D. Scikit-learn
Answer: D. Scikit-learn

Question 19:
What is the main purpose of exploratory data analysis (EDA)?
A. To apply machine learning algorithms to the data
B. To clean the data for modeling
C. To summarize the main characteristics of the data
D. To deploy the model in production
Answer: C. To summarize the main characteristics of the data

Question 20:
Which of the following tools is commonly used for version control in software
development?
A. Jupyter
B. Git
C. MySQL
D. Hadoop
Answer: B. Git

L1 Questions
Question 1:
What is the time complexity of searching an element in a sorted array using
binary search?
A. O(n)
B. O(n log n)
C. O(log n)
D. O(1)
Answer: C. O(log n)

Question 2:
Which of the following is an example of a dynamic data structure?
A. Array
B. Linked List
C. Stack
D. Queue
Answer: B. Linked List

Question 3:
In Python, which of the following is used to define a function?
A. def
B. func
C. lambda
D. var
Answer: A. def

Question 4:
What is the output of the following code in C++?
int a = 5;
int b = ++a;
cout << b;
A. 4
B. 5
C. 6
D. 7
Answer: C. 6

Question 5:
Which of the following is true about a stack data structure?
A. It follows FIFO (First In First Out).
B. It follows LIFO (Last In First Out).
C. It stores elements in a random order.
D. It doesn't allow duplicate values.
Answer: B. It follows LIFO (Last In First Out).

Question 6:
What is the main purpose of the git pull command?
A. To create a new branch
B. To fetch and merge changes from a remote repository
C. To push local commits to a remote repository
D. To initialize a Git repository
Answer: B. To fetch and merge changes from a remote repository

Question 7:
Which data structure is used to implement recursion in most programming
languages?
A. Queue
B. Stack
C. Array
D. Linked List
Answer: B. Stack

Question 8:
What is the output of the following Python code?
x = [1, 2, 3, 4]
print(x[1:3])
A. [1, 2]
B. [2, 3]
C. [3, 4]
D. [1, 2, 3]
Answer: B. [2, 3]

Question 9:
Which of the following sorting algorithms has the best average-case time
complexity?
A. Bubble Sort
B. Quick Sort
C. Selection Sort
D. Insertion Sort
Answer: B. Quick Sort

Question 10:
In object-oriented programming, what is a constructor?
A. A special function used to initialize objects
B. A function that deletes objects
C. A function that returns the object
D. A data member of the class
Answer: A. A special function used to initialize objects

Question 11:
What does SQL’s JOIN operation do?
A. Combines two or more tables based on a related column
B. Deletes data from a table
C. Updates data in a table
D. Sorts data in ascending order
Answer: A. Combines two or more tables based on a related column

Question 12:
Which of the following is used for memory management in Python?
A. Garbage collection
B. Pointer allocation
C. Reference counting
D. Both A and C
Answer: D. Both A and C
Question 13:
Which of the following best describes an API (Application Programming
Interface)?
A. A software intermediary that allows two applications to talk to each other
B. A storage location in the cloud
C. A user interface for a web application
D. A coding language used to design websites
Answer: A. A software intermediary that allows two applications to talk to each
other

Question 14:
In Java, which of the following is the correct way to declare a variable?
A. int 1number;
B. int num1;
C. integer num;
D. num int;
Answer: B. int num1;

Question 15:
Which data structure is used to model a hierarchical relationship between
elements?
A. Graph
B. Tree
C. Stack
D. Queue
Answer: B. Tree

Question 16:
In Big O notation, what is the time complexity of inserting an element into a
max heap?
A. O(1)
B. O(log n)
C. O(n)
D. O(n log n)
Answer: B. O(log n)

Question 17:
Which of the following correctly defines a class in Python?
A.class Person:
pass
B.define Person():
pass
C.Person class:
pass
D.class Person = pass

Answer: A.class Person:


pass

Question 18:
In which type of database is data stored in tables made up of rows and
columns?
A. NoSQL
B. Relational Database
C. Document-based Database
D. Key-Value Store
Answer: B. Relational Database

Question 19:
Which of the following statements is true about recursion?
A. A recursive function must always call itself exactly once.
B. A recursive function must always have a base case.
C. Recursion always leads to infinite loops.
D. Recursion is less efficient than iteration in every case.
Answer: B. A recursive function must always have a base case.

Question 20:
Which of the following is an immutable data type in Python?
A. List
B. Set
C. Dictionary
D. Tuple
Answer: D. Tuple

L2 Questions

Question 1:
In object-oriented programming, what is "polymorphism"?
A. The ability to define multiple methods with the same name but different
signatures.
B. A technique to store data of different types in a single variable.
C. A concept where a subclass inherits from multiple superclasses.
D. A way to encapsulate data and methods in a single entity.
Answer: A. The ability to define multiple methods with the same name but
different signatures.

Question 2:
Which of the following SQL queries will retrieve all the rows from a table,
even if some columns contain NULL values?
A. SELECT * FROM table WHERE column IS NULL;
B. SELECT * FROM table WHERE column = NULL;
C. SELECT * FROM table;
D. SELECT * FROM table WHERE column != NULL;
Answer: C. SELECT * FROM table;

Question 3:
What is the primary purpose of the this keyword in Java?
A. It refers to the current object instance.
B. It creates a new object.
C. It refers to the superclass of the current object.
D. It calls a method from a different class.
Answer: A. It refers to the current object instance.

Question 4:
What is the purpose of an index in a database?
A. To organize data into tables and
4o
You said:
Wait these are very easy for a L2 candidate, make them a bit complex
ChatGPT said:
ChatGPT
Understood! Here are 20 moderately challenging questions for an L2 technical
round, avoiding algorithm-based questions but focusing on concepts that
require a deeper understanding of programming, databases, and system
design:

Question 1:
In Java, what is the key difference between StringBuilder and StringBuffer,
and why would you choose one over the other in a multi-threaded
application?
A. StringBuilder is synchronized, while StringBuffer is not.
B. StringBuffer is synchronized, while StringBuilder is not.
C. Both are synchronized, but StringBuilder is faster.
D. Both are unsynchronized, but StringBuffer is deprecated.
Answer: B. StringBuffer is synchronized, while StringBuilder is not.

Question 2:
In a REST API, why would you use HTTP status code 204, and how does it
differ from status code 200?
A. 204 indicates success without content, whereas 200 indicates success with
content.
B. 204 indicates an error, while 200 indicates success.
C. 204 is used for POST requests, while 200 is used for GET requests.
D. 204 indicates partial success, while 200 indicates full success.
Answer: A. 204 indicates success without content, whereas 200 indicates
success with content.

Question 3:
When designing a database, what is the purpose of normalization, and what
potential issue can arise when over-normalizing a database?
A. It reduces redundancy, but can lead to performance issues with too many
joins.
B. It increases redundancy for faster queries, but increases storage.
C. It reduces redundancy, but decreases query flexibility.
D. It increases redundancy, but decreases query flexibility.
Answer: A. It reduces redundancy, but can lead to performance issues with too
many joins.

Question 4:
In Python, what is the purpose of the with statement when handling files,
and how does it differ from manually opening and closing a file?
A. The with statement ensures files are closed automatically, even if an
exception occurs.
B. The with statement allows multiple files to be opened simultaneously.
C. The with statement opens files in read-only mode by default.
D. The with statement provides faster file I/O operations.
Answer: A. The with statement ensures files are closed automatically, even if
an exception occurs.
Question 5:
In SQL, what is a "composite key," and why would you use one?
A. A key made up of multiple columns to uniquely identify rows.
B. A key used to create relationships between two tables.
C. A key used to create views in SQL databases.
D. A key used to enforce foreign key constraints.
Answer: A. A key made up of multiple columns to uniquely identify rows.

Question 6:
What does the volatile keyword ensure in Java, and when would you use it in
a multi-threaded environment?
A. It ensures that a variable cannot be changed once initialized.
B. It ensures that a variable is always read from and written to main memory,
not cached.
C. It ensures that only one thread can modify a variable at a time.
D. It ensures that variables are synchronized across all threads.
Answer: B. It ensures that a variable is always read from and written to main
memory, not cached.

Question 7:
In Python, what will happen if a function is defined with default arguments,
and some arguments are missing when the function is called?
A. It will raise a TypeError exception.
B. The function will use the default values for the missing arguments.
C. The function will not execute until all arguments are provided.
D. The missing arguments will automatically be assigned None.
Answer: B. The function will use the default values for the missing arguments.

Question 8:
Which of the following SQL operations is typically faster when indexing a
column, and why?
A. A SELECT query on a large table with many rows
B. An INSERT operation with many unique values
C. A DELETE operation with complex JOINs
D. A SELECT query using a GROUP BY clause
Answer: A. A SELECT query on a large table with many rows

Question 9:
What is the role of "ACID" properties in database transactions, and what
does the 'C' stand for?
A. Consistency, ensuring the database remains in a valid state after the
transaction.
B. Concurrency, ensuring multiple transactions can run simultaneously.
C. Commit, ensuring that transactions are completed.
D. Cache, ensuring data is stored temporarily for faster access.
Answer: A. Consistency, ensuring the database remains in a valid state after the
transaction.

Question 10:
In JavaScript, what is the difference between == and ===, and when should
you use ===?
A. == compares both value and type, while === compares only value.
B. === compares both value and type, while == converts values before
comparison.
C. == compares references, while === compares values.
D. === converts values before comparison, while == compares only value.
Answer: B. === compares both value and type, while == converts values before
comparison.

Question 11:
In a distributed system, what is the purpose of a load balancer, and how does
it ensure efficient handling of requests?
A. It distributes incoming network traffic evenly across multiple servers.
B. It caches frequently accessed data to reduce server load.
C. It replicates data across multiple databases to ensure availability.
D. It schedules processes to run in the most efficient order.
Answer: A. It distributes incoming network traffic evenly across multiple
servers.

Question 12:
In Python, what does the self keyword represent inside a class, and when is it
used?
A. It refers to the class itself and is used in class methods.
B. It refers to the instance of the class and is used in instance methods.
C. It refers to global variables accessible throughout the class.
D. It is used to access private methods within a class.
Answer: B. It refers to the instance of the class and is used in instance
methods.

Question 13:
What happens if you try to modify an immutable object, like a tuple, in
Python?
A. It will raise a TypeError exception.
B. It will modify the object in place.
C. It will return a new object without changing the original.
D. It will silently fail without an error.
Answer: A. It will raise a TypeError exception.

Question 14:
What does the concept of "lazy loading" mean in software development, and
when would you use it?
A. Loading only the necessary data at the time it is requested, to improve
performance.
B. Preloading all data into memory to speed up future access.
C. Delaying the execution of scripts until all data is loaded.
D. Only loading data during the first access of an object or resource.
Answer: A. Loading only the necessary data at the time it is requested, to
improve performance.

Question 15:
What is the difference between a foreign key and a primary key in relational
databases?
A. A foreign key references another table, while a primary key uniquely
identifies rows in the same table.
B. A foreign key uniquely identifies rows, while a primary key is used for
indexing.
C. A foreign key is optional, but a primary key is mandatory.
D. A foreign key and primary key are used interchangeably.
Answer: A. A foreign key references another table, while a primary key
uniquely identifies rows in the same table.

Question 16:
In Java, what is the purpose of the synchronized keyword, and when would
you use it?
A. It allows multiple threads to access a shared resource simultaneously.
B. It ensures that only one thread can access a resource at a time.
C. It prevents a method from modifying shared resources.
D. It forces a thread to wait for another thread to complete.
Answer: B. It ensures that only one thread can access a resource at a time.

Question 17:
Which of the following describes the concept of "loose coupling" in software
design?
A. Components are tightly dependent on each other and hard to modify.
B. Components are independent and can be modified without affecting others.
C. Components are highly integrated for performance optimization.
D. Components share resources to minimize redundancy.
Answer: B. Components are independent and can be modified without
affecting others.

Question 18:
In JavaScript, how does the let keyword differ from var, and when should let
be used?
A. let has block scope, while var has function scope.
B. let allows redeclaration, while var does not.
C. let is deprecated, and var should always be used.
D. Both let and var have the same behavior, but let is newer.
Answer: A. let has block scope, while var has function scope.

Question 19:
What does the term "event-driven programming" mean, and where is it
commonly used?
A. It refers to programs that execute continuously in response to triggers or
events, common in GUIs and web applications.
B. It refers to programming where each step of execution is pre-determined,
common in batch processing.
C. It refers to handling real-time events in embedded systems or robotics.
D. It refers to applications that only run periodically based on scheduled events.
Answer: A. It refers to programs that execute continuously in response to
triggers or events, common in GUIs and web applications.

Question 20:
In SQL, what is the difference between INNER JOIN and OUTER JOIN, and
when would you use an OUTER JOIN?
A. INNER JOIN selects only matching rows, while OUTER JOIN selects all rows,
matching or not.
B. INNER JOIN selects all rows, while OUTER JOIN selects only matching rows.
C. INNER JOIN is faster and always preferred over OUTER JOIN.
D. INNER JOIN is for simple queries, while OUTER JOIN is for complex queries.
Answer: A. INNER JOIN selects only matching rows, while OUTER JOIN selects
all rows, matching or not.

You might also like