CS441 – Big Data Concepts: Midterm Important Subjective (22 Solved Q&As)
Virtual University of Pakistan • Read every solved subjective question with its model answer directly on this page. Free, no login required.
All 664 Midterm Packs · CS441 Course Page · CS441 MCQ Pack (65 MCQs)
-
Define Big Data and explain its main characteristics (the 5 Vs) with examples.
Topic: Big Data Concepts
Big Data means data sets that are so large, fast-growing and varied that traditional data processing tools cannot capture, store, manage and process them efficiently. Its main characteristics are the 5 Vs: (1) Volume — the huge amount of data, measured in terabytes, petabytes and exabytes, e.g. data uploaded on social media every day. (2) Velocity — the speed at which data is generated and must be processed, e.g. live sensor and stock market data. (3) Variety — the different types and formats of data: structured (database tables), semi-structured (JSON, XML) and unstructured (text, images, videos). (4) Veracity — the quality, accuracy and trustworthiness of the data. (5) Value — the useful insights and benefits that can be extracted from the data for better decisions.
-
Why is scalability important in the Big Data concept? Give one example.
Topic: Big Data Concepts
Scalability is the ability of a system to handle a growing amount of data and workload by adding resources, without a drop in performance. It is important in Big Data because data is increasing continuously and very fast; a system that works for gigabytes today must also work for terabytes and petabytes tomorrow. Without scalability, processing becomes slow, storage fills up and the system can fail. Example: a social media platform keeps adding more servers (nodes) as the number of users and uploaded photos and videos grows, so that uploading and searching data stays fast.
-
Discuss the effects of Big Data technologies on business and society.
Topic: Big Data Concepts
Big Data technologies have changed how organizations and society work. Their main effects are: (1) Better decision making — organizations analyze large data sets to make accurate, data-driven decisions instead of guesses. (2) Cost reduction — cheap distributed storage and processing (such as Hadoop clusters) reduce the cost of storing huge data. (3) New products and services — companies create personalized services, e.g. product recommendations on shopping websites. (4) Improved healthcare — patient data analysis helps in disease prediction and better treatment. (5) Real-time services — banking fraud detection, traffic updates and live monitoring become possible. (6) Negative effects — risks to privacy, data theft and misuse of personal data also increase, so security and laws are needed.
-
Differentiate between structured, semi-structured and unstructured data. Give one example of each.
Topic: Big Data Concepts
Structured data is organized in a fixed format of rows and columns and is easy to search and process; example: records in a relational database table or an Excel sheet. Semi-structured data does not follow a strict table format but contains tags or markers that separate data elements; examples: JSON and XML files, emails. Unstructured data has no predefined format or organization and is difficult to process with traditional tools; examples: text documents, images, audio and video files. Most of the Big Data generated today is unstructured or semi-structured.
-
What are the major sources of Big Data? Explain any three.
Topic: Big Data Concepts
The major sources of Big Data are: (1) Social media — posts, photos, videos, likes and comments generated by billions of users on platforms such as Facebook, YouTube and X. (2) Machine and sensor data — sensors in machines, vehicles, mobiles and IoT devices continuously generate readings such as temperature, location and speed. (3) Transactional data — online shopping, banking transactions, billing and reservation records produced by businesses every second. (4) Web and clickstream data — records of users' activities on websites and applications. (5) Multimedia and communication data — emails, messages, call records, images and videos shared through communication systems.
-
What are the main challenges faced in managing Big Data? Discuss any four.
Topic: Big Data Concepts
The main challenges of Big Data are: (1) Storage — huge volumes of data need very large and costly storage systems. (2) Processing speed — data arrives very fast and must be processed quickly, which traditional systems cannot do. (3) Data variety and quality — data comes in many formats and may contain errors, duplicates and missing values, so cleaning is difficult. (4) Privacy and security — personal and sensitive data can be stolen or misused, so protection is a big challenge. (5) Skilled professionals — experts who can store, process and analyze Big Data are limited and costly.
-
Write down the applications of Big Data in any four fields.
Topic: Big Data Concepts
Big Data is applied in almost every field: (1) Business and marketing — analyzing customer behavior for targeted advertising, recommendations and better sales decisions. (2) Healthcare — predicting diseases, improving patient care and discovering new medicines from medical data. (3) Banking and finance — detecting fraud transactions in real time and assessing credit risk. (4) Government — improving public services, traffic management, crime prediction and policy planning. (5) Education — analyzing students' performance to improve teaching and learning. (6) Transportation — route optimization and live traffic updates using GPS and sensor data.
-
Differentiate between horizontal scaling and vertical scaling.
Topic: Big Data Concepts
Horizontal scaling means adding more machines or nodes to a system so that the workload and data are distributed among them; it is the common approach in Big Data systems such as Hadoop clusters. Vertical scaling means increasing the power of a single machine by adding more CPU, RAM or storage to it. Horizontal scaling is more suitable for Big Data because it is cheaper, can grow almost without limit, and if one machine fails the others keep working, while vertical scaling has a physical limit and a single point of failure.
-
What is Hadoop? Explain its two core components, HDFS and MapReduce.
Topic: Big Data Concepts
Hadoop is an open-source framework used to store and process very large data sets across a cluster of many ordinary computers. Its two core components are: (1) HDFS (Hadoop Distributed File System) — it stores huge files by dividing them into blocks and distributing the blocks across different machines, with copies for safety. (2) MapReduce — the processing model of Hadoop; it divides a task into small parts, processes them in parallel on many machines (Map step) and then combines the results (Reduce step). Together, HDFS and MapReduce make Big Data storage and processing scalable and fault tolerant.
-
Differentiate between descriptive, predictive and prescriptive analytics.
Topic: Big Data Concepts
Descriptive analytics tells what has happened in the past; it summarizes historical data, e.g. a monthly sales report. Predictive analytics tells what is likely to happen in the future by using past data and statistical models, e.g. forecasting next month's sales or predicting which customers may leave. Prescriptive analytics goes one step further and suggests what should be done; it recommends actions to achieve the best result, e.g. suggesting the best price or the best route for delivery vehicles.
-
Why can traditional database systems not handle Big Data? Give reasons.
Topic: Big Data Concepts
Traditional database systems cannot handle Big Data because of the following reasons: (1) Volume — they are designed for limited data and cannot efficiently store terabytes and petabytes of data on a single system. (2) Velocity — data arrives too fast for them to capture and process in real time. (3) Variety — they store only structured data in fixed tables, while Big Data is mostly unstructured and semi-structured. (4) Scaling — they mostly scale vertically, which is costly and limited, whereas Big Data needs cheap horizontal scaling across many machines.
-
What is the output of the following Python code? Explain briefly. def my_func(x, y): return x * y print(my_func(3, 4)) def my_func(x): return x * 3 print(my_func(7))
Topic: Python Programming for Data
(a) The function my_func multiplies its two arguments and returns the result. my_func(3, 4) returns 3 * 4 = 12, so the output is 12. (b) Here my_func returns three times its argument. my_func(7) returns 7 * 3 = 21, so the output is 21.
-
What sequences are produced by (a) range(2, 6) and (b) range(5)?
Topic: Python Programming for Data
(a) range(2, 6) starts from 2 and goes up to, but does not include, 6. It produces: 2, 3, 4, 5. (b) range(5) starts from 0 by default and goes up to, but does not include, 5. It produces: 0, 1, 2, 3, 4. In range(start, stop), the stop value is always excluded.
-
Consider the following Python code. How many times will "Pakistan" be printed, and why? i = 1 while i <= 2: print("Pakistan") i = i + 1
Topic: Python Programming for Data
The word "Pakistan" is printed two times. The variable i starts at 1. In the first round the condition i <= 2 is true, so "Pakistan" is printed and i becomes 2. In the second round the condition is again true, so "Pakistan" is printed again and i becomes 3. Now the condition i <= 2 is false, so the loop stops. Hence the output appears exactly two times.
-
Give the Python expression to display a date in the format 25-04-2025 (day-month-year), and not as 25/04/2025.
Topic: Python Programming for Data
The strftime() method of a date is used with format codes. To display the date in day-month-year order separated by dashes, the format string "%d-%m-%Y" is used, where %d is the day, %m is the month and %Y is the four-digit year. Using slashes in the format, i.e. "%d/%m/%Y", would display 25/04/2025 instead. from datetime import date d = date(2025, 4, 25) print(d.strftime("%d-%m-%Y"))
-
What is a function in Python? Write a function that takes the sales of three days and returns the total sales.
Topic: Python Programming for Data
A function in Python is a block of reusable code that performs a specific task; it is defined with the def keyword and can take inputs (parameters) and send back a result with return. The following function adds the sales amounts of three days and returns their total: def total_sales(day1, day2, day3): total = day1 + day2 + day3 return total print(total_sales(1000, 2500, 1500))
-
Differentiate between a list and a dictionary in Python, with one example of each.
Topic: Python Programming for Data
A list is an ordered collection of items stored in a single variable using square brackets; items are accessed by their position (index), e.g. sales = [1000, 2000, 1500], and sales[0] gives 1000. A dictionary stores data in key-value pairs using curly brackets; values are accessed by their keys instead of positions, e.g. store = {"name": "City Mart", "sales": 4500}, and store["sales"] gives 4500. Lists are used when the order of items matters, while dictionaries are used when each value must be identified by a name or label.
-
Write Python code to calculate and print the total sales of a store from the daily sales list [1000, 2500, 1500, 3000].
Topic: Python Programming for Data
The daily sales are stored in a list. The sum() function adds all the values of the list, and the result is printed. The total is 1000 + 2500 + 1500 + 3000 = 8000. sales = [1000, 2500, 1500, 3000] total = sum(sales) print("Total sales:", total)
-
Explain the use of the return statement in a Python function with an example.
Topic: Python Programming for Data
The return statement ends the execution of a function and sends a value back to the place where the function was called, so the result can be stored in a variable or used in further calculations. Without return, a function gives back None. Example: in the function def square(n): return n * n, the statement result = square(5) stores 25 in result because the function returns 5 * 5 = 25.
-
What is the difference between the / and // operators in Python? Give examples.
Topic: Python Programming for Data
The / operator performs normal (float) division and always gives a decimal result; for example, 10 / 2 gives 5.0 and 10 / 3 gives 3.333.... The // operator performs floor division; it divides and discards the fractional part, giving only the whole-number quotient; for example, 10 // 3 gives 3 and 10 // 2 gives 5. The / operator is used when an exact decimal result is needed, while // is used when only the whole number of times one value fits into another is required.
-
Write a short note on the role of Python in Big Data.
Topic: Python Programming for Data
Python plays a central role in Big Data for the following reasons: (1) It is simple and easy to learn, so data tasks can be performed quickly. (2) It has powerful libraries for data handling and analysis, such as Pandas and NumPy, and for machine learning, such as scikit-learn. (3) It works with Big Data platforms; for example, PySpark allows Python code to run on Apache Spark clusters. (4) It is widely used for cleaning, transforming and visualizing large data sets before and after processing. Because of these reasons, Python is one of the most popular languages in data science and Big Data analytics.
-
How can a for loop be used to process a large list of records? Explain with an example.
Topic: Python Programming for Data
A for loop processes each record of a list one by one, so the same operation is applied to every record without writing the code again and again. This is how large collections of records are handled in data processing. Example: the following code goes through the sales list of a store and prints only the days on which sales were above 2000: sales = [1200, 2500, 1800, 3200] for s in sales: if s > 2000: print(s)