The canteen file that Excel could not open
The college canteen switched to QR payments last year, and its billing app keeps a record of every order. The owner asks Riya to “just open the file in Excel and tell me what sells most”. The file is called orders.csv. Excel opens it, thinks for a while, and shows: File not loaded completely.
Sir, the canteen file is too big for Excel. So this is big data, right?
Not yet, Riya. About thirteen and a half lakh rows is too many for Excel, which stops at 10,48,576 rows. But a laptop with Python can read that file in a few seconds. Big data starts when even a good server struggles.
Then what is big data? Just… a really, really big file?
Size is only one part. Think of UPI as a whole: every single month it handles more than ten billion payments. They arrive every second, in different formats, some are duplicated or broken, and the bank must spot fraud within moments. That's Volume, Velocity, Variety, Veracity and Value.
The 5 Vs! I've seen that in the syllabus.
Sir, can I join in? I'm Riya's friend Kabir. I have an internship offer from TiffinGo, a food-delivery startup in Pune, starting next semester. They told me their data is “big”. How will I know if it really is?
Welcome, Kabir. That is exactly the right question. Today you won't just memorise the 5 Vs. You'll measure them on real data with Python, estimate sizes with simple arithmetic, and see why each V breaks the normal tools.
And the advanced part?
How engineers put a number on each V, why systems are built for the peak and not the average, and why old data is moved to cheaper storage as its value falls.
What is big data?
Big data refers to data sets whose volume, velocity or variety is so large that traditional tools, such as a single relational database or a spreadsheet on one machine, cannot capture, store, process and analyse them within an acceptable time and cost. It is commonly described by the 5 Vs: Volume, Velocity, Variety, Veracity and Value.
Big data is data that is too big, arrives too fast, or is too mixed for one computer and normal software to handle. It is often messy, and it's only worth collecting if you can get something useful out of it.
Words you'll meet in this lesson
How big is big? Units of data
| Unit | Size | To picture it |
|---|---|---|
| Byte | 8 bits | One English letter, such as A |
| KB (kilobyte) | 1,024 bytes | About 4 UPI payment records (≈ 250 bytes each) |
| MB (megabyte) | 1,024 KB | One phone photo is 2–5 MB |
| GB (gigabyte) | 1,024 MB | A full-length movie, or about 43 lakh payment records |
| TB (terabyte) | 1,024 GB | A typical laptop disk; about 440 crore payment records |
| PB (petabyte) | 1,024 TB | The data platforms of large banks, telecom and e-commerce companies |
| EB (exabyte) | 1,024 PB | Total storage of the very largest internet companies |
| ZB (zettabyte) | 1,024 EB | Industry estimates put the data the whole world creates in a year at well over 100 ZB |
| YB (yottabyte) | 1,024 ZB | No organisation stores anything close to this yet |
Two ways of counting: computers count in powers of 2 (1 KB = 1,024 bytes; the official names are KiB, MiB, GiB), while disk makers count in powers of 10 (1 kB = 1,000 bytes). That is why a “1 TB” disk shows about 931 GB on your computer.
Quick memory trick: each step up is about a thousand times bigger. “Kids Make Great Tea, Papa Enjoys Zero Yelling” gives KB, MB, GB, TB, PB, EB, ZB, YB in order.
The 5 Vs at three levels
Beginner Big data in your own phone
You already use big data systems every day. Each app below is dealing with all five Vs at once:
- UPI: billions of payments a month (volume), each answered in about a second (velocity).
- YouTube and Instagram: videos, photos, comments and likes together (variety).
- Google Maps: live speed from millions of phones, some of them wrong or stale (veracity).
- Shopping apps: “customers also bought” suggestions that increase sales (value).
Easy test: if one laptop or one database can store it and answer in time, it is not big data yet, however important it is.
Intermediate Putting a number on each V
Engineers don't say “we have a lot of data”. They measure each V:
| V | What engineers measure | Example |
|---|---|---|
| Volume | TB stored, GB added per day, growth per year | 78 GB of new payments a day, growing 40% a year |
| Velocity | Events per second (average and peak), allowed delay (latency) | 4,000/s average, 30,000/s peak, reply within 1 s |
| Variety | Number of sources and formats, how often their structure changes | 12 sources: tables, JSON, logs, images |
| Veracity | % duplicates, % missing values, % failing checks | 0.4% duplicates from retries |
| Value | Money saved or earned vs cost to store and process | Fraud blocked worth ₹2 crore vs ₹15 lakh platform cost |
More Vs you may see: Variability (the rate or meaning changes, such as order spikes on festivals, or the word “cool” meaning cold or nice) and Visualisation (showing huge data so people can understand it). Some books list 7 or even 10 Vs; most university syllabi ask for 5.
Advanced Peaks, value decay and the cost of keeping data
- Design for the peak: the peak-to-average ratio (peak events per second ÷ average) decides capacity. A system that copes with the average fails on Diwali night or after a cricket final.
- Value falls with age: a payment record is worth most in the first second (fraud check), less after a day (disputes), and much less after a year (audits, model training). So data moves from hot (fast, costly) to warm to cold (cheap archive) storage, and is deleted or anonymised when retention ends.
- Law sets minimums: Indian anti-money-laundering rules require banks to keep transaction records for at least five years, and the RBI requires payment-system data to be stored in India. Retention and location are design inputs, not afterthoughts.
- Working set vs total data: a company may store 2 PB but query only the last 30 days (40 TB) daily. Size the compute for the working set and the storage for the total.
- Don't over-engineer: a 5 GB problem on a Spark cluster is slower and costlier than one good machine. The right question is always “which V actually breaks our current tool?”
Exam tip: The first three Vs (Volume, Velocity, Variety) were described by analyst Doug Laney in 2001. Veracity and Value were added later by industry. If a question asks for “3 Vs”, write the first three; for “5 Vs”, write all five with one example each.
The 5 Vs, one by one
1. Volume: how much
The total amount of data. Terabytes and petabytes, not megabytes. A bank stores every transaction for years because regulators require it.
Size2. Velocity: how fast
The speed at which data arrives and must be handled. Thousands of payments per second at lunchtime, each needing an answer in a second or two.
Speed3. Variety: how mixed
Different shapes of data: tables, JSON, logs, photos, voice notes, reviews. One system must store and use all of them.
Formats4. Veracity: how trustworthy
Real data is messy: duplicates, missing fields, wrong values, fake accounts. You must clean and check before you trust a number.
Quality5. Value: how useful
Data costs money to store. It is only worth it if it leads to decisions: stopping fraud, recommending products, planning stock.
PurposeThree kinds of data (Variety in detail)
| Kind | What it looks like | Examples | Stored in |
|---|---|---|---|
| Structured | Fixed columns, fixed types | Bank transactions table, marks sheet, inventory | RDBMS (MySQL, Oracle), data warehouse |
| Semi-structured | Labelled fields, shape can vary | JSON from an app, server log lines, XML, email headers | NoSQL (MongoDB), data lake files |
| Unstructured | No fields at all | CCTV video, call recordings, scanned PDFs, tweets, product photos | Object storage (HDFS, Amazon S3) + special processing |
Most estimates say that the large majority of the world's new data is unstructured or semi-structured. That is one big reason traditional table-only databases are not enough. Lesson 2.1 goes deeper into each kind, and Lesson 2.2 into the file formats used to store them.
Is it big data? A quick test
Not big data
A school's marks of 2,000 students. One MySQL table or one Excel sheet handles it easily, even with complex reports.
SmallBorderline
The canteen’s 13.5 lakh orders. Too big for Excel, but one laptop with Python or one database handles it in seconds.
MediumBig data
All UPI payments in India, every second, with fraud checks in real time, stored for years. No single machine can do this.
BigRule of thumb: data is “big” when you need more than one machine to store it or process it in time. That's exactly what the next two lessons explain.
Follow one ₹20 chai payment through the 5 Vs
One payment becomes one record
This record is about 130 characters. With extra fields that real systems keep (device, location, bank codes), a payment record is a few hundred bytes. Small. On its own, this is not big data.{"txn_id": "T1001", "payer": "riya@okbank", "payee": "canteen@upi", "amount": 20, "time": "2026-10-19 08:01:07", "status": "SUCCESS"}Volume: multiply by everyone
About 2.3 TB a month just for the basic records, and banks keep them for years, with copies for safety. Add logs, fraud scores and app clicks, and you are into petabytes.per_record = 250 # bytes per_month = 10_000_000_000 # 10 billion payments print(per_record * per_month / 1024**4, "TB per month")2.2737367544323206 TB per monthVelocity: they don't arrive evenly
Nearly 4,000 per second on average. At lunch, on salary day or during a sale, the peak is several times higher. Each one needs a fraud check and a reply in about a second.per_second_avg = 10_000_000_000 / (30 * 24 * 3600) print(round(per_second_avg), "payments per second on average")3858 payments per second on averageVariety: the payment is not alone
Around the same payment, the systems also receive the app's click logs (JSON), an SMS (text), the canteen's menu photo, and Riya's 5-star review with a comment.
One table cannot hold all of these. Big data platforms store raw files of any format in a data lake, and process each kind with suitable tools.Veracity: some records are wrong
Riya's network dropped once, so the app retried and the same
If you sum blindly, the canteen's income is wrong. Pipelines remove duplicates, reject invalid rows and log them for checking. Clean data first, numbers later.T1001arrived twice. Another record has"amount": -20, and one has nopayerat all.Value: turn records into decisions
After cleaning, patterns appear: chai sells most at 8 am and 4 pm; samosas run out by 1 pm; one account is paying from five cities in ten minutes.
The canteen stocks more samosas before 1 pm, and the bank blocks the suspicious account. Storing data has a cost; value is what pays for it.
A ₹20 payment: what Riya sees, and what the data platform sees
Step through the six frames. Left: Riya's phone. Right: the same moment for the systems behind it.
- Riya scans the canteen's QR code and pays ₹20 for a cutting chai.
- A green tick: Payment successful. For her, the story ends here.
- Her bank sends an SMS and the app shows a notification, both within a second.
- She rates the chai five stars, writes a short review and adds a photo.
- Earlier that week, a payment showed Pending because the network was weak, and the app retried it.
- Next day the app offers cashback, and the canteen announces fresh samosas at the time they usually run out.
- The payment becomes one record: a few hundred bytes of semi-structured JSON.
- Volume: about 10 billion such records a month is roughly 2.3 TB, kept for years with backup copies. That needs many disks on many machines.
- Velocity: payments arrive at about 4,000 per second on average, and far more at peak. Every one is checked for fraud before the reply goes back.
- Variety: the same moment produces a table row, JSON logs and text, and an unstructured photo and review.
- Veracity: the retry created a duplicate, and other records are broken. Adding them blindly gives a wrong total. Pipelines clean the data first.
- Value: clean data, grouped by hour, shows when samosas run out and who the regular customers are. Decisions follow.
Traditional data vs big data
| Traditional data | Big data | |
|---|---|---|
| Size | MB to a few GB | TB to PB and beyond |
| Arrives | In batches: daily, monthly | Continuously, thousands of records per second |
| Shape | Mostly structured tables | Structured + semi-structured + unstructured |
| Runs on | One server or one PC | A cluster of many machines |
| Typical tools | Excel, MySQL, Oracle | HDFS, Hadoop, Spark, Kafka, Hive, NoSQL, cloud storage |
Real-time scenarios: the 5 Vs under pressure
Three live scenarios: velocity breaking a single server on match night, all five Vs lighting up in the first seconds of a midnight sale, and an advanced one about how a record's value falls with age and where it should be stored at each stage.
Real-time scenario 1Cricket final night at a food-delivery app
On a normal evening, orders arrive steadily. During a big cricket final, they come in waves: at the toss, in the innings break, and after the last ball. Watch velocity break a single database, and a big data setup absorb it.
- Normal evening: orders arrive at a steady rate. One database server handles them comfortably.
- Toss: a small spike as people order snacks before the match. Still fine.
- Innings break: lakhs of people order at the same minute. The single server's queue starts to grow.
- Trouble: orders time out and customers see errors. A bigger server helps only up to a point, and is costly all year for one night's peak.
- Big data design: orders flow into a stream such as Kafka, and many machines process them in parallel. More machines can be added for big nights. Numbers here are illustrative.
Midnight sale: all five Vs in the first ten minutes
An online shop's big festive sale starts at 00:00. The data team sits in front of a live dashboard. Watch each V light up as crores of shoppers arrive at once.
- 23:58: a normal night at about 3,000 orders per second. All five tiles on the dashboard are calm.
- 00:00:05: the sale opens. Orders jump to about 60,000 per second (velocity), and around a crore cart events pile up in ten minutes (volume).
- Variety: in the same second the platform receives payment JSON, search text, product photos and support chats. Each needs different storage and processing.
- Veracity: bots hammer the add-to-cart button and network retries send duplicate payments. They are filtered in the stream before any number is shown.
- Value: the clean, live numbers show Phone X selling out in Pune but not Mumbai. The team moves stock and pauses ads within minutes. (All numbers are illustrative.)
The life of one payment record: value falls, so cost must fall too
Riya's ₹20 chai payment is stored for years. But it is not equally useful all that time. Follow the record as it ages and see where a sensible platform keeps it at each stage.
- First second: the record sits in the stream processor's memory while the fraud check runs. Memory is the costliest storage, but this is when the record is most valuable.
- First days: Riya may check her history or raise a dispute, so the record stays in a fast hot database.
- After a month: it is used mainly for statements and analytics, so it moves to warm storage in the warehouse or lake.
- After a year: it is rarely read, but needed for audits and for training fraud models. It moves to a cold archive that costs a small fraction per GB.
- End of retention: once the legal minimum has passed (for example, at least five years for bank transaction records under India's anti-money-laundering rules), it is deleted or anonymised according to policy.
Where else the 5 Vs show up at work
1. Banks: catching fraud in real time
Every card and UPI payment is scored for fraud within moments: is this device new, is the location unusual, is the amount strange for this customer? That's velocity (answer fast), volume (years of history per customer) and veracity (don't block genuine payments).
2. E-commerce: “customers also bought”
Shopping sites record every search, click, cart and purchase from crores of users. Big data jobs find patterns overnight, and recommendations update as you browse. Variety matters: product photos, reviews and clicks are used together.
3. Ride-hailing: surge pricing and ETAs
Cabs send GPS locations every few seconds. The platform combines millions of location points with ride requests to estimate arrival times and set prices zone by zone. That's velocity and volume at once.
4. Telecom: network health from call records
Mobile operators collect a record for every call, SMS and data session, plus logs from every tower. Analysing them finds congested towers, dropped-call hotspots and customers likely to switch operators.
5. Agriculture and weather
Satellite images (unstructured, huge) and weather-station readings are combined to estimate crop health, forecast rain and plan insurance payouts for farmers. Each image alone can be hundreds of megabytes.
Examples are simplified to show where each V matters. Real setups vary by company.
Measure the 5 Vs yourself
A tiny slice of the canteen's data: six payment records as JSON text, two photos and a review. The program measures each V. Read it first, then try the challenges, which include an Excel-limit calculator, a size converter and a record that breaks the program.
import json
# Six payment events, as they arrive from the app (JSON text)
events = [
'{"id": "T1", "item": "chai", "amount": 20, "sec": 1}',
'{"id": "T2", "item": "vada pav", "amount": 25, "sec": 1}',
'{"id": "T3", "item": "chai", "amount": 20, "sec": 2}',
'{"id": "T2", "item": "vada pav", "amount": 25, "sec": 1}',
'{"id": "T4", "item": "samosa", "amount": -15, "sec": 2}',
'{"id": "T5", "item": "chai", "amount": 20, "sec": 3}',
]
data = {"json": events, "image": ["chai.jpg", "menu.png"], "text": ["Best chai!"]}
# VOLUME: how much data?
size = sum(len(e) for e in events)
print("Volume :", len(events), "records,", size, "bytes")
# VELOCITY: how fast does it arrive?
records = [json.loads(e) for e in events]
seconds = len({r["sec"] for r in records})
print("Velocity:", len(records) / seconds, "records per second")
# VARIETY: how many kinds of data?
print("Variety :", len(data), "kinds ->", ", ".join(data))
# VERACITY: how many records can we trust?
seen, clean, bad = set(), [], 0
for r in records:
if r["id"] in seen or r["amount"] <= 0:
bad += 1
continue
seen.add(r["id"])
clean.append(r)
print("Veracity:", bad, "bad records out of", len(records))
# VALUE: what does the clean data tell us?
sales = {}
for r in clean:
sales[r["item"]] = sales.get(r["item"], 0) + r["amount"]
print("Value : income Rs", sum(sales.values()), "| best seller:", max(sales, key=sales.get))json.loads(e)Turns JSON text into a Python dictionary. Real pipelines do this millions of times per second, which is part of why velocity is hard.len({r["sec"] for r in records})A set keeps only unique values, so this counts how many different seconds the records arrived in.r["id"] in seenThe retry sentT2twice. Without this check the income would be counted twice: a veracity problem.r["amount"] <= 0A payment of −15 is impossible, so it is rejected instead of silently reducing the total.max(sales, key=sales.get)Finds the item with the highest sales: a small example of turning data into a decision (value).
Run it on your PC: make a file Excel can't open
This program writes 15 lakh fake canteen orders to orders.csv (about 39 MB). Save it as gen_orders.py and run it with Python on your own computer. Then try opening the CSV in Excel. The second program reads the same file with Python in about two seconds. That is the point: too big for Excel is not the same as big data.
Create 15 lakh rows
import csv, os, random, time
random.seed(7)
items = [("chai", 20), ("coffee", 25), ("vada pav", 25), ("samosa", 15), ("poha", 30)]
start = time.time()
with open("orders.csv", "w", newline="") as f:
w = csv.writer(f)
w.writerow(["txn_id", "item", "amount", "mode", "day"])
for i in range(1, 1_500_001):
item, price = random.choice(items)
w.writerow([f"T{i}", item, price, random.choice(["UPI", "cash"]), i // 3700 + 1])
secs = time.time() - start
print("Rows written :", 1_500_000)
print("File size :", round(os.path.getsize("orders.csv") / 1024**2, 1), "MB")
print("Time taken :", round(secs, 1), "seconds")
print("Excel limit :", 1_048_576, "rows -> this file is too big for one sheet")
# In a terminal: python gen_orders.pyOutput recorded from a real run. Your time will differ with your computer's speed; the row count and size will match. Opening this file in Excel shows “File not loaded completely” and keeps only the first 10,48,576 rows.
Read all 15 lakh rows with Python
import csv, time
from collections import Counter
start = time.time()
sales = Counter()
with open("orders.csv") as f:
for row in csv.DictReader(f):
sales[row["item"]] += int(row["amount"])
print("Read 15 lakh rows in", round(time.time() - start, 1), "seconds")
for item, rs in sales.most_common():
print(f"{item:10} Rs {rs:,}")
# In a terminal: python read_orders.pyRecorded from a real run. One ordinary computer handles this easily, so it is not big data. Make it 1,500 crore rows arriving every day and one computer is no longer enough. Lesson 1.2 shows exactly where it breaks.
Cleaning payments, one line at a time
Veracity in action. Four records arrive: one is a duplicate caused by a retry, and one has an impossible amount. Step through and watch seen, income and the console. Objects #1 (the list) and #2–#5 (each record is a tuple) live on the heap.
Worked examples: real problems, solved and traced in memory
Four problems, from beginner to advanced. Each program runs live, and each is traced so you can see how the data builds up in memory.
How much data does a supermarket chain create?
Problem statement
A supermarket chain has 2,000 stores. Each store prints about 400 bills a day, and each bill record is about 600 bytes. How much bill data does one store create in a year, and how much does the whole chain create?
600 bytes × 400 bills × 365 days × 2000 stores
One store per year : 83.5 MB Whole chain per year: 163.2 GB
Approach
- Multiply bytes per bill by bills per day and days per year for one store.
- Multiply by the number of stores for the chain.
- Convert bytes to MB (÷ 1024²) and GB (÷ 1024³) so the numbers are readable.
Solution: run it live
What happens in memory, step by step
Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.
Sort a folder by kind of data
Problem statement
A company's shared folder has files from many teams. Count how many files are structured, semi-structured and unstructured, using the file extension.
sales.csv, cctv.mp4, app_log.json, invoice.pdf, stock.csv, server.log, review.txt
{'structured': 2, 'unstructured': 3, 'semi-structured': 2}Approach
- Make a dictionary that maps known extensions to a kind.
- For each file, take the part after the last dot.
- Look it up; anything unknown counts as unstructured. Count each kind in another dictionary.
Solution: run it live
What happens in memory, step by step
Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.
Find the busiest minute
Problem statement
A food-delivery app logs the minute of every order. Find how many orders arrived in each minute, and the peak minute. Systems must be built for the peak, not the average.
13:00, 13:00, 13:01, 13:01, 13:01, 13:02
Orders per minute: {'13:00': 2, '13:01': 3, '13:02': 1}
Peak: 13:01 with 3 orders
Average: 2.0 orders per minuteApproach
- Count orders per minute in a dictionary.
- Use
maxwithkey=per_min.getto find the minute with the highest count. - Compare the peak with the average.
Solution: run it live
What happens in memory, step by step
Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.
How much storage will we need in five years?
Problem statement
A payments company adds 78 GB of new records a day today, and the daily amount grows 40% a year. Records are kept for at least five years. The platform keeps 3 copies of every file for safety, and the Parquet format compresses the data about 4 times. How much disk is needed at the end of each year?
78 GB/day, 40% growth, 3 copies, 4× compression, 5 years
Year 1: raw 27.8 TB -> disk 20.9 TB Year 2: raw 66.7 TB -> disk 50.0 TB Year 3: raw 121.2 TB -> disk 90.9 TB Year 4: raw 197.5 TB -> disk 148.1 TB Year 5: raw 304.3 TB -> disk 228.2 TB
Approach
- Year 1 adds 78 × 365 GB. Each later year adds 40% more than the year before: multiply by 1.4 each time.
- Keep a running total of raw data, because old data is not deleted within five years.
- Stored size = raw total × copies ÷ compression. Convert GB to TB by dividing by 1024.
Solution: run it live
What happens in memory, step by step
Recorded from a real Python run: press Next to execute one line at a time. Watch variables change in each frame, and lists and dictionaries (numbered #1, #2 …) fill up as objects.
Check yourself
Quick revision
Lesson 1.1 in one screen
- Big data = too big, too fast or too varied for traditional single-machine tools.
- Volume (how much) · Velocity (how fast) · Variety (how mixed) · Veracity (how trustworthy) · Value (how useful).
- First 3 Vs: Doug Laney, 2001. Veracity and Value added later.
- Structured (tables) · semi-structured (JSON, logs, XML) · unstructured (photos, video, audio, free text).
- Units: KB → MB → GB → TB → PB → EB, each × 1024.
- Excel holds 10,48,576 rows per sheet. Too big for Excel ≠ big data.
- Rule of thumb: it is big data when you need more than one machine to store or process it in time.
- Engineers measure each V: TB and growth (volume), events per second and latency (velocity), sources and formats (variety), % bad records (veracity), money gained vs cost (value).
- Design for the peak, not the average. Peak-to-average ratio = peak rate ÷ average rate.
- Value falls with age: memory → hot → warm → cold → delete or anonymise when retention ends.
- Extra Vs: Variability (rate or meaning changes) and Visualisation.
Interview and viva questions
What is big data? Explain the 5 Vs with examples.
Big data is data whose size, speed or variety exceeds what traditional single-machine tools can handle in acceptable time. Volume: UPI's billions of monthly payments. Velocity: thousands of payments per second needing fraud checks. Variety: tables, JSON logs, photos and reviews together. Veracity: duplicate and broken records that must be cleaned. Value: the decisions the data enables, such as blocking fraud or planning stock.
What is the difference between structured, semi-structured and unstructured data?
Structured data has a fixed schema of columns and types (SQL tables). Semi-structured data has labels or tags but a flexible shape (JSON, XML, logs). Unstructured data has no predefined model (images, video, audio, free text). Each needs different storage and processing.
Is a 10 GB CSV file big data?
Usually not. A single modern machine can process 10 GB with tools like Python, Pandas (in chunks) or a database. It becomes big data when the size, arrival speed or processing deadline needs a cluster of machines.
Why is veracity important?
Because wrong data leads to wrong decisions. Duplicates inflate totals, missing values bias averages and fake records hide fraud. Big data pipelines spend a lot of effort on validation, de-duplication and cleaning before analysis.
Why can't traditional RDBMS handle big data well?
A traditional RDBMS usually runs on one server, so it is limited by that machine's disk, memory and CPU, and scaling up gets very expensive. It also expects a fixed schema, while big data includes semi-structured and unstructured data. Big data systems spread storage and processing across many cheaper machines.
Are there more than 5 Vs of big data?
Yes. Some authors add Variability (the rate or meaning of data changes over time), Visualisation (presenting huge data so people can understand it), Validity and Volatility, giving 7 or 10 Vs. Most syllabi and interviews expect the 5 Vs: Volume, Velocity, Variety, Veracity and Value. Mention Variability as the common sixth.
Why are systems designed for peak load and not average load?
Because customers arrive in bursts: festival sales, salary days, the end of a cricket match. If capacity matches the average, the system fails exactly when demand is highest. Engineers measure the peak-to-average ratio and design for the peak with some headroom, often scaling machines up automatically for known peaks.
Practice problems
Small programs about measuring and cleaning data. The last three are business tasks you could meet in a data engineering interview.
TB to GB
A company stores 5 TB of logs. Print how many GB that is (1 TB = 1024 GB).
5 TB
5120 GB
Show solution and explanation
tb = 5
print(tb * 1024, "GB")How it works: Each step up the unit ladder is × 1024.
Count records and bytes
Given a list of three log lines, print how many records there are and their total size in bytes (one character = one byte here).
3 log lines
Records: 3 Bytes: 54
Show solution and explanation
logs = ["08:01 INFO login riya", "08:02 INFO pay 20", "08:02 WARN retry"]
print("Records:", len(logs))
print("Bytes:", sum(len(x) for x in logs))How it works: len of a string is its number of characters; sum adds them up.
Room left in Excel
A report already has 2,50,000 rows. How many more rows fit in one Excel sheet (limit 1,048,576)?
250000
Rows left: 798576
Show solution and explanation
used = 250_000
print("Rows left:", 1_048_576 - used)How it works: Underscores in numbers are allowed in Python and make big numbers readable.
Remove duplicate orders
Remove duplicate order ids but keep the first occurrence and the original order.
T1, T2, T1, T3, T2
['T1', 'T2', 'T3']
Show solution and explanation
orders = ["T1", "T2", "T1", "T3", "T2"]
seen, unique = set(), []
for o in orders:
if o not in seen:
seen.add(o)
unique.append(o)
print(unique)How it works: The set gives fast “already seen?” checks; the list keeps the order.
Count missing values
Count how many records are missing a city (the value is None or an empty string).
4 customer records
Missing city: 2 of 4
Show solution and explanation
customers = [
{"name": "Riya", "city": "Pune"},
{"name": "Aman", "city": None},
{"name": "Neha", "city": ""},
{"name": "Kabir", "city": "Mumbai"},
]
missing = sum(1 for c in customers if not c["city"])
print("Missing city:", missing, "of", len(customers))How it works: Both None and "" are “falsy”, so not c["city"] catches both.
Peak-to-average ratio
Orders per minute during one evening are given. Print the average, the peak and the peak-to-average ratio (one decimal place).
[120, 135, 980, 140, 110, 1250, 130]
Average: 409.3 Peak: 1250 Peak-to-average ratio: 3.1
Show solution and explanation
per_minute = [120, 135, 980, 140, 110, 1250, 130]
average = sum(per_minute) / len(per_minute)
peak = max(per_minute)
print("Average:", round(average, 1))
print("Peak:", peak)
print("Peak-to-average ratio:", round(peak / average, 1))How it works: The ratio tells you how much spare capacity the system needs above the average. A ratio above 3 already means a system sized for the average will fail during the rush.
Data quality score
Check each payment record: a missing id, an amount of zero or less, and a repeated id are problems. Count each problem and print the percentage of good records.
6 records
{'missing id': 1, 'bad amount': 1, 'duplicate': 1}
Quality score: 50% good recordsShow solution and explanation
records = [
{"id": "T1", "amount": 20}, {"id": "T2", "amount": -5},
{"id": "T1", "amount": 20}, {"id": None, "amount": 30},
{"id": "T3", "amount": 45}, {"id": "T4", "amount": 15},
]
seen = set()
problems = {"missing id": 0, "bad amount": 0, "duplicate": 0}
good = 0
for r in records:
if r["id"] is None:
problems["missing id"] += 1
elif r["amount"] <= 0:
problems["bad amount"] += 1
elif r["id"] in seen:
problems["duplicate"] += 1
else:
seen.add(r["id"])
good += 1
print(problems)
print(f"Quality score: {good / len(records) * 100:.0f}% good records")How it works: Each record is checked in order and counted under its first problem. Real pipelines publish this score every day so a sudden drop (for example, a broken app release) is noticed before anyone trusts the numbers.
Monthly cloud storage bill
A fintech stores 2.3 TB of new payment data every month and keeps all of it. Cloud storage costs Rs 1.80 per GB per month (illustrative). Print the bill for month 1 and month 12.
2.3 TB per month, Rs 1.80/GB-month
Month 1 : Rs 4239 Month 12 : Rs 50872
Show solution and explanation
new_gb = 2.3 * 1024
rate = 1.80
for month in [1, 12]:
stored = new_gb * month
print("Month", month, ": Rs", round(stored * rate))How it works: Data accumulates, so the bill grows every month. This is why companies set retention rules: Volume has a cost, so it must create Value.
Average payments per second
A payments company processed 1,800 crore transactions last month (30 days). Print the average per second.
18,000,000,000 in 30 days
6944 per second on average
Show solution and explanation
txns = 18_000_000_000
seconds = 30 * 24 * 3600
print(round(txns / seconds), "per second on average")How it works: 30 × 24 × 3600 = 25,92,000 seconds in the month. Peaks are several times the average.
Busiest hour for staffing
A canteen logs the hour of each order. Print the hour with the most orders so the owner can put an extra person on the counter.
hours: 8, 9, 13, 13, 16, 13, 8, 16, 13
Busiest hour: 13 with 4 orders
Show solution and explanation
hours = [8, 9, 13, 13, 16, 13, 8, 16, 13]
count = {}
for h in hours:
count[h] = count.get(h, 0) + 1
busiest = max(count, key=count.get)
print("Busiest hour:", busiest, "with", count[busiest], "orders")How it works: Count with a dictionary, then pick the key with the highest value. Data → decision is Value.
Real-world scenario questions (asked in company interviews)
Situations freshers and junior data engineers really face. Decide your answer first, then open the model answer.
“Let's set up Hadoop for our sales data”
A mid-sized retailer has 5 GB of sales data, growing by about 1 GB a year. A manager read about big data and wants to set up a Hadoop cluster. You are asked for your opinion.
The interviewer is checking: can you judge whether data is really “big”, instead of picking tools because they are popular?
Show a strong answer
5 GB growing at 1 GB a year is not big data. One database server (PostgreSQL or MySQL) or Python with Pandas handles it comfortably, and reports will run in seconds.
- A cluster adds cost, setup and maintenance with no benefit at this size.
- Put the data in a proper database, index it, and build reports or a BI dashboard on top.
- Revisit if the data grows by orders of magnitude, for example if clickstream or real-time data is added.
Avoid saying: “More data tools are always better.” Use the simplest tool that meets the need.
The dashboard shows more money than the bank
The daily revenue dashboard shows ₹12.4 lakh, but the bank settlement says ₹11.9 lakh. Engineering says the app sometimes retries payments when the network is slow.
The interviewer is checking: do you recognise a veracity problem and know how to fix it at the source and in the pipeline?
Show a strong answer
Retries are probably creating duplicate records for the same payment, so they are counted twice.
- Check for repeated transaction ids in the raw data for that day, and compare totals after removing them.
- De-duplicate in the pipeline on a unique key (transaction id) before calculating revenue.
- Fix the source: make the payment API idempotent, so a retry with the same id doesn't create a new record.
- Add a daily reconciliation check against the bank settlement that alerts when they differ.
Avoid: “adjusting” the dashboard number by hand without finding the cause.
“Keep everything forever, just in case”
Your team stores every click from the app forever. The storage bill grows every month, and nobody has used clicks older than a year. Your lead asks what you would propose.
The interviewer is checking: do you understand that Volume has a cost and must be balanced against Value, and that personal data has legal limits?
Show a strong answer
Data should be kept as long as it creates value or is legally required, and no longer.
- Agree a retention policy with the business: for example, raw clicks for 90 days, daily summaries for years.
- Move older data to cheaper archive storage, and compress it into columnar formats like Parquet.
- Remove or anonymise personal data that isn't needed. Privacy laws such as India's Digital Personal Data Protection Act, 2023 expect personal data not to be kept longer than necessary.
Avoid: deleting data without checking legal and audit requirements first.
Analysing call recordings with sales data
The support head wants to know why customers cancel. The evidence is spread across a sales database (tables), chat transcripts (JSON) and call recordings (audio files). How would you bring them together?
The interviewer is checking: can you handle Variety: different shapes of data that must be linked?
Show a strong answer
Store all three in a data lake in their raw form, then convert each into something that can be joined.
- Audio → text with a speech-to-text service, then text → topics or sentiment.
- Chat JSON → flatten into rows: customer id, time, message, topic.
- Join everything on customer id with the sales tables, and compare customers who cancelled with those who stayed.
Avoid: forcing audio and JSON into one rigid table before you know which fields matter.