IT-702-A CI-801 Data Science

Data Science Important Questions

RGPV · B.Tech · IT · Semester 7 · Current scheme · 3 papers (2020 to 2025)

  1. Read the answers

    Start with the topics that come every year.

  2. Revise unit notes

    Go through each unit once to score more.

Paperwala Imp Topics - Data Science important questions

Download Paperwala Imp Question & Answer (PDF)

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

  1. 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.
  2. Velocity: the speed at which data arrives and must be handled. UPI payments, stock prices and sensor readings come in every second.
  3. 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.
  4. 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.
  5. Value: the useful result we get from the data. Data that never helps a decision is only a storage bill.
  6. 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

  1. Storage: spread the data over many machines (HDFS) with copies for safety.
  2. Scalability: add machines when data grows, instead of buying one bigger server.
  3. Speed: process in parallel (MapReduce, Spark) and handle streams in real time.
  4. Data quality: clean errors, duplicates and missing values before analysis.
  5. Security and privacy: control access and protect personal data.
  6. Cost: use cheap hardware and open source tools.

Challenges with big data

  1. Storage of data that grows by terabytes every day.
  2. Processing speed: results are needed in time, often in real time.
  3. Data quality: errors, duplicates and fake entries (veracity).
  4. Mixing types: joining tables, text, images and logs.
  5. Security and privacy of personal data.
  6. Skilled people who know both the tools and the business are few.

Applications of big data analytics

FieldUse
Retail and e-commerceProduct recommendations, stock planning
BankingFraud detection on card and UPI payments
HealthcareDisease prediction, hospital bed planning
TransportRoute planning, surge pricing in cab apps
TelecomPredicting which customers will leave
GovernmentTraffic 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
Figure: the V's of big data

Same or opposite: volume and variety

PointVolumeVarietySame or opposite
MeaningHow much dataHow many forms of dataOpposite
ExamplePetabytes of photosTables, JSON, images, videoOpposite
Tool that helpsHDFSNoSQL storesOpposite
One of the V'sYesYesSame

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.

Back to the topic list

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

  1. Discovery: learn the business area, frame the problem, list stakeholders, form initial hypotheses and check the data and tools available.
  2. Data preparation: set up the analytic sandbox, then extract, load and transform the data (ETLT), clean it and explore it.
  3. Model planning: choose the variables and the methods (clustering, regression, decision tree) and plan the workflow.
  4. Model building: split data into training and test sets, build the model and check it on the test set.
  5. Communicate results: compare results with the success criteria, state findings, value and limits to the stakeholders.
  6. 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

  1. Missing values: drop the row, or fill with the mean, median or most common value.
  2. Duplicates: remove repeated records.
  3. Wrong or impossible values: marks of 250 out of 100, a date of 31 February; fix or remove.
  4. Inconsistent formats: "CSE", "C.S.E." and "Computer Sc." made one value.
  5. 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
Figure: the six phases of the data analytics lifecycle

Same or opposite: data preparation and model building

PointData preparationModel buildingSame or opposite
Main workClean, join, transform dataTrain and test modelsOpposite
Part of the lifecycleYesYesSame
Uses the sandboxYesYesSame
OutputClean data setA tested modelOpposite

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.

Back to the topic list

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

PointRPython
Made forStatistics and graphsGeneral programming
Modelling librariescaret, randomForest, glm in base Rscikit-learn, TensorFlow, PyTorch
Graphsggplot2, base plots: very strongmatplotlib, seaborn
Deployment in appsHarder (Shiny, plumber)Easier (web apps, APIs)
LearningEasy for statisticiansEasy 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.
  • hist(), plot(), boxplot() draw graphs; lm() fits linear regression; glm() logistic regression.
  • 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

  1. Start with the key finding in one sentence for the audience.
  2. Show it with a clear graph (ggplot2): bar chart, box plot or line chart.
  3. Write the report in R Markdown, which mixes text, code and graphs and exports to PDF or HTML.
  4. Build an interactive dashboard with Shiny when users want to explore.
  5. 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

ComponentRole
R consoleRuns 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 systemhelp(mean) or ?mean shows the manual
Graphics deviceWindow 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.

marks[2] is 65; marks[marks > 70] gives 78 81; sort(marks) gives 52 65 78 81.

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
Figure: from analysis to a report in R

Same or opposite: R and Python

PointRPythonSame or opposite
Main purposeStatisticsGeneral programmingOpposite
Free and open sourceYesYesSame
Best atGraphs, statisticsMachine learning in appsOpposite
Report toolR Markdown, ShinyJupyter notebookOpposite

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.

Back to the topic list

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

  1. 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.
  2. DataNode (worker): stores the real blocks on its local disk. It sends a heartbeat every 3 seconds and a block report to the NameNode.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
CommandWhat it does
hdfs dfs -mkdir /dataMake a folder in HDFS
hdfs dfs -put sales.csv /dataCopy a local file into HDFS
hdfs dfs -ls /dataList files with size and replication
hdfs dfs -cat /data/sales.csvPrint a file
hdfs dfs -get /data/sales.csv .Copy a file back to local disk

Steps

  1. Write: the client asks the NameNode to create the file. The NameNode checks permissions and gives a list of DataNodes for each block.
  2. 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.
  3. 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

PointRegular file system (NTFS, ext4)HDFS
Runs onOne machineA cluster of many machines
Block size4 KB128 MB
Failure handlingA disk failure loses dataEach block kept 3 times on different nodes
Access patternRead and write anywhere in a fileWrite once, read many times
Best forMany small filesA 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 times
Figure: HDFS, one NameNode and DataNodes that hold each block three times
Figure: writing a file to HDFS
Figure: writing a file to HDFS

Same or opposite: HDFS write and HDFS read

PointWriteReadSame or opposite
Client first contactsNameNodeNameNodeSame
Data goesThrough a pipeline of DataNodesFrom the nearest DataNodeOpposite
Copies made3 by defaultNoneOpposite
NameNode handles the data itselfNoNoSame

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.

Back to the topic list

Q5. HBase: key components and storage mechanism

Asked 3 times in 2020, 2024, 2025 · Unit 4

From the papers

  • “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

ComponentRole
HMasterAssigns regions to RegionServers, handles table create and delete, balances load
RegionServerServes reads and writes for its regions
RegionA range of row keys of one table; split when it grows too large
ZooKeeperTracks live servers, holds the location of the META table, helps elect the master
HDFSStores the WAL and HFiles with replication

Storage mechanism (write path)

  1. The write goes first to the WAL (write-ahead log) so it survives a crash.
  2. Then it goes to the MemStore, a sorted buffer in memory, one per column family.
  3. When the MemStore is full it is flushed to disk as an HFile in HDFS.
  4. Many small HFiles are merged by compaction: minor compaction joins a few; major compaction rewrites all and removes deleted cells.
  5. 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
Figure: HBase components and the write path

Same or opposite: HBase and an RDBMS

PointHBaseRDBMSSame or opposite
SchemaOnly column families fixedEvery column fixedOpposite
Stores data in tablesYesYesSame
Joins and SQLNo (no native SQL)YesOpposite
ScaleThousands of serversMostly one serverOpposite

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.

Back to the topic list

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

  1. Choose k and pick k starting centroids.
  2. Put each point in the cluster of its nearest centroid (Euclidean distance).
  3. Recompute each centroid as the mean of its points.
  4. 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}.

New centroids: c1 = (1, 1), c2 = ((2+3+4+5)/4, (1+3+2+5)/4) = (3.5, 2.75).

Round 2: B is 1 from c1 and 2.30 from c2, so B moves. C is 0.56 from c2, D 0.90, E 2.70. Clusters {A, B} and {C, D, E}.

New centroids: c1 = (1.5, 1), c2 = (4, 3.33).

Round 3: A and B stay nearer c1 (0.5 each), C, D, E stay nearer c2 (1.05, 1.33, 1.94). Nothing moves, so stop.

Answer: cluster 1 = {(1,1), (2,1)}, cluster 2 = {(3,3), (4,2), (5,5)}.

Agglomerative and divisive hierarchical clustering

PointAgglomerativeDivisive
DirectionBottom up: start with each point alone, merge the two closest clustersTop down: start with one cluster, split it
Stops whenOne cluster is left or k is reachedEach point is alone or k is reached
CostLower, more commonHigher
ExampleAGNESDIANA

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 points
Figure: K-means on the five points
Figure: a dendrogram from agglomerative clustering
Figure: a dendrogram from agglomerative clustering

Same or opposite: K-means and hierarchical clustering

PointK-meansHierarchicalSame or opposite
Needs k in advanceYesNoOpposite
UnsupervisedYesYesSame
OutputFlat clustersTree (dendrogram)Opposite
Large dataFastSlowOpposite

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.

Back to the topic list

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

  1. Count each item. Keep those with support ≥ min support: L₁.
  2. Join Lₖ₋₁ with itself to make candidates Cₖ.
  3. Prune: drop any candidate with an infrequent subset. Every subset of a frequent set must be frequent (the Apriori property).
  4. Scan the data to count Cₖ. Keep the frequent ones as Lₖ. Repeat until no new set is found.
  5. 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.

Itemsets meeting 0.5: {A}, {B}, {C}, {E}, {A, C}, {B, C}, {B, E}, {C, E}, {B, C, E}.

Interesting rules and coincidental rules

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
Figure: Apriori loop

Same or opposite: support and confidence

PointSupportConfidenceSame or opposite
MeasuresHow often the items appear togetherHow often Y comes when X comesOpposite
Formulacount(X ∪ Y) / Ncount(X ∪ Y) / count(X)Opposite
Same for X → Y and Y → XYesNoOpposite
Has a minimum thresholdYesYesSame

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.

Back to the topic list

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

  1. Start with all training records at the root.
  2. Entropy of a set: E(S) = −Σ pᵢ log₂ pᵢ.
  3. Information gain of attribute A: Gain(A) = E(S) − Σ (|Sᵥ| / |S|) E(Sᵥ).
  4. Split on the attribute with the highest gain. Repeat on each branch.
  5. Stop when all records in a node have one class, or no attributes are left (take the majority).
  6. C4.5 uses gain ratio. CART uses the Gini index. Pruning removes branches that only fit noise.

Play tennis data: 9 yes, 5 no.

E(S) = −(9/14)log₂(9/14) − (5/14)log₂(5/14) = 0.940.

Outlook splits into sunny (2 yes, 3 no), overcast (4, 0), rain (3, 2).

Gain(Outlook) = 0.940 − (5/14 × 0.971 + 4/14 × 0 + 5/14 × 0.971) ≈ 0.247. It is the highest, so Outlook is the root.

Advantages

  • Easy to understand and turn into rules.
  • No need to scale data. Handles numbers and categories.
  • Fast to build and to use.

Classification of decision trees

BasisKinds
TargetClassification tree (class label) and regression tree (number)
AlgorithmID3 (information gain), C4.5 (gain ratio), CART (Gini index, binary splits)
SplitsBinary (two branches) or multiway

Naive Bayes classification

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.

Spam: P(spam) × P(offer | spam) = 0.4 × 0.75 = 0.30.

Not spam: 0.6 × 1/6 = 0.10.

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 computer
Figure: a decision tree for buys computer
Figure: Building a decision tree (ID3)
Figure: Building a decision tree (ID3)

Same or opposite: information gain and Gini index

PointInformation gainGini indexSame or opposite
Used byID3CARTOpposite
Based onEntropySquared class sharesOpposite
Picks the best splitYesYesSame
Tree typeMany-way splitsBinary splitsOpposite

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.

Back to the topic list

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

  1. Pseudocode for word count: map(offset, line): for each word w in line: emit(w, 1). reduce(w, counts): emit(w, sum(counts)).
  2. Where it is used: log analysis, counting clicks, building search indexes, ETL jobs and large joins.
  3. 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

  1. 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).
  2. Map: the mapper runs once per record and emits intermediate pairs. They go to the local disk of that node, not to HDFS.
  3. 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.
  4. Partition: the partitioner picks the reducer for each key, by default hash(key) mod number of reducers.
  5. Shuffle and sort: each reducer copies its pairs from all mappers. The pairs are sorted and grouped by key.
  6. 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

FormatWhat it gives the mapper or writesExample
TextInputFormat (default)Key = byte offset, value = the lineLog files
KeyValueTextInputFormatSplits each line at a tab into key and valueroll and marks files
NLineInputFormatN lines per mapperOne URL per line, 100 per mapper
SequenceFileInputFormatBinary key and value pairsOutput of an earlier job
TextOutputFormat (default)Writes key TAB value linespart-r-00000
SequenceFileOutputFormatBinary output for the next jobChained 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 reduce
Figure: word count in MapReduce, through map, shuffle and reduce
Figure: phases of a MapReduce job
Figure: phases of a MapReduce job

Same or opposite: combiner and reducer

PointCombinerReducerSame or opposite
Runs onMapper's nodeReducer nodeOpposite
RequiredNo, optionalYesOpposite
Output goes toShuffleHDFSOpposite
Combines values of one keyYesYesSame

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.

Back to the topic list

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

  1. User interfaces: the CLI or Beeline, a web UI such as Hue or JDBC and ODBC programs that connect through HiveServer2.
  2. Driver: receives the query, opens a session and controls the query from start to end.
  3. Compiler: parses the query, checks tables and columns against the metastore and builds an execution plan, a DAG of stages.
  4. Optimizer: improves the plan, for example by pushing filters down, skipping unused partitions and choosing a map-side join.
  5. Execution engine: runs the stages on the cluster through YARN and collects the result.
  6. 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.
  7. 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

  1. The UI sends the query to the driver (execute query).
  2. The driver asks the compiler for a plan. The compiler gets the table details from the metastore.
  3. The compiler returns the plan. The driver hands it to the execution engine.
  4. The engine runs the jobs on Hadoop. The jobs read and write data in HDFS.
  5. 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

PointHivePig
LanguageHiveQL, like SQL (declarative)Pig Latin, step by step (procedural)
Made byFacebookYahoo
Used byAnalysts who know SQLProgrammers building data flows
DataMostly structured, tables with schemaStructured and semi-structured
SchemaKept in the metastoreOptional, given in the script
Best forReports and queriesETL 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

  1. Write a Java class that extends UDF (or GenericUDF) with an evaluate() method.
  2. Compile it and pack it in a jar file.
  3. In Hive: ADD JAR /home/riya/upper.jar;
  4. CREATE TEMPORARY FUNCTION to_upper AS 'com.pw.ToUpper';
  5. 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 HDFS
Figure: Hive architecture, from HiveQL to jobs on HDFS
Figure: how Hive runs a query
Figure: how Hive runs a query

Same or opposite: Hive and Pig

PointHivePigSame or opposite
LanguageHiveQL, like SQLPig Latin, data flowOpposite
Used byAnalysts who know SQLProgrammers, ETL workOpposite
SchemaStored in the metastoreGiven in the scriptOpposite
Runs on HadoopYesYesSame

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.

Back to the topic list

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

  1. Hadoop Common: the shared Java libraries and scripts every other part uses.
  2. HDFS: the storage layer. It splits files into blocks and keeps three copies of each.
  3. YARN (Yet Another Resource Negotiator): the resource manager. The ResourceManager hands out containers of CPU and memory. A NodeManager on each node runs them.
  4. MapReduce: the processing model. Map tasks work on blocks in parallel and reduce tasks combine their results.
  5. 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.
  6. 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 toolJob
HiveSQL-like queries (HiveQL) on HDFS data
PigData flow scripts in Pig Latin
HBaseColumn-family NoSQL store on HDFS
Sqoop / FlumeImport from databases / stream in logs
SparkFast in-memory processing
Oozie / ZooKeeperJob scheduling / cluster coordination
MahoutMachine 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.

Hadoop shell commands

TaskSyntaxExample
Copy from local to HDFShdfs dfs -copyFromLocal <local src> <hdfs dest>hdfs dfs -copyFromLocal marks.txt /user/riya/input
Show the content of an output filehdfs dfs -cat <hdfs file>hdfs dfs -cat /user/riya/output/part-r-00000
List fileshdfs dfs -ls <path>hdfs dfs -ls /user/riya
Copy from HDFS to localhdfs dfs -copyToLocal <hdfs src> <local dest>hdfs dfs -copyToLocal /user/riya/output .

Hadoop and a traditional database

PointTraditional RDBMSHadoop
DataStructuredStructured, semi-structured, unstructured
SchemaOn write: fixed before loadingOn read: applied when data is used
ScaleScale up: a bigger serverScale out: add cheap machines
SizeGigabytes to a few terabytesTerabytes to petabytes
SpeedFast small queries and updatesHigh throughput batch work
CostLicensed software, costly hardwareOpen source, commodity hardware

Real-life example

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 top
Figure: the Hadoop stack, HDFS and YARN at the base and the ecosystem on top
Figure: the Hadoop ecosystem
Figure: the Hadoop ecosystem

Same or opposite: HDFS and MapReduce

PointHDFSMapReduceSame or opposite
LayerStorageProcessingOpposite
MasterNameNodeResourceManager (YARN)Opposite
Core part of HadoopYesYesSame
Works on blocks across many nodesYesYesSame

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.

Back to the topic list

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

PointStructuredSemi-structuredUnstructured
FormatFixed schema, rows and columnsTags or keys, flexible schemaNo fixed format
ExamplesBank tables, marks sheetJSON, XML, e-mail headersPhotos, videos, PDF text, tweets
Stored inRDBMS (MySQL)NoSQL (MongoDB), filesHDFS, object storage
Share of all dataAbout 10 to 20%SmallAbout 80%
Easy to queryYes, with SQLPartlyNo, 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

  1. Internal business data: sales, accounts, customer records.
  2. Social media and the web: posts, reviews, clicks.
  3. Machine and sensor data: IoT devices, GPS, server logs.
  4. Transactions: card swipes, UPI payments, bills.
  5. Public and government data: census, open data portals.
  6. 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
Figure: types of data

Same or opposite: structured and unstructured data

PointStructuredUnstructuredSame or opposite
Fixed schemaYesNoOpposite
Can be stored and analysedYesYesSame
Query toolSQLText, image or video analysisOpposite
ExampleMarks tableCCTV videoOpposite

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.

Back to the topic list

Q13. Regression: linear and logistic

Asked 2 times in 2020, 2024 · Unit 2

From the papers

  • “Explain linear regression.” (May 2024)
  • “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

TypeUseModel
Simple linearOne x, numeric yy = a + bx
Multiple linearMany x, numeric yy = a + b₁x₁ + b₂x₂ + ...
PolynomialCurved relationy = a + b₁x + b₂x²
LogisticYes or no outcomep = 1 / (1 + e^−(a + bx))
Ridge and lassoMany x, avoid overfittingLinear 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.

Σ(x − x̄)(y − ȳ) = (−2)(−2) + (−1)(0) + 0(1) + 1(0) + 2(1) = 6. Σ(x − x̄)² = 4 + 1 + 0 + 1 + 4 = 10.

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
Figure: building a regression model

Same or opposite: linear and logistic regression

PointLinearLogisticSame or opposite
OutputAny numberProbability 0 to 1Opposite
Supervised learningYesYesSame
Used forPrediction of valuesClassificationOpposite
Fitting methodLeast squaresMaximum likelihoodOpposite

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.

Back to the topic list

Q14. YARN and Hadoop 2.0 resource management

Asked 2 times in 2020, 2025 · Unit 3

From the papers

  • “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

ComponentRole
ResourceManagerMaster; its Scheduler hands out containers, its ApplicationsManager starts each ApplicationMaster
NodeManagerOn every node; starts containers, reports memory and CPU use
ApplicationMasterOne per job; asks for containers, tracks its tasks, restarts failed ones
ContainerA bundle of memory and CPU on one node where a task runs

Problems of MapReduce v1 that YARN solved

  1. JobTracker bottleneck: one JobTracker did both scheduling and task tracking for every job; YARN gives each job its own ApplicationMaster.
  2. Scalability: v1 stopped at about 4,000 nodes; YARN runs 10,000 nodes and more.
  3. Fixed slots: v1 had separate map and reduce slots, so free reduce slots sat idle; YARN uses general containers.
  4. Only MapReduce: YARN also runs Spark, Tez, Storm and others on the same data.
  5. Single point of failure: the ResourceManager can run in high availability mode.

How a job runs

  1. The client submits the job to the ResourceManager.
  2. The ResourceManager starts an ApplicationMaster in a container.
  3. The ApplicationMaster asks for containers for its map and reduce tasks.
  4. NodeManagers start the containers and run the tasks.
  5. 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
Figure: YARN architecture

Same or opposite: MapReduce v1 and YARN

PointMapReduce v1YARNSame or opposite
Resource managerJobTrackerResourceManagerOpposite
Runs MapReduce jobsYesYesSame
Other frameworksNoYes (Spark, Tez)Opposite
Cluster sizeAbout 4,000 nodes10,000 and moreOpposite

Exam tip. Define YARN, draw the ResourceManager with NodeManagers and containers and give the role of each. List the MapReduce v1 problems it solved.

Back to the topic list

Q15. Sqoop and Flume: integrating data sources

Asked 2 times in 2020, 2025 · Unit 4

From the papers

  • “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.

How Sqoop differs from Flume

PointSqoopFlume
Data sourceRelational databasesStreams: logs, events, social feeds
Data typeStructuredSemi-structured, unstructured
LoadingBulk, in batchesContinuous, as events arrive
DirectionImport and exportInto Hadoop only
ArchitectureConnector based, map-only jobsAgent with source, channel, sink

Bringing a college's data into Hadoop.

Sqoop: sqoop import --connect jdbc:mysql://dbserver/college --table students --target-dir /data/students -m 4

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
Figure: a Flume agent

Same or opposite: Sqoop and Flume

PointSqoopFlumeSame or opposite
SourceRDBMSLog and event streamsOpposite
Loads data into HDFSYesYesSame
ModeBatchStreamingOpposite
Export back to RDBMSYesNoOpposite

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.

Back to the topic list

How we picked these questions

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-A Data 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.

See all 3 IT-702-A previous year papers

CI-801 Data Science important questions for CSIT, Semester 8

CI-801 follows the same RGPV syllabus as the other codes on this page. The 15 topics and answers above are the CI-801 important questions too.

See all 1 CI-801 previous year paper

Start with the latest papers

Data Science - Jun 2025

Data Science - Nov 2023

Data Science - Dec 2020

See all 3 papers →

Data Science (IT-702-A) FAQs

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.