Counted from the questions in the past papers listed on this site. Repeated = how many times the topic came in those papers.
Data Science important questions with answers
Each answer starts with the short answer. Then come the points to write, a diagram and an exam tip. The questions under each topic are copied from the RGPV papers.
Q1. Big Data: characteristics (the Vs), challenges, applications and its link with data science
Asked 4 times in 2020, 2023, 2024, 2025 · Unit 1
From the papers
“Explain the characterization of big data.” (Jun 2025)
“What are the three characteristics of Big Data and what are the main considerations in processing Big Data?” (May 2024)
“Write about challenges with Big Data. What is Big data? Describe the main features of a big data in detail.” (Nov 2023)
“Discuss Big data in terms of three dimensions, volume, variety and velocity.” (Nov 2023)
The short answer
Big data is data too large, too fast or too mixed for a normal database on one machine to store and process in time. It is described by its V's: volume, velocity and variety (the three original ones), plus veracity, value and variability. Data science is the field that turns this data into knowledge with statistics, machine learning and computing.
Write these points
Volume: the amount of data. It runs into terabytes and petabytes. A bank stores every card swipe for years. A social site stores billions of photos.
Velocity: the speed at which data arrives and must be handled. UPI payments, stock prices and sensor readings come in every second.
Variety: the many forms of data. Structured data sits in tables. Semi-structured data comes as JSON, XML or log lines. Unstructured data is text, images, audio and video.
Veracity: how far we can trust the data. Sensors drop readings, people type wrong values and fake reviews creep in. Bad data gives wrong reports, so we clean it, check its source and mark doubtful values before analysis.
Value: the useful result we get from the data. Data that never helps a decision is only a storage bill.
Variability: the flow and meaning of data change. Orders jump on a sale day. The word "cool" means cold weather in one post and good in another.
Example.
An online shop shows all six. It keeps years of orders (volume) while clicks stream in every second (velocity). It holds tables, product photos and review text (variety). Some reviews are fake (veracity) and festival sales spike the load (variability). The shop studies all of it to recommend products and plan stock (value).
How big data and data science are related
Big data is the raw material: the huge, fast, mixed data itself.
Data science is the method: asking the question, cleaning the data, building models and explaining results.
Big data tools (Hadoop, Spark, NoSQL) let data science run on data that does not fit on one machine.
A data scientist may work on small data too, so data science is wider than big data.
Main considerations in processing big data
Storage: spread the data over many machines (HDFS) with copies for safety.
Scalability: add machines when data grows, instead of buying one bigger server.
Speed: process in parallel (MapReduce, Spark) and handle streams in real time.
Data quality: clean errors, duplicates and missing values before analysis.
Security and privacy: control access and protect personal data.
Cost: use cheap hardware and open source tools.
Challenges with big data
Storage of data that grows by terabytes every day.
Processing speed: results are needed in time, often in real time.
Data quality: errors, duplicates and fake entries (veracity).
Mixing types: joining tables, text, images and logs.
Security and privacy of personal data.
Skilled people who know both the tools and the business are few.
Applications of big data analytics
Field
Use
Retail and e-commerce
Product recommendations, stock planning
Banking
Fraud detection on card and UPI payments
Healthcare
Disease prediction, hospital bed planning
Transport
Route planning, surge pricing in cab apps
Telecom
Predicting which customers will leave
Government
Traffic control, tax fraud, crop planning
Real-life example
Instagram users upload millions of photos and videos a day. Likes and comments stream in every second. Some accounts are fake. The platform still finds value by showing each user the posts they are most likely to like.
Figure: the V's of big data
Same or opposite: volume and variety
Point
Volume
Variety
Same or opposite
Meaning
How much data
How many forms of data
Opposite
Example
Petabytes of photos
Tables, JSON, images, video
Opposite
Tool that helps
HDFS
NoSQL stores
Opposite
One of the V's
Yes
Yes
Same
Exam tip. Name the three V's (volume, velocity, variety) with one example each, then add veracity and value. List four challenges and a table of applications. For the relation question, say big data is the material and data science is the method.
Q2. Data analytics lifecycle, analytic sandbox, data cleaning and sampling
Asked 4 times in 2020, 2023, 2024, 2025 · Unit 1
From the papers
“Describe the operationalizing an analytics project.” (Jun 2025)
“Illustrate the various phases involved in Big Data Analytics with neat diagram.” (May 2024)
“What is an analytic sandbox, and why is it important?” (May 2024)
“Discuss data cleaning and sampling.” (Nov 2023)
The short answer
The data analytics lifecycle is the set of six phases a big data project goes through, from the business question to a working model: discovery, data preparation, model planning, model building, communicate results and operationalize. The team can move back to an earlier phase when it learns something new.
Write these points
The six phases
Discovery: learn the business area, frame the problem, list stakeholders, form initial hypotheses and check the data and tools available.
Data preparation: set up the analytic sandbox, then extract, load and transform the data (ETLT), clean it and explore it.
Model planning: choose the variables and the methods (clustering, regression, decision tree) and plan the workflow.
Model building: split data into training and test sets, build the model and check it on the test set.
Communicate results: compare results with the success criteria, state findings, value and limits to the stakeholders.
Operationalize: run a pilot, deliver reports, code and documents, then deploy the model in production and keep checking it.
Analytic sandbox
An analytic sandbox is a separate workspace where the team can load, copy and change data freely without touching the live production systems. It is important because the team gets all the data it needs (often 5 to 10 times the data warehouse size), experiments do not slow down business systems and a mistake does no harm.
Operationalizing a project
Start with a pilot on a small part of the business, so risk is limited.
Deliver four things: a presentation for sponsors, one for analysts, the code and the technical documents.
Watch the model after deployment and retrain it when its accuracy drops.
Predicting which mobile customers will leave.
Discovery: the telecom company loses 3% of customers a month. Question: who will leave next month?
Data preparation: call records, recharges and complaints copied into a sandbox, cleaned and joined.
Model planning: choose logistic regression and a decision tree; variables are recharge drop, complaints and call minutes.
Model building: train on 80% of last year's data, test on 20%; the tree is 84% accurate.
Communicate: customers with 2 or more complaints and falling recharges are 5 times more likely to leave.
Operationalize: a pilot in one circle sends offers to the top 1,000 risky customers, then the model goes to every circle.
Data cleaning
Missing values: drop the row, or fill with the mean, median or most common value.
Duplicates: remove repeated records.
Wrong or impossible values: marks of 250 out of 100, a date of 31 February; fix or remove.
Inconsistent formats: "CSE", "C.S.E." and "Computer Sc." made one value.
Outliers: check whether they are errors or real rare cases.
Sampling
A sample is a smaller part of the data used when the whole set is too big or costly to study.
Simple random: every record has an equal chance.
Systematic: every k-th record, for example every 10th.
Stratified: split into groups (strata) and sample from each in proportion.
Cluster: pick whole groups, such as a few colleges, at random.
Cleaning and sampling a result file.
10,000 student records: 120 have marks NA, 15 are duplicates, 3 show marks of 250.
Remove the 15 duplicates, fill the 120 NA with the branch median, then correct or drop the 3 impossible marks.
Stratified 10% sample: CSE has 4,000 students, so 400 come from CSE. IT has 2,000, so 200 come from IT. The same holds for every branch.
The sample of 1,000 keeps the same branch mix as the full file.
Real-life example
Cooking for a wedding follows the same path: decide the menu, buy and clean the vegetables, plan the dishes, cook a test batch, get the family's approval, then cook for the guests.
Figure: the six phases of the data analytics lifecycle
Same or opposite: data preparation and model building
Point
Data preparation
Model building
Same or opposite
Main work
Clean, join, transform data
Train and test models
Opposite
Part of the lifecycle
Yes
Yes
Same
Uses the sandbox
Yes
Yes
Same
Output
Clean data set
A tested model
Opposite
Exam tip. Draw the six phases as a cycle and write two lines on each. Define the analytic sandbox with why it matters. If cleaning and sampling are asked, list five cleaning steps and four sampling methods with the stratified example.
Q3. R: features, environment, vectors, R and Python compared, presenting results
Asked 4 times in 2020, 2023, 2024, 2025 · Unit 5
From the papers
“Compare R and Python programming languages for predictive modeling.” (Dec 2020, Jun 2025)
“What R function is used to encode a vector as a category? What is a rug plot used for in a density plot?” (May 2024)
“Describe the features of R programming language. Describe major components of R environment.” (Nov 2023)
“Explain different operations on vector.” (Nov 2023)
The short answer
R is a free programming language made for statistics, data analysis and graphs. Python is a general programming language with strong data libraries (pandas, scikit-learn). Both are used for predictive modelling. R is also good for communicating results through plots and reports.
Write these points
R and Python for predictive modelling
Point
R
Python
Made for
Statistics and graphs
General programming
Modelling libraries
caret, randomForest, glm in base R
scikit-learn, TensorFlow, PyTorch
Graphs
ggplot2, base plots: very strong
matplotlib, seaborn
Deployment in apps
Harder (Shiny, plumber)
Easier (web apps, APIs)
Learning
Easy for statisticians
Easy for programmers
Useful R functions asked in papers
factor() encodes a vector as a category: factor(c("M", "F", "M")) gives levels F and M.
summary(), mean(), sd() give basic statistics; table() counts categories.
A rug plot (rug()) draws a small tick on the x axis for each data value under a density plot, so the reader sees where the real points lie and how many there are.
Communicating results with R
Start with the key finding in one sentence for the audience.
Show it with a clear graph (ggplot2): bar chart, box plot or line chart.
Write the report in R Markdown, which mixes text, code and graphs and exports to PDF or HTML.
Build an interactive dashboard with Shiny when users want to explore.
State the limits of the model and the next steps.
Encoding and plotting exam results in R.
grade <- c("A", "B", "A", "C", "B", "A")
g <- factor(grade); levels(g) gives "A" "B" "C"; table(g) gives A 3, B 2, C 1.
marks <- c(78, 65, 81, 52, 70, 88); plot(density(marks)); rug(marks) draws the curve with a tick at each of the six marks.
model <- lm(marks ~ hours) fits a line; summary(model) shows its fit for the report.
Features of R
Free and open source, runs on Windows, Linux and Mac.
Built for statistics: tests, models and distributions are ready made.
Very strong graphs (base plots, ggplot2).
More than 20,000 packages on CRAN.
Works on vectors, matrices, lists and data frames directly.
Interpreted: each line runs at once in the console.
Major components of the R environment
Component
Role
R console
Runs commands one by one
Script editor (RStudio)
Writes and saves programs
Workspace (global environment)
Holds the objects made in a session
Packages and library()
Add functions from CRAN
Help system
help(mean) or ?mean shows the manual
Graphics device
Window or file where plots are drawn
Operations on vectors
Vector operations in R.
marks <- c(78, 65, 81, 52) creates a vector; length(marks) is 4.
marks + 5 gives 83 70 86 57 (each element changes); marks * 2 doubles each.
c(1, 2, 3, 4) + c(10, 20) gives 11 22 13 24: the shorter vector is recycled.
sum(marks) is 276 and mean(marks) is 69.
Real-life example
A cricket analyst who presents a batting chart to the team coach is communicating results. The chart matters more to the coach than the code behind it.
Figure: from analysis to a report in R
Same or opposite: R and Python
Point
R
Python
Same or opposite
Main purpose
Statistics
General programming
Opposite
Free and open source
Yes
Yes
Same
Best at
Graphs, statistics
Machine learning in apps
Opposite
Report tool
R Markdown, Shiny
Jupyter notebook
Opposite
Exam tip. For R questions write its features, the environment table and the vector operations with outputs. For R and Python, give the comparison table, then the useful functions (factor, rug, lm) and how results are communicated.
Q4. HDFS: architecture, NameNode, DataNode and secondary NameNode
Asked 3 times in 2020, 2024, 2025 · Unit 3
From the papers
“Explain the basic architecture of HDFS.” (Jun 2025)
“Draw and explain HDFS Architecture. Explain the functions of NameNode and DataNodes. What is a secondary NameNode? Is it a substitute for the NameNode?” (May 2024)
“What are the differences between regular File System and HDFS?” (Dec 2020)
The short answer
HDFS (Hadoop Distributed File System) is the storage layer of Hadoop. It cuts a large file into blocks of 128 MB (the default in Hadoop 2 and 3) and keeps copies of each block on different machines.
Write these points
NameNode (master): keeps the namespace (files, folders, permissions) and the list of blocks of each file with the DataNodes that hold them. It keeps this metadata in RAM and saves it on disk as the fsimage plus an edit log.
DataNode (worker): stores the real blocks on its local disk. It sends a heartbeat every 3 seconds and a block report to the NameNode.
Secondary NameNode: merges the edit log into the fsimage from time to time (a checkpoint). It is a helper. It does not take over if the NameNode fails.
Replication: each block has 3 copies by default. Rack awareness puts one copy on the writer's node and two on nodes in another rack, so a whole rack can fail without data loss.
Reliability: if a DataNode stops sending heartbeats for about 10 minutes, the NameNode marks it dead and copies its blocks again from the other replicas. Checksums catch corrupt blocks.
Features: runs on cheap commodity machines, fault tolerant, high throughput for large sequential reads, write once and read many times. Computation moves to the node that holds the data.
Command
What it does
hdfs dfs -mkdir /data
Make a folder in HDFS
hdfs dfs -put sales.csv /data
Copy a local file into HDFS
hdfs dfs -ls /data
List files with size and replication
hdfs dfs -cat /data/sales.csv
Print a file
hdfs dfs -get /data/sales.csv .
Copy a file back to local disk
Steps
Write: the client asks the NameNode to create the file. The NameNode checks permissions and gives a list of DataNodes for each block.
The client sends the block to the first DataNode. It passes the data to the second and the second to the third (a pipeline). Acknowledgements flow back along the same pipeline.
Read: the client asks the NameNode for the block locations. It then reads each block straight from the nearest DataNode. Data never flows through the NameNode.
Example.
A 300 MB file becomes 3 blocks: 128 MB, 128 MB and 44 MB. With replication 3 the cluster stores 9 block copies, about 900 MB in all. The last block uses only 44 MB of disk.
Secondary NameNode
The NameNode keeps the file system image (fsimage) and a log of changes (edit log). The Secondary NameNode takes these from time to time, merges them into a fresh fsimage and sends it back. This is called a checkpoint. It keeps the edit log small, so a NameNode restart is fast. It is not a substitute for the NameNode: it does not serve clients and cannot take over if the NameNode fails. In Hadoop 2 a Standby NameNode gives real failover.
Regular file system and HDFS
Point
Regular file system (NTFS, ext4)
HDFS
Runs on
One machine
A cluster of many machines
Block size
4 KB
128 MB
Failure handling
A disk failure loses data
Each block kept 3 times on different nodes
Access pattern
Read and write anywhere in a file
Write once, read many times
Best for
Many small files
A few very large files
Real-life example
A hospital keeps scans for years. HDFS splits each large file into blocks and stores three copies on different machines. If one disk fails, the scan is still read from another copy.
Figure: HDFS, one NameNode and DataNodes that hold each block three timesFigure: writing a file to HDFS
Same or opposite: HDFS write and HDFS read
Point
Write
Read
Same or opposite
Client first contacts
NameNode
NameNode
Same
Data goes
Through a pipeline of DataNodes
From the nearest DataNode
Opposite
Copies made
3 by default
None
Opposite
NameNode handles the data itself
No
No
Same
Exam tip. Draw the NameNode with DataNodes and replicated blocks. Write the role of each, then the Secondary NameNode as a checkpoint helper that is not a backup. Add the regular file system table if asked.
“Explain the key components of HBase.” (Dec 2020, Jun 2025)
“Explain storage mechanism in HBASE.” (May 2024)
The short answer
HBase is an open source, column-family NoSQL database that runs on top of HDFS. It is modelled on Google's Bigtable. It stores very large sparse tables and gives fast random reads and writes by row key, which plain HDFS cannot do.
Write these points
Data model
Row key: the unique key of a row; rows are kept sorted by it.
Column family: a group of columns stored together, fixed when the table is made (for example info, marks).
Column qualifier: a column inside a family, added freely (info:name, marks:dbms).
Cell and timestamp: each value is kept with a timestamp, so older versions can be read.
Key components
Component
Role
HMaster
Assigns regions to RegionServers, handles table create and delete, balances load
RegionServer
Serves reads and writes for its regions
Region
A range of row keys of one table; split when it grows too large
ZooKeeper
Tracks live servers, holds the location of the META table, helps elect the master
HDFS
Stores the WAL and HFiles with replication
Storage mechanism (write path)
The write goes first to the WAL (write-ahead log) so it survives a crash.
Then it goes to the MemStore, a sorted buffer in memory, one per column family.
When the MemStore is full it is flushed to disk as an HFile in HDFS.
Many small HFiles are merged by compaction: minor compaction joins a few; major compaction rewrites all and removes deleted cells.
A read checks the MemStore and block cache first, then the HFiles.
A student marks table in HBase.
Table students with families info and marks. Row key = roll number.
put 'students', '21IT045', 'info:name', 'Riya'
put 'students', '21IT045', 'marks:dbms', '78'
get 'students', '21IT045' returns both cells at once, found by the row key without scanning the table.
Another student may have marks:ml while Riya does not. Empty cells take no space, which is why HBase suits sparse data.
Real-life example
A school register sorted by roll number works like HBase. You jump straight to one roll number instead of reading every page.
Figure: HBase components and the write path
Same or opposite: HBase and an RDBMS
Point
HBase
RDBMS
Same or opposite
Schema
Only column families fixed
Every column fixed
Opposite
Stores data in tables
Yes
Yes
Same
Joins and SQL
No (no native SQL)
Yes
Opposite
Scale
Thousands of servers
Mostly one server
Opposite
Exam tip. Define HBase and its data model, list the five components with their roles and draw the write path: WAL, MemStore, flush, HFile, compaction.
Q6. Clustering: K-means, hierarchical and other clustering algorithms
Asked 3 times in 2020, 2024, 2025 · Unit 2
From the papers
“Describe the additional clustering algorithm with example.” (Jun 2025)
“Use K-means clustering algorithm to divide the following data into two clusters. X1: 1 2 3 4 5, X2: 1 1 3 2 5.” (May 2024)
“Differentiate Agglomerative and Divisive Hierarchical Clustering.” (Dec 2020)
The short answer
Clustering groups data objects so that objects in one group (cluster) are alike while objects in different groups are not. It is unsupervised: no class labels are given. K-means splits the data into k clusters, each around its mean (centroid). Hierarchical clustering builds a tree of clusters.
Write these points
K-means steps
Choose k and pick k starting centroids.
Put each point in the cluster of its nearest centroid (Euclidean distance).
Recompute each centroid as the mean of its points.
Repeat steps 2 and 3 until no point changes cluster.
May 2024 paper: two clusters for A(1,1), B(2,1), C(3,3), D(4,2), E(5,5).
Start with centroids c1 = A(1,1) and c2 = B(2,1).
Round 1: C is 2.83 from c1 and 2.24 from c2, D is 3.16 and 2.24, E is 5.66 and 5. So clusters {A} and {B, C, D, E}.
Agglomerative and divisive hierarchical clustering
Point
Agglomerative
Divisive
Direction
Bottom up: start with each point alone, merge the two closest clusters
Top down: start with one cluster, split it
Stops when
One cluster is left or k is reached
Each point is alone or k is reached
Cost
Lower, more common
Higher
Example
AGNES
DIANA
Additional clustering algorithms
K-medoids (PAM): uses a real data point as the centre, so outliers matter less.
DBSCAN: density based; finds clusters of any shape and marks lonely points as noise.
Fuzzy C-means: each point belongs to every cluster with a degree between 0 and 1.
Hierarchical: gives a dendrogram, so k need not be chosen first.
Real-life example
A school sorting students into sports houses by height and speed, so each house has similar players, is clustering. Nobody gave the houses names first; the groups come from the data.
Figure: K-means on the five pointsFigure: a dendrogram from agglomerative clustering
Same or opposite: K-means and hierarchical clustering
Point
K-means
Hierarchical
Same or opposite
Needs k in advance
Yes
No
Opposite
Unsupervised
Yes
Yes
Same
Output
Flat clusters
Tree (dendrogram)
Opposite
Large data
Fast
Slow
Opposite
Exam tip. Write the four K-means steps, then solve the numeric round by round with the distances and new centroids. For hierarchical clustering give the agglomerative and divisive table with a dendrogram.
Q7. Association rules and the Apriori algorithm: support, confidence, lift
Asked 3 times in 2020, 2023, 2024 · Unit 2
From the papers
“Which itemsets satisfy the minimum support of 0.5? How are interesting rules identified and distinguished from coincidental rules?” (May 2024)
“Explain advantages of Apriori algorithm.” (May 2024)
“Explain Association rules and write applications of Association rules.” (Nov 2023)
“How are association rules mined from large databases?” (Dec 2020)
The short answer
Association rule mining finds rules X → Y showing that items in X are often bought with items in Y. Apriori finds the frequent item sets level by level, then rules are made from them.
Write these points
Measures
Support (X → Y) = transactions holding X and Y / all transactions.
Confidence (X → Y) = support(X ∪ Y) / support(X).
A rule is strong if it meets both minimum support and minimum confidence.
Apriori steps
Count each item. Keep those with support ≥ min support: L₁.
Join Lₖ₋₁ with itself to make candidates Cₖ.
Prune: drop any candidate with an infrequent subset. Every subset of a frequent set must be frequent (the Apriori property).
Scan the data to count Cₖ. Keep the frequent ones as Lₖ. Repeat until no new set is found.
Rule generation: for each frequent set L and each subset S, make S → (L − S) if its confidence ≥ min confidence.
Points often asked
Association mining is unsupervised: there is no class label to learn.
Maximal frequent item set: frequent, with no frequent superset.
To keep only useful rules from a large set, use higher thresholds, lift > 1 and remove redundant rules.
Apriori can cost more than it saves when many long frequent sets exist, because it makes a huge number of candidates.
Which itemsets satisfy minimum support 0.5.
T1 {A, C, D}, T2 {B, C, E}, T3 {A, B, C, E}, T4 {B, E}. Min support 0.5 of 4 transactions = count 2.
L₁: A 2, B 3, C 3, E 3. D (1) is dropped.
C₂ counts: AB 1, AC 2, AE 1, BC 2, BE 3, CE 2. L₂ = {A, C}, {B, C}, {B, E}, {C, E}.
C₃: only {B, C, E} has all its pairs frequent; its count is 2, so L₃ = {B, C, E} with support 0.5.
A rule is interesting when it has high support and confidence and its lift is well above 1. Lift(X → Y) = confidence(X → Y) / support(Y). Lift = 1 means X and Y occur together only by chance, so the rule is coincidental. Lift > 1 means X really raises the chance of Y. Lift < 1 means they push each other away.
Lift on the same data.
B → E: confidence = 3/3 = 1; support(E) = 3/4 = 0.75; lift = 1 / 0.75 = 1.33, so the rule is interesting.
If 75 of 100 customers buy milk anyway and 75% of bread buyers buy milk, lift = 0.75 / 0.75 = 1: a coincidental rule.
Advantages of Apriori
Easy to understand and to code.
Uses the Apriori property (every subset of a frequent itemset is frequent) to prune candidates.
Works on large, sparse data sets.
Its rules are simple for managers to read.
Real-life example
A supermarket studies thousands of past bills and finds that most people who buy chips also buy a cold drink. So it places chips next to the cold drinks and sales of both go up. Amazon's "Frequently bought together" box works the same way. Both come from association rules mined from past bills.
Figure: Apriori loop
Same or opposite: support and confidence
Point
Support
Confidence
Same or opposite
Measures
How often the items appear together
How often Y comes when X comes
Opposite
Formula
count(X ∪ Y) / N
count(X ∪ Y) / count(X)
Opposite
Same for X → Y and Y → X
Yes
No
Opposite
Has a minimum threshold
Yes
Yes
Same
Exam tip. Define support, confidence and lift. Solve Apriori level by level (C₁, L₁, C₂, L₂, C₃, L₃) and list the itemsets that meet the minimum support. Use lift to separate interesting rules from coincidental ones.
Q8. Classification: decision trees and Naive Bayes
Asked 3 times in 2023, 2024, 2025 · Unit 2
From the papers
“Explain decision tree. Explain different Naive Bayes classifier.” (May 2024)
“Explain about classification of Decision trees in detail.” (Nov 2023)
“Explain in detail about Naive Bayes classification.” (Nov 2023)
“Write short note on: Decision tree” (Jun 2025)
The short answer
A decision tree is a flowchart-like tree whose internal nodes test attributes and whose leaves give classes. ID3 builds it top-down using information gain. Naive Bayes is a probability classifier that uses Bayes' theorem and assumes the attributes are independent. Both are supervised classification methods.
Write these points
Building the tree
Start with all training records at the root.
Entropy of a set: E(S) = −Σ pᵢ log₂ pᵢ.
Information gain of attribute A: Gain(A) = E(S) − Σ (|Sᵥ| / |S|) E(Sᵥ).
Split on the attribute with the highest gain. Repeat on each branch.
Stop when all records in a node have one class, or no attributes are left (take the majority).
C4.5 uses gain ratio. CART uses the Gini index. Pruning removes branches that only fit noise.
Naive Bayes uses Bayes' theorem P(C | X) = P(X | C) P(C) / P(X) and assumes the attributes are independent given the class. It picks the class with the highest P(C) × P(x₁ | C) × P(x₂ | C) × ... Its types are Gaussian (numeric attributes), Multinomial (word counts) and Bernoulli (yes or no attributes).
Is an e-mail with the word offer spam.
Training: 10 e-mails, 4 spam and 6 not spam. offer appears in 3 of the 4 spam and 1 of the 6 others.
0.30 > 0.10, so the e-mail is classified spam; P(spam | offer) = 0.30 / 0.40 = 75%.
Real-life example
A bank's credit card approval often follows a tree: is income above a limit? Then, is there a past default? Then, how long in the current job? Each answer leads to approve or reject.
Figure: a decision tree for buys computerFigure: Building a decision tree (ID3)
Same or opposite: information gain and Gini index
Point
Information gain
Gini index
Same or opposite
Used by
ID3
CART
Opposite
Based on
Entropy
Squared class shares
Opposite
Picks the best split
Yes
Yes
Same
Tree type
Many-way splits
Binary splits
Opposite
Exam tip. Draw a small tree, write the information gain steps and solve the root choice. For Naive Bayes, write Bayes' theorem, the independence assumption, its three types and the spam example.
Q9. MapReduce: word count, input splits, formats, combiner, partitioner and scheduling
Asked 3 times in 2020, 2023, 2024 · Unit 3
From the papers
“Explain how MapReduce in Hadoop is used to perform a word count on the specified dataset.” (May 2024)
“In MapReduce how is job scheduling done in case of the fair scheduler?” (May 2024)
“Discuss on the different types and formats of MapReduce with an example each one.” (Nov 2023)
“If you have an input file of 350 MB, how many input splits would HDFS create and what would be the size of each input split?” (Dec 2020)
The short answer
MapReduce is Hadoop's model for processing large data in parallel. A map function turns each record into (key, value) pairs, then a reduce function combines all values that share a key.
Write these points
Pseudocode for word count: map(offset, line): for each word w in line: emit(w, 1). reduce(w, counts): emit(w, sum(counts)).
Where it is used: log analysis, counting clicks, building search indexes, ETL jobs and large joins.
Why it is used: the code moves to the node that holds the data. The job scales by adding nodes. A failed task simply runs again on another node. The programmer writes only two functions.
Steps
Input split: the InputFormat cuts the input into splits (usually one per HDFS block). A RecordReader turns each split into records, for text files (byte offset, line).
Map: the mapper runs once per record and emits intermediate pairs. They go to the local disk of that node, not to HDFS.
Combiner (optional): a mini reducer on the same node. It adds up the mapper's output before it travels, which cuts network traffic. It only suits jobs like sum, count or max.
Partition: the partitioner picks the reducer for each key, by default hash(key) mod number of reducers.
Shuffle and sort: each reducer copies its pairs from all mappers. The pairs are sorted and grouped by key.
Reduce: reduce(key, list of values) runs once per key and writes the final output to HDFS.
Example.
Input line: "big data big". Map gives (big,1) (data,1) (big,1). The combiner gives (big,2) (data,1). After shuffle, the reducer for "big" gets (big,[2]) and writes big 2. The output is big 2 and data 1.
InputFormat and RecordReader decide how input is split and read.
Number of reducers is set by the job. It decides how many output files there are.
Input splits for a 350 MB file
How many input splits.
HDFS block size in Hadoop 2 and 3 is 128 MB. By default one split = one block.
350 = 128 + 128 + 94, so HDFS stores 3 blocks and MapReduce makes 3 input splits of 128 MB, 128 MB and 94 MB.
So 3 map tasks run. With the old 64 MB block of Hadoop 1: 64 × 5 = 320, so 6 splits: five of 64 MB and one of 30 MB.
RecordReader, Combiner and Partitioner
RecordReader: turns a split into (key, value) records for the mapper, for example (byte offset, line).
Combiner: a mini reducer on the map side that adds up values for each key before they cross the network, so less data moves.
Partitioner: decides which reducer gets each key; the default is hash(key) mod number of reducers, so one key always goes to one reducer.
Fair scheduler
The fair scheduler shares the cluster so every job gets an equal share over time. Jobs are put in pools, often one per user. Each pool can have a minimum share it is promised. Free slots go to the job that is furthest below its fair share, so a short job does not wait behind a long one. If a pool gets less than its minimum share for too long, the scheduler can preempt (stop) tasks of other pools.
Types and formats in MapReduce
Format
What it gives the mapper or writes
Example
TextInputFormat (default)
Key = byte offset, value = the line
Log files
KeyValueTextInputFormat
Splits each line at a tab into key and value
roll and marks files
NLineInputFormat
N lines per mapper
One URL per line, 100 per mapper
SequenceFileInputFormat
Binary key and value pairs
Output of an earlier job
TextOutputFormat (default)
Writes key TAB value lines
part-r-00000
SequenceFileOutputFormat
Binary output for the next job
Chained jobs
Map-only job: no reducer, for example filtering or a Sqoop import.
Map and reduce job: word count.
Chained jobs: one job's output feeds the next.
Real-life example
To count how often each hashtag was used in a day, each machine counts hashtags in its own share of posts. The counts for each hashtag are then sent to one reducer and added up.
Figure: word count in MapReduce, through map, shuffle and reduceFigure: phases of a MapReduce job
Same or opposite: combiner and reducer
Point
Combiner
Reducer
Same or opposite
Runs on
Mapper's node
Reducer node
Opposite
Required
No, optional
Yes
Opposite
Output goes to
Shuffle
HDFS
Opposite
Combines values of one key
Yes
Yes
Same
Exam tip. Write the map, shuffle and reduce phases with the word count pseudocode and draw the figure. Add the input split numeric, the RecordReader, Combiner and Partitioner roles and the fair scheduler pools when asked.
Q10. Hive and Pig: components, Pig architecture, Hive UDFs and comparison
Asked 3 times in 2020, 2023, 2025 · Unit 4
From the papers
“Explain various components of Hive.” (Jun 2025)
“Explain procedure to write user defined functions in HIVE.” (Nov 2023)
“Draw and explain architecture of APACHE PIG in detail. Discuss Pig Latin Application Flow.” (Nov 2023)
“What are the components used in Hive query processors?” (Dec 2020)
The short answer
Apache Hive is a data warehouse tool on top of Hadoop. Users write SQL-like HiveQL, which Hive turns into MapReduce, Tez or Spark jobs over files in HDFS.
Write these points
User interfaces: the CLI or Beeline, a web UI such as Hue or JDBC and ODBC programs that connect through HiveServer2.
Driver: receives the query, opens a session and controls the query from start to end.
Compiler: parses the query, checks tables and columns against the metastore and builds an execution plan, a DAG of stages.
Optimizer: improves the plan, for example by pushing filters down, skipping unused partitions and choosing a map-side join.
Execution engine: runs the stages on the cluster through YARN and collects the result.
Metastore: stores the schema of every table: columns, types, partitions, HDFS location and the SerDe. It sits in a relational database, Derby by default or MySQL in real clusters.
Classes for HDFS files: an InputFormat (such as TextInputFormat) reads records and a Deserializer turns them into rows. On write, a Serializer turns rows into bytes and an OutputFormat writes them. Serializer plus Deserializer is the SerDe, for example LazySimpleSerDe.
Steps
The UI sends the query to the driver (execute query).
The driver asks the compiler for a plan. The compiler gets the table details from the metastore.
The compiler returns the plan. The driver hands it to the execution engine.
The engine runs the jobs on Hadoop. The jobs read and write data in HDFS.
The result goes back through the driver to the user.
How one HiveQL query runs.
Query: SELECT city, SUM(amount) FROM sales GROUP BY city;
1. The driver receives the query. The compiler checks the table sales in the metastore and finds its HDFS folder.
2. The optimizer makes a plan: a map step that reads rows and emits (city, amount), then a reduce step that sums by city.
3. The execution engine runs the job on the cluster. The driver returns one total per city to the user.
Hive and Pig compared
Point
Hive
Pig
Language
HiveQL, like SQL (declarative)
Pig Latin, step by step (procedural)
Made by
Facebook
Yahoo
Used by
Analysts who know SQL
Programmers building data flows
Data
Mostly structured, tables with schema
Structured and semi-structured
Schema
Kept in the metastore
Optional, given in the script
Best for
Reports and queries
ETL and data cleaning
The same question in both.
Hive: SELECT branch, AVG(marks) FROM students GROUP BY branch;
Pig: s = LOAD 'students' AS (roll, branch, marks); g = GROUP s BY branch; r = FOREACH g GENERATE group, AVG(s.marks); DUMP r;
Both turn into MapReduce (or Tez) jobs over the same HDFS file.
Writing a user defined function (UDF) in Hive
Write a Java class that extends UDF (or GenericUDF) with an evaluate() method.
Compile it and pack it in a jar file.
In Hive: ADD JAR /home/riya/upper.jar;
CREATE TEMPORARY FUNCTION to_upper AS 'com.pw.ToUpper';
Use it in a query: SELECT to_upper(name) FROM students;
Pig architecture and Pig Latin application flow
The script comes from the Grunt shell or a script file.
The Parser checks syntax and makes a logical plan (a DAG).
The Optimizer improves the plan, for example by pushing filters early.
The Compiler turns it into MapReduce jobs.
The Execution engine runs the jobs on Hadoop and returns the result.
Application flow: LOAD the data, transform it (FILTER, GROUP, JOIN, FOREACH), then DUMP it to the screen or STORE it in HDFS.
Real-life example
A telecom company stores call records in HDFS. Its analysts write HiveQL to find which towers drop the most calls. Hive turns each query into cluster jobs, so they never write Java.
Figure: Hive architecture, from HiveQL to jobs on HDFSFigure: how Hive runs a query
Same or opposite: Hive and Pig
Point
Hive
Pig
Same or opposite
Language
HiveQL, like SQL
Pig Latin, data flow
Opposite
Used by
Analysts who know SQL
Programmers, ETL work
Opposite
Schema
Stored in the metastore
Given in the script
Opposite
Runs on Hadoop
Yes
Yes
Same
Exam tip. Draw the Hive architecture and name the query processor parts: driver, compiler, optimizer, executor and metastore. Give the UDF steps, the Pig architecture with the LOAD, transform, STORE flow and the Hive and Pig table.
Q11. Hadoop: building blocks, shell commands and Hadoop compared with a traditional database
Asked 3 times in 2023, 2024, 2025 · Unit 3
From the papers
“Distinguish between Hadoop and traditional database.” (Jun 2025)
“Describe the Hadoop core components in brief.” (Jun 2025)
“Explain following commands with syntax and one example of each: copy from local in Hadoop, showing the content of output file in Hadoop.” (May 2024)
“Explain in detail building blocks of Hadoop with neat sketch.” (Nov 2023)
The short answer
Hadoop is an open source Apache framework that stores and processes very large data on a cluster of cheap machines. Its core is Hadoop Common, HDFS, YARN and MapReduce, with an ecosystem of tools around it.
Write these points
Hadoop Common: the shared Java libraries and scripts every other part uses.
HDFS: the storage layer. It splits files into blocks and keeps three copies of each.
YARN (Yet Another Resource Negotiator): the resource manager. The ResourceManager hands out containers of CPU and memory. A NodeManager on each node runs them.
MapReduce: the processing model. Map tasks work on blocks in parallel and reduce tasks combine their results.
Building blocks (daemons): the master runs the NameNode, the Secondary NameNode and the ResourceManager. Each worker runs a DataNode and a NodeManager. In Hadoop 1 the JobTracker and TaskTrackers did the job of YARN.
How they work together: Sqoop or Flume brings data into HDFS. YARN gives resources. MapReduce, Spark, Hive or Pig process the data. Oozie schedules the jobs. Results go back to HDFS, HBase or a database.
Ecosystem tool
Job
Hive
SQL-like queries (HiveQL) on HDFS data
Pig
Data flow scripts in Pig Latin
HBase
Column-family NoSQL store on HDFS
Sqoop / Flume
Import from databases / stream in logs
Spark
Fast in-memory processing
Oozie / ZooKeeper
Job scheduling / cluster coordination
Mahout
Machine learning on Hadoop
Which Hadoop part does what for a 1 TB log file.
HDFS cuts the file into about 8,000 blocks of 128 MB and keeps 3 copies of each.
YARN gives containers on the cluster nodes to the job.
MapReduce runs about 8,000 map tasks, one per block, next to the data. A few reduce tasks add up the results.
Hadoop Common supplies the shared libraries that all of these use.
An e-commerce company uses Flume to collect logs, HDFS to store them, Hive to query them and Oozie to run the jobs every night. All of these belong to the Hadoop ecosystem.
Figure: the Hadoop stack, HDFS and YARN at the base and the ecosystem on topFigure: the Hadoop ecosystem
Same or opposite: HDFS and MapReduce
Point
HDFS
MapReduce
Same or opposite
Layer
Storage
Processing
Opposite
Master
NameNode
ResourceManager (YARN)
Opposite
Core part of Hadoop
Yes
Yes
Same
Works on blocks across many nodes
Yes
Yes
Same
Exam tip. Name the four core parts (Common, HDFS, YARN, MapReduce) with their roles and draw the stack. Add the two commands with syntax and example. Give the RDBMS and Hadoop table when asked.
Q12. Types and sources of data: structured, semi-structured and unstructured
Asked 2 times in 2024, 2025 · Unit 1
From the papers
“Explain the types of data in details.” (Jun 2025)
“Discuss the various sources of data.” (Jun 2025)
“Compare and contrast the terms structured, unstructured and semi-structured data.” (May 2024)
The short answer
Data comes in three types by structure: structured data fits fixed rows and columns. Semi-structured data has tags or keys but no fixed table. Unstructured data has no set format. Data also comes from many sources: inside the business, outside it, people, machines and sensors.
Write these points
Types of data
Point
Structured
Semi-structured
Unstructured
Format
Fixed schema, rows and columns
Tags or keys, flexible schema
No fixed format
Examples
Bank tables, marks sheet
JSON, XML, e-mail headers
Photos, videos, PDF text, tweets
Stored in
RDBMS (MySQL)
NoSQL (MongoDB), files
HDFS, object storage
Share of all data
About 10 to 20%
Small
About 80%
Easy to query
Yes, with SQL
Partly
No, needs text or image analysis
Data is also quantitative (numbers such as marks) or qualitative (categories such as branch). It is also primary (collected by you) or secondary (collected by someone else).
Sources of data
Internal business data: sales, accounts, customer records.
Social media and the web: posts, reviews, clicks.
Machine and sensor data: IoT devices, GPS, server logs.
Transactions: card swipes, UPI payments, bills.
Public and government data: census, open data portals.
Surveys and experiments: primary data collected on purpose.
One student's data in three forms.
Structured: a row in the exam table: 21IT045 | Riya | IT | 78.
Semi-structured: {"roll": "21IT045", "name": "Riya", "clubs": ["coding", "music"]}. Another record may have no clubs key.
Unstructured: her scanned answer sheet and a video of her project talk.
Only the first can be queried with plain SQL; the last needs OCR or speech to text first.
Real-life example
A college office holds a fee register (structured), application forms with optional fields (semi-structured) and boxes of photos and letters (unstructured).
Figure: types of data
Same or opposite: structured and unstructured data
Point
Structured
Unstructured
Same or opposite
Fixed schema
Yes
No
Opposite
Can be stored and analysed
Yes
Yes
Same
Query tool
SQL
Text, image or video analysis
Opposite
Example
Marks table
CCTV video
Opposite
Exam tip. Give the three-type table with an example of each, then list six sources of data. The one student example makes the difference clear.
“Define regression. Give the types of regression.” (Dec 2020)
The short answer
Regression predicts a number (the dependent variable y) from one or more input variables (x) by fitting a line or curve to past data. Linear regression fits a straight line y = a + bx. Logistic regression predicts the probability of a yes or no outcome.
Write these points
Types of regression
Type
Use
Model
Simple linear
One x, numeric y
y = a + bx
Multiple linear
Many x, numeric y
y = a + b₁x₁ + b₂x₂ + ...
Polynomial
Curved relation
y = a + b₁x + b₂x²
Logistic
Yes or no outcome
p = 1 / (1 + e^−(a + bx))
Ridge and lasso
Many x, avoid overfitting
Linear with a penalty on large b
Linear regression by least squares
b = Σ(x − x̄)(y − ȳ) / Σ(x − x̄)² and a = ȳ − b x̄.
The line makes the sum of squared errors as small as possible.
R² tells how much of the change in y the line explains (0 to 1).
Logistic regression
Gives p between 0 and 1 through the sigmoid function.
If p ≥ 0.5 predict yes, else no.
Used for pass or fail, spam or not, loan default or not.
Hours of study and marks out of 10.
x (hours): 1, 2, 3, 4, 5. y (marks): 2, 4, 5, 4, 5. x̄ = 3, ȳ = 4.
b = 6 / 10 = 0.6. a = 4 − 0.6 × 3 = 2.2. Line: y = 2.2 + 0.6x.
A student who studies 6 hours is predicted 2.2 + 3.6 = 5.8 marks.
Logistic: with a = −4, b = 1, a student studying 5 hours gets z = 1, p = 1 / (1 + e^−1) = 0.73, so predict pass.
Real-life example
A shopkeeper who expects to sell more umbrellas the more it rains is using regression in his head. A bank deciding yes or no on a loan uses logistic regression.
Figure: building a regression model
Same or opposite: linear and logistic regression
Point
Linear
Logistic
Same or opposite
Output
Any number
Probability 0 to 1
Opposite
Supervised learning
Yes
Yes
Same
Used for
Prediction of values
Classification
Opposite
Fitting method
Least squares
Maximum likelihood
Opposite
Exam tip. Define regression, give the types table, then the least squares formulas with the five-point numeric. End with the logistic formula and one example.
“What benefits did YARN bring in Hadoop 2.0 and how did it solve the issues of MapReduce v1?” (Dec 2020)
“Write short note on: YARN” (Jun 2025)
The short answer
YARN (Yet Another Resource Negotiator) is the resource management layer added in Hadoop 2.0. It separates resource management from data processing. The old JobTracker of MapReduce v1 is split into a global ResourceManager and one ApplicationMaster per job, so Hadoop can run many kinds of jobs on one cluster.
Write these points
Components
Component
Role
ResourceManager
Master; its Scheduler hands out containers, its ApplicationsManager starts each ApplicationMaster
NodeManager
On every node; starts containers, reports memory and CPU use
ApplicationMaster
One per job; asks for containers, tracks its tasks, restarts failed ones
Container
A bundle of memory and CPU on one node where a task runs
Problems of MapReduce v1 that YARN solved
JobTracker bottleneck: one JobTracker did both scheduling and task tracking for every job; YARN gives each job its own ApplicationMaster.
Scalability: v1 stopped at about 4,000 nodes; YARN runs 10,000 nodes and more.
Fixed slots: v1 had separate map and reduce slots, so free reduce slots sat idle; YARN uses general containers.
Only MapReduce: YARN also runs Spark, Tez, Storm and others on the same data.
Single point of failure: the ResourceManager can run in high availability mode.
How a job runs
The client submits the job to the ResourceManager.
The ResourceManager starts an ApplicationMaster in a container.
The ApplicationMaster asks for containers for its map and reduce tasks.
NodeManagers start the containers and run the tasks.
When the job ends the ApplicationMaster frees its containers.
Sharing a 10-node cluster.
Each node has 16 GB memory for containers, so the cluster has 160 GB.
A MapReduce job needs 40 map tasks of 2 GB: 80 GB. A Spark job asks for 10 executors of 4 GB: 40 GB.
YARN gives 80 GB to the first and 40 GB to the second at the same time and keeps 40 GB free.
In v1 the Spark job could not run on this cluster at all. Free reduce slots also could not take map tasks.
Real-life example
In a hostel mess the manager (ResourceManager) assigns tables, while each group leader (ApplicationMaster) arranges his own group. The manager no longer seats every student himself.
Figure: YARN architecture
Same or opposite: MapReduce v1 and YARN
Point
MapReduce v1
YARN
Same or opposite
Resource manager
JobTracker
ResourceManager
Opposite
Runs MapReduce jobs
Yes
Yes
Same
Other frameworks
No
Yes (Spark, Tez)
Opposite
Cluster size
About 4,000 nodes
10,000 and more
Opposite
Exam tip. Define YARN, draw the ResourceManager with NodeManagers and containers and give the role of each. List the MapReduce v1 problems it solved.
“How is Sqoop different from Flume?” (Dec 2020, Jun 2025)
The short answer
Sqoop (SQL to Hadoop) moves bulk data between relational databases (MySQL, Oracle) and Hadoop, in both directions. Flume collects streaming data such as log files and events from many sources and delivers it into HDFS or HBase. Both bring outside data into Hadoop, but for different kinds of data.
Write these points
Sqoop
import copies a table from an RDBMS into HDFS, Hive or HBase; export sends HDFS data back to a table.
It runs as a map-only MapReduce job; each mapper copies a part of the table in parallel.
Connects through JDBC connectors; can import only new rows (incremental import).
Flume
A Flume agent has three parts: source (receives events), channel (buffers them in memory or a file) and sink (writes them to HDFS or HBase).
Agents can be chained, so logs from hundreds of web servers flow into one cluster.
Reliable: an event leaves the channel only after the sink has stored it.
This copies the students table to HDFS with 4 mappers working in parallel.
Flume: an agent with an exec source tailing /var/log/portal/access.log, a memory channel and an HDFS sink writes every portal click to /logs/portal in near real time.
So the fixed records come in nightly through Sqoop, while the live clicks arrive all day through Flume.
Real-life example
Sqoop is like a truck that carries a full godown of goods to a new warehouse at night. Flume is like a conveyor belt that brings parcels in one by one all day.
Figure: a Flume agent
Same or opposite: Sqoop and Flume
Point
Sqoop
Flume
Same or opposite
Source
RDBMS
Log and event streams
Opposite
Loads data into HDFS
Yes
Yes
Same
Mode
Batch
Streaming
Opposite
Export back to RDBMS
Yes
No
Opposite
Exam tip. Define both, write the Flume agent parts (source, channel, sink) and the Sqoop import command. The comparison table is the core of the answer.
RGPV teaches Data Science to 2 branches under one syllabus. Each branch prints its own code on the paper, but the units are the same. So one page and one PDF serve all of them.
We counted every question in the Data Science papers on this site by topic, from 2020 to 2025. A topic that keeps coming back is a topic RGPV likes, so it sits higher in the table. One branch alone has only a few papers. Counting them together gives a surer list.
Data Science important questions by branch
IT-702-AData Science important questions for IT, Semester 7
IT-702-A follows the same RGPV syllabus as the other codes on this page. The 15 topics and answers above are the IT-702-A important questions too.
What are the most important topics in Data Science?
By how often they were asked in the papers on this site: Big Data: characteristics (the Vs), challenges, applications and its link with data science (4 times); Data analytics lifecycle, analytic sandbox, data cleaning and sampling (4 times); R: features, environment, vectors, R and Python compared, presenting results (4 times); HDFS: architecture, NameNode, DataNode and secondary NameNode (3 times); HBase: key components and storage mechanism (3 times).
How were these Data Science important questions chosen?
Each topic was counted from the questions in the past papers listed on this site (2020-2025). Repeated is the number of times the topic came. The counts come from keyword matching and the answers are not teacher-reviewed, so use them together with your syllabus.
Is there a PDF of Data Science important questions with answers?
Yes. The Paperwala Imp Question & Answer PDF for Data Science is free to download from this page.
The 15 most repeated topics of Data Science (IT-702-A) for RGPV B.Tech IT semester 7, counted from the previous year papers on this site. The same syllabus is taught under 2 codes: IT-702-A, CI-801.