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

Advanced DS with Python Question Paper NASSCOM (2)

The document consists of a series of questions and answers related to Python programming, data analysis, and machine learning concepts. Each question tests knowledge on topics such as conditional statements, identifiers, data types, and various Python libraries. The answers provided indicate the correct options for each question, covering a range of programming and statistical principles.

Uploaded by

r2965677
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Advanced DS with Python Question Paper NASSCOM (2)

The document consists of a series of questions and answers related to Python programming, data analysis, and machine learning concepts. Each question tests knowledge on topics such as conditional statements, identifiers, data types, and various Python libraries. The answers provided indicate the correct options for each question, covering a range of programming and statistical principles.

Uploaded by

r2965677
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Module: 1

1.) Assume that you are a software developer and you are applying for a job at XYZ company. The job
description says that developers with years of experience between 3 to 20 can only apply for the
particular designation.

What is the conditional statement to subscribe the candidates for the job based on their years of
experience in relation with the above given requirements in Python?

1. if(year > 3 and year > 20)


2. if(year > 3 and year < 20) 3. if(year > 3 && year , 20)
4. if(year < 3 and year > 20)

Module – Python; Topic – Conditional Statements

Answer: 2

2.) Which of the following cannot be used as an identifier in Python Programming Language?

1. nonlocal_
2. _nonlocal_ 3. nonlocal
4. nonlocal_1

Module – Python; Topic – Identifiers in Python

Answer: 3

3.) Which of the following value has complex data type in python?

1. 54J+h
2. 54o
3. 56j
4. 52J*j

Module – Python; Topic – Datatypes

Answer: 3
4.) Consider a developer was developing a program using python. In that program the developer is
displaying the square of even numbers within a given number range. The range starts with 78 ends with
89. The number 89 should also be processed in the program.

1. For i in 78.90: if (%2


= = 0); print(“”2)
else print(i)
2. For i in range (78, 89)
if (%2 = = 0);
print(i”2) else print(i)
3. For i in range (78, 90)
if (%2 = = 0);
print(i”2) else print(i)
4. For i in range (78, 89)
if (%2 = = 0);
print(i”2) else print(i)

Module – Python; Topic – Loops and range function

Answer: 3

5.) A developer was creating a python code. In that python code, the developer wants to create a
method “Time _convert” to convert a given input number into hours and minutes.

What is the code statement in python to define the method “Time convert” with the above given
requirements?

1. Function Time_convert(int num)


//code
2. def Time_convert(num);
//code
3. def Time_convert for num ()
//code
4. function Time_convert(float num)
//code

Module – Python; Topic – Functions

Answer: 2
6.) Consider the student is working on a python in that program. In that program, the student has to
display the all elements stored of an array. Refer the array details.

Array name. “color”


Array Elements:

• Blue
• Green
• Pink
• Black
• Yellow

What is the code snippet to execute the program based on the above given scenario?

1. for c= color print(c)


2. for c as color
print(c)
3. for c = color print(c)
4. for c in color print(c)

Module – Python; Topic – Loops

Answer: 4

7.) Which of the following is the web framework is used to develop an application server quickly using
python programming language?

1. .NET
2. Spring
3. Flask
4. Node PY

Module – Python; Topic – Web Framework

Answer: 3
8.) Consider the given string :

String_str = ‘ Data science 5 ‘

What is the code statement in python to convert the given string into upper case and display the result
by removing the extra while space in the front and back of the string?

1. print(String_str.remove(), ConvertToUpper())
2. print(String_str.remove(),upper())
3. print(strip(string_str), ConvertToUpper(String_str))
4. print(String_str.strip().Upper())

Module – Python; Topic – String Functions

Answer: 4

9.) Refer the given output image:

Input elements are given in the following order.

• “Dog”
• “Cat”
• “Lion”
• “Tiger”

Which of the following data type is used to store the above given data in a single variable and the
elements are scrambled when displayed?

(‘Cat’, ‘Lion’, ‘Dog’, ‘Tiger’)

1. Dictionary
2. Set
3. List
4. Tufle
Module – Python; Topic – Collection Data types

Answer: 2

10.) Consider a student is developing a program using Python. The Program build displays the various
arithmetic operators available in Python. Refer the given variable ‘X’.

X = 78

Which of the following operator is used to find the cube of the value stored in the variable ‘X’?

1. X//3
2. 3**X
3. X**3
4. X—3

Module – Python; Topic – Operators

Answer: 3

11.) Refer the given code blocks

Block 1:
class Person:

Block 2:

def myfunc(self): print(“Name”


+ self.name)

Block 3:

def_init_(obj, name, age):


obj.name = name

obj.age = age

Block 4:

p1 = Person(“Jacob”, 34) p1.myfunc()

Rearrange the given block of codes to buildan executable python program

1. Class Person:

p1 = Person(“Jacob”,34) p1.myfunc)
def myfunc(self);
Print(“Name” self.name)

def_init_(obj, name, age);


Obj,name = name obj,age
= age
2. Class Person:

def_init_(obj, name, age);


obj.name = name
obj.age = age

def myfunc(self); print(“Name”+self.name)

p1 = Person(“Jacob”, 34) p1.myfunc()


3.

Module – Python; Topic – OOPs

Answer: 2
MODULE: 2

1.) Observe the two given columns:


Column A is the data frame property
Column B is the description
Match the data frame property with its appropriate python description:
Column A Colum B
shape Finds Variable Correlations
head() Details of Missing value
describe() Display all Columns and rows
info() Display Top five rows
corr() View Statistical summary of data

1.)
2.)
3.)
4.)

Module – Data Analysis; Topic – Pandas

Answer:
Final Answer:

1.) shape – Display all Columns and rows (closest fit from given options, though not perfect)
2.) head() – Display Top five rows
3.) describe() – View Statistical summary of data
4.) info() – Details of Missing value
5.) corr() – Finds Variable Correlations
2.) Consider a developer has collected some data. In order to understand more about the collected
data, the developer wants to analyse the collected data. The developer is using descriptive statistics to
analyse the data.
In Descriptive statistics, Univariate analysis is done in order to analyse a particular variable

What are the measures that are used to perform a univariate analysis in descriptive statistics?

1. Measure of central Tendency – Mean, Median, Mode Measure of


dispersion – range, Variance, Standard Deviations
2. Measure of central Limit derivation – Range, Variance, Standard
Deviations Measure of spread – Mean, Median, Mode
3. Measure of central Limit derivation – Mean, variance, Mode
Measure of dispersion – Range, Median, Standard, Deviations
4. Measure of central Tendency – Mean, variance, Mode Measure
of dispersion – Range, Median, Standard, Deviations Module – Data
Analysis; Topic – Univariate Analysis - Descriptive Statistics

Answer: 1

3.) Consider to table with columns “x” and “z”. Which of the following library in python is used to
find the correlations between the columns “x” and “z”?

1. NumPy
2. SciPy
3.) Pandas
4.) TensorFlow

Module – Data Analysis; Topic – Pandas

Answer: 3

4.) Refer the image given below


What is the keyword to create the given plot with Matplotlib in Python?

1.) Vchfguj
2.) Chfhy
3.) Vhcfhc
4.) Vchch

Module – Data Analysis; Topic – Data Visualizations using Matplotlib

Answer: scatter

5.) Consider a developer was working with python programming language. The developer wants to draw
a distributed plot using a library which is built on the top of matplotlib in python.

What are the code statements to import the required library and the draw the plot given in the above
scenario in python?

1.) Import seabom as sb


Sd.distplot(…)
2.) Import pandas as sb
Sd.distplot( …)
3.) Import numpy as sb sd.dist(…)
4.) Import matplotlib as sb
sd.dist(…)
Module – Data Analysis; Topic – Data Visualizations using Matplotlib

Answer: 1

6.) What is the command statement to install the powerful numerical processing library in Juypter
python?

1.) $ pip install numlib


2.) ! install numlib
3.) ! pip install numpy
4.) Pip install numpy

Module – Data Analysis; Topic – Numpy

Answer: 3

7.) A financial department employee was computing some financial data of ZYX company. Refer the data
attained by the financial department employee.

LPA of 3 employees in ZYX company:

Employee1 = 1,00,000
Employee2 = 3,00,000
Employee3 = 2,00,000

What is the LPA central value based on the given LPA of three employees working in a company ZYX?

1. 300000
2. 100000
3. 200000
4. 150000

Module – Data Analysis; Topic – Univariate Analysis - Descriptive Statistics


Answer: 3

Module: 3
1.) A student was working on Central Limit Theorem, while learning Data Science. In the central Limit
Theorem an interval estimate can be created.

Which of the following value is used to estimate the confidence level while computing the interval
estimation?

1. Mean
2. z-score
3. c-score
4. t-score

Module – Advance Statistics; Topic – Probability Distributions

Answer: 2

2.) Consider a student wants to conduct a study to know the average count of apple iPhone users in
India. Because of time and cost constraint the student can perform the study on only people 15,000
people. So the sample population of the study is 15,000.
What is the symbol that can be used to represent the mean of the total population and the sample
population?

1. µ, X_
2. µ,
3. $,µ
4. µ, X

Module – Advance Statistics; Topic – Inferential statistics (Hypothesis testing)

Answer: 1

3.) Observe the Given plot whose width is defined using standard deviation :

In data science, which of the following symmetric plot of data is plotted in the given image?
1. Uniform Distribution
2. Gaussian distribution
3. Bernoulli Distribution
4. Binomial distribution

Module – Advance Statistics; Topic – Probability Distributions

Answer: 2

4.) Which of the following Probability distribution can be computed using a discrete random variable?

1. Uniform Distribution
2. Plot Distribution
3. Bernoulli Distribution
4. Normal Distribution

Module – Advance Statistics; Topic – Probability Distributions

Answer: 3

5.) Which of the following study in data science has to be undertaken to know the uncertainty that may
occur while working with data?

1. Occurance
2. Chi square
3. Probability
4. Plot

Module – Advance Statistics; Topic – Probability

Answer: 3
Module: 4

1.) Assume a client is working on the artificial intelligence and machine learning. The client is also
exploring all the algorithms in machine learning to understand which type of algorithm has to be applied
on the data that has been collected.

Which of the following is an iterative algorithm in machine learning that can be used to optimize a
function?

1. Gradient Descent
2. Decision tree
3. Logistic regression
4. KNN algorithm

Module – Machine Learning; Topic – Optimizers

Answer: 1

2.) Consider a data science student was working with the artificial intelligence and machine learning.
The student has collected few data and is looking for the appropriate machine language technique to
work on the data.

Which following Machine Learning technique is applied if the data collected consists of a target variable?

1. Supervised Machine Learning


2. Reinforcement Machine Learning
3. Non- Supervised Machine Learning
4. Natural Machine Learning

Module – Machine Learning; Topic – Types of Machine Learning

Answer: 1

3.) Consider a developer was collecting some data. The developer wants to perform a supervised
machine learning technique to solve the classification problems, Based on the collected data, the
developer is opting for the Decision tree algorithm.
To work with this machine learning algorithm the developer has located the data and the test train
x_train and y_train are created.
What is the code snipped in machine learning to fit on the given x_train and y_train in Decision tree?

1. From sklearn.tree import Decision Tree


Classifier = Decision TreeClassifier(max_depth = 3) fitclaasfier(x_train,
x_train)
2. from sklearn.tree import Decision TreeClssifier classifier
= Decision TreeClassifier(max_depth = 3)
classifier.fit(x_train,y_train)
3. from sklearn import Decision TreeClassifier classifier =
Decision TreeClassifier(max_depth = 3)
fit.classifier(ytrain,y_train)
4. from sklearn.tree import Decision TreeClassifier classifier
= Decision TreeClassifier(max_depth = 3)
fit.classifier(y_train,y_train)

Module – Machine Learning; Topic – Supervised Learning algorithms – Decision Trees

Answer: 2

4.) Consider a developer was collecting some students data in a CSV format in “data.csv” file. After the
collection of data the developer wants to apply the K Nearest Neighbour algorithm of machine learning
to solve the classification problems of the collect data. In order to perform the algorithm, the data is
loaded using python pandas.

The data column headers are “Age Height, Weight, BMI”.

What is the code statement to identify the input data in the data frame ‘df’ which is created by reading
the file “data csv” using python pandas?

1. df.{[‘Age’,[Height’],[‘Weight’],[‘BMI’]}
2. df{[‘Age’,’Height’,’Weight’,’BMI’]}
3. df.[‘Age’,’Height’,’Weight’,BMI’]
4. df{[Age],Height,[Weight,BMI]}

Module – Machine Learning; Topic – Data Understanding

Answer: df[['Age', 'Height', 'Weight', 'BMI']]


5.) Consider a developer is collecting the details of 30,000 Airtel customers. This data is collected along
with the details like Customer name, address, connection number, Internet plan adopted, Start and end
date of the plan, monthly Payment of the plan, Due date, Payment paid dates, penalty amounts and
default payment as per prediction. All these data are stored in a file “dat.csv” as the data are in CSV
format.

a) What is the code snipped to load the csv data in machine learning and the code statement that
is used to find the number of defaulters based on the given data using python?
b) What is the code statement in python to import the package necessary to build a stacking
ensemble model?

1. a.) Import pandas as pd df =


pd.read_csv(‘data.csv’)
df[‘defaulted’].value_counts(normalize =
True)

b.) from sklearn.ensemble import stackingClassifier

2. a.) Import pandas as pd df =


pd.read_csv(‘data_csv’)
df[‘defaulted’].value(normalize=False)

b.) from sklearn.ensemble import stackingClassifier

3. a.) Import pandas as pd df =


pd_read_csv(‘data.csv’)
df[‘defaulted].value_counts(normalize=false)

b.) Import sklearn.ensemble from stackingClassifier

Module – Machine Learning; Topic – Ensemble techniques

Answer: 1

6.) Consider a developer is working with machine learning. A machine learning requires a major
mathematical skill which is linear algebra. Many machine learning language data set are in the form of
Matrix.
Which of the following study cannot be defined using linear algebra that is the mathematical foundation
for machine learning?

1. Dot Product
2. Vectors
3. Mapping

4. Schemes

Module – Machine Learning; Topic – Linear Algebra

Answer: 4

Module: 5

1.) Tokens (words) are generated in the process. “Bag of words”, after preprocessing multiple sentences
in the dataset. What are those tokens used for?
1. Calculating the frequency of each token.
2. Calculating the importance of each token.
3. Calculating the usability of each token

4. Calculating the total number of tokens.

Module – Deep Learning; Topic – NLP

Answer: 1

2.) When purchasing a phone online, the website includes a picture of the phone, its features, and user
reviews, Which pipeline in deep learning handles the picture portion?

1. Image Vision Pipeline


2. Computer Vision Pipeline
3. Natural Language Processing Pipeline
4. Natural Language Understanding Pipeline

Module – Deep Learning; Topic – Computer Vision

Answer: 2

3.) What are the two main inputs to an ANN?

1. Text and Frequency


2. Image and Text
3. Text and Numbers
4. Images and Numbers

Module – Deep Learning; Topic – ANN

Answer: 4

4.) Consider that there is a picture, and the picture’s edges and boundaries need to be determined using
the edge detection method. What will be the initial task to be performed?

1. Decrease the sharpness of the image.


2. Increase the exposure of the image.
3. Convert the image to a black and white image.
4. Convert the image to a grey scale image.

Module – Deep Learning; Topic – Computer Vision

Answer: 4

5.) What happens when there’s a negligible change in the node weights in a neural network?

1. The accuracy of the model becomes ().


2. The accuracy of the model does improves.
3. The accuracy of the model becomes 1.
4. The accuracy of the model does not improve.

Module – Deep Learning; Topic – ANN

Answer: 4

6.) The data has been preprocessed, and natural language understanding has been applied to the
preprocessed data. What happens in the next stage of natural language processing (NLP)?

1. Natural Language Generation.


2. Natural Language Optimization.
3. Natural Language Creation.
4. Natural Language Reduction.
Module – Deep Learning; Topic – NLP

Answer: 1

7.) In the given image, the most prominent features of the feature map are select. What is the image 2
called as?

1. Max pooling layer


2. Map Layer
3. Features layer
4. Pooling Layer

Module – Deep Learning; Topic – CNN

Answer: 1

You might also like