Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Mr. Ankit is working in an organisation as data analyst. He uses Python Pandas and Matplotlib for the same. He got a dataset of the passengers for the year 2010 to 2012 for January, March and December. His manager wants certain information from him, but he is facing some problems. Help him by answering few questions given below:   Year   MonthPassengers02010Jan2512010Mar5022012Jan3532010Dec5542012Dec65Code to create the above data frame: import pandas as ............ #Statement 1 data={"Year":[2010,2010,2012,2010,2012],"Month":["Jan","Mar","Jan","Dec","Dec"] ,"Passengers":[25,50,35,55,65]}df=pd..............(data)  #Statement 2print(df)  i. Choose the right code from the following for statement 1. i. pd ii. df iii. data iv. p ii. Choose the right code from the following for the statement 2. i. Data frame ii. Data Frame iii. Seriesiv. Dictionaryiii. Choose the correct statement/ method for the required output: (5,3) i. df.index ii. df.shape() iii. df.shape iv. df.sizeiv. He wants to print the details of "January" month along with the number of passengers, Identify the correct statement:MonthPassengers0Jan252Jan35i. df.loc[['Month','Passengers']][df['Month']=='Jan'] ii. df[['Month','Passengers']][df['Month']=='Jan'] iii. df.iloc[['Month','Passengers']][df['Month']=='Jan'] iv. df(['Month','Passengers']][df['Month']=='Jan') [df['Month']=='Jan'] v. Mr. Ankit wants to change the index of the Data Frame and the output for the same is given below. Identify the correct statement to change the index.YearMonthPassengersAir India2010Jan25Indigo2010Mar50Spicejet2012Jan35Jet2010Dec55Emirates2012Dec65i. df.index[]=["Air India","Indigo","Spicejet","Jet","Emirates"]ii. df.index["Air India","Indigo","Spicejet","Jet","Emirates"]iii. df.index=["Air India","Indigo","Spicejet","Jet","Emirates"]iv. df.index()=["Air India","Indigo","Spicejet","Jet","Emirates"]

Answer»

i. (i) pd

ii. (ii) Data Frame

iii. (iii) df.shape

iv. (ii) df[['Month','Passengers']][df['Month']=='Jan']

v. (iii) df.index=["Air India","Indigo","Spicejet","Jet","Emirates"]

2.

Sanyukta is the event incharge in a school. One of her students gave her a suggestion to use Python Pandas and Matplotlib for analysing and visualising the data, respectively. She has created a Data frame “Sports Day” to keep track of the number of First, Second and Third prizes won by different houses in various events.Write Python commands to do the following: i. Display the house names where the number of Second Prizes are in the range of 12 to 20. a. df['Name'][(df['Second']>=12) and (df['Second']<=20)]b. df[Name][(df['Second']>=12) & (df['Second']<=20)]c. df['Name'][(df['Second']>=12) & (df['Second']<=20)]d. df[(df['Second']>=12) & (df['Second']<=20)]ii. Display all the records in the reverse order. a. print(df[::1]) b. print(df.iloc[::-1]) c. print(df[-1:]+df[:-1]) d. print(df.reverse())iii. Display the bottom 3 records. a. df.last(3) b. df.bottom(3) c. df.next(3) d. df.tail(3)iv. Choose the correct output for the given statements:x=df.columns[:1] print(x) a. 0 b. Name c. First d. Errorv. Which command will give the output 24: a. print(df.size) b. print(df.shape) c. print(df.index) d. print(df.axes)

Answer»

i. c. df['Name'][(df['Second']>=12) & (df['Second']<=20)]

ii. b. print(df.iloc[::-1])

iii. d. df.tail(3)

iv. b. Name

v. a. df.size

3.

Smridh has recently changed his school so he is not aware of the people, but someone is posting negative , demeaning comments on his social media profile. He is also getting repeated mails from unknown people. Every time he goes online, he finds someone chasing him online.i. Smridh is a victim of …………. :a. Eavesdropping b. Stolen identity c. Phishing d. Cyber stalkingii. The action that Smridh should take : a. He should ONLY share with his friends b. He should NOT share with anyone as it can cause serious problem c. He should immediately report to the police d. He should bring to the notice of his parents and school authorities.iii. ……….. is a set of moral principles that governs the behaviour of a group or individual and regulates the use of computers. a. Copyright b. Computer ethics c. Property rights d. Privacy law iv. Smridh needs to protect his personal information or data from unintentional and intentional attacks and disclosure which is termed as ………... a. Digital right b. Copyright c. Privacy d. Intellectual propertyv. The act of fraudulently acquiring someone’s personal and private information, such as online account names, login information and passwords is called as …………… a. Phishing b. Fraud c. Scam d. Plagiarism

Answer»

i. d. Cyber stalking

ii.  d. He should bring to the notice of his parents and school authorities.

iii. b. Computer ethics

iv. c. Privacy

v. a. Phishing

4.

The school offers Wi-Fi to the students of Class XII. For communication, the network security-staff of the school is having a registered URL "schoolwifi.edu". On 17th September 2017, emails were received by all the students regarding expiry of their passwords. Instructions were also given renew their password within 24 hours by clicking on particular URL provided.On the bases of the above case study, answer the questions given below:i. Specify which type of cybercrime is it. a) Spamming b) Phishing c) Identity Theft d) Hackingii. URL stands for .......... a) Universal Resource Loader b) Uniform Resource Locator c) United Research Loader d) Uniform Resource Loaderiii. Unsolicited commercial email is known as: a) Malware b) Virus c) Spam d) Spywareiv. WiFi stands for ......... a) Wireless Internet Frequent Interface b) Wireless Functioning c) Wireless Fidelity d) Wire Free Internetv. Ideally, what characters should be used in a password to make it strong? a) Letters and numbers onlyb) Mixed Case (Upper and Lower) c) Special characters d) All of above

Answer»

i. (b) Phishing

ii. (b) Uniform Resource Locator

iii. (c) Spam

iv. (c) Wireless Fidelity

v. (d) All of the above

5.

Answer the following based on the series given below. import pandas as pd list1=[1,2,3,4,5,6,7,8] list2=['swimming','tt','skating','kho kho', 'bb', 'chess', 'football',"cricket"] school=pd.Series(list1,index=list2) school.name=("little") print (school*2) #statement 1 print (school.tail(3)) # statement 2 print (school["tt"]) # statement 3 print (school[2:4]) # statement 4i. Choose the correct name of the series object given above. a) list1 b) list2 c) school d) little ii. Choose the correct output for the statement: print (school.tail(3)) # statement 2 a. swimming 1tt 2 skating 3 b. chess 6 football 7 cricket 8 c. 4 d. kho kho 4 bb 5 chess 6football 7 cricket 8 iii. Choose the correct output for the statement: print (school["tt"]). # statement 3 a. 2 b. 3 c. tt 2 d. true iv. Identify the correct output for:print (school[2:4]) # statement 4. a. skating 3 kho kho 4 b. tt 2 skating 3kho kho 4 c. skating 3 kho kho 4 bb 5 d. skating 3 kho kho 4 bb 5 chess 6 football 7 cricket 8 v. The correct output of the statement: print (school*2) # statement 1 will be . a. swimming 3 tt 4 skating 5 kho kho 6 bb 7 chess 8 football 9cricket 10 b. swimming 2 tt 4 skating 6 kho kho 8 bb 10 chess 12 football 14 cricket 16 c. swimming False tt False skating True kho kho True bb True chess True football True cricket True d. swimming 1 tt 4 skating 9 kho kho 16 bb 25 chess 36 football 49 cricket 64

Answer»

i. d) little 

ii. b) chess 6 

football 7 

cricket 8 

iii. a) 2

iv. a) skating 3 

kho kho 4 

v. b) swimming 2 

tt 4 skating 6 

kho kho 8 

bb 10 

chess 12 

football 14 

cricket 16

6.

Mr. Sharma is working in a game development industry and he was comparing the given chart on the basis of the rating of the various games available on the play store.He is trying to write a code to plot the graph. Help Mr. Sharma to fill in the blanks of the code and get the desired output.import............. #Statement 1 Games=["Subway Surfer","Temple Run","Candy Crush","Bottle Shot","Runner Best"] Rating=[4.2,4.8,5.0,3.8,4.1]plt..............(Games,Rating)  #Statement 2 plt.xlabel("Games") plt...........("Rating") #Statement 3plt............. #Statement 4 i. Choose the right code from the following for statement 1. i. matplotlib as plt ii. pyplot as pltiii. matplotlib.pyplot as plt iv. matplotlib.plt as pyplot v. matplotlib.pyplot as plt ii. Identify the name of the function that should be used in statement 2 to plot the above graph. i. line() ii. bar() iii. hist() iv. barh() iii. Choose the correct option for the statement 3. i. title("Rating") ii. ytitle("Rating") iii. ylabel("Rating") iv. yaxis("Rating")iv. Choose the right function/method from the following for the statement 4. i. display() ii. print() iii. bar() iv. show() v. In case Mr. Sharma wants to change the above plot to the any other shape, which statement, should he change. i. Statement 1 ii. Statement 2 iii. Statement 3 iv. Statement 4

Answer»

i. (iii) matplotlib.pyplot as plt

ii. (ii) bar()

iii. (iii) ylabel("Rating”)

iv. (iv) show()

v. ii. Statement 2

7.

Samarth is the harware engineer of “Happy School”. He has been given the task of installing a network in the school lab which has around 40 computers. i. Suggest the most suitable type of network topology he should use in order to maximise speed and make each computer indepenent of network breakdowns. a. Bus Topology b. Star Topology c. Ring Topology d. Mesh Topologyii. In order to allow data transfer from server to only the intended computers which network device is required in the lab to connect the computers? a. Switch b. Hub c. Router d. Gatewayiii. After setting up the lab and internet in the lab, Samarth is now required to enable videos and animations to be played on the web browser for students of multimedia class. Which browser tool /service can be used for the same? a. Plug ins b. Add ons c. Control Panel d. Download Settingsiv. During an international exchange programme the students need to connect to a classroom in Russia using Skype. Samarth helps the students to connect. Which type of network service is being used ?a. Instant messaging b. Email messaging c. VoIP d. WWWv. Samarth has asked students of class 7 to identify different parts of URL. Help the students to choose the correct option for label 1 and 2.a. 1- Domain Name 2-Protocol b. 1- Protocol 2-Domain Name c. 1. Domain name 2. subdomain d. 1-Protocol 2-subdomain

Answer»

i. b. Star Topology

ii. a. Switch

iii. b. Add ons

iv. c. VoIP

v. b. 1- Protocol 

2-Domain Name

8.

A School in Delhi uses database management system to store student details. The school maintains a database 'school_record' under which there are two tables. Student Table : Maintains general details about every student enrolled in school. StuLibrary Table : To store details of issued books. BookID is the unique identification number issued to each book. Minimum issue duration of a book is one Day.                           StudentFieldTypeStuIDnumericStuNameVarchar[20]StuAddressVarchar[50]StuFatherNameVarchar[20]StuContactnumericStuAadharnumericStuClassVarchar[5]StuSectionVarchar[1]                 StuLibaryFieldTypeBookIDnumericStuIDnumericIssued_dateDateReturn_dateDatei. Identify the SQL Query which displays the data of StuLibrary table in ascending order of StudentID. (i) Select * from StuLibrary Order By BookID (ii) Select * from StuLibrary Order By StuID \(iii) Select * from StuLibrary Order By StuID ASC (iv) Select * from StuLibrary Order By StuID DESC Choose the correct option: a. Both Query i) and iv) will display the desired data. b. Both Query i) and ii) will display the desired data. c. Both Query iii) and iv) will display the desired data. d. Both Query ii) and iii) will display the desired data. ii. The Primary Key for StuLibrary Table is/are ……. a. BookID b. BookID,StuID c. BookID,Issued_date d. Issued_date iii. Which of the following SQL Query will fetch ID of those issued books which have not been returned? a. SELECT BookID from StuLibrary where BookID is NULL;b. SELECT BookID from StuLibrary where StuID is NULL; c. SELECT BookID from StuLibrary where Issued_date is NULL; d. SELECT BookID from StuLibrary where Return_date is NULL; iv. The Alternate Key for Student Table will be ………. a. StuName b. StuContact c. StuAadhar d. StuClass v. Which of the following SQL Query will display dates on which number ofissued books is greater than 5? a. SELECT Issued_date from StuLibrary GROUP BY Issued_datewhere COUNT(*)&gt;5; b. SELECT Issued_date from StuLibrary GROUP BY Return_datehaving count(*)&gt;5 c. SELECT Issued_date from StuLibrary GROUP BY Issued_datehaving count(*)&gt;5 d. SELECT Issued_date from StuLibrary GROUP BY Return_datewhere COUNT(*)&gt;5

Answer»

I. d) Both Query ii) and iii) will display the desired data. 

II. c) BookID,Issued_date 

III. d) SELECT BookID from StuLibrary where Return_date is NULL; 

IV. c) StuAadhar 

V. c) SELECT Issued_date from StuLibrary GROUP BY Issued_datehaving count(*)>5