CBSE Class 12th IP/CS Viva Questions and Answers (Python, MySQL, Networking, Societal Impacts)
Published on January 15, 2025 by @mritxperts
Python Questions
Q: What are Python’s key features? A: Python is interpreted, high-level, dynamically typed, and supports object-oriented programming.
Q: What is the difference between a list and a tuple? A: Lists are mutable, whereas tuples are immutable.
Q: How do you declare a variable in Python? A: Variables are declared when they are assigned a value, e.g., x = 5.
Q: Explain the use of the range() function. A: It generates a sequence of numbers. Example: range(5) creates [0, 1, 2, 3, 4].
Q: What is the difference between is and ==? A:is checks identity, whereas == checks equality.
Q: What is a Python dictionary? A: It is an unordered collection of key-value pairs.
Q: What is the output of print(2 ** 3)? A:8
Q: Explain list comprehension. A: It provides a concise way to create lists. Example: [x**2 for x in range(5)].
Q: How can you handle exceptions in Python? A: Using try, except, and finally blocks.
Q: What are Python’s data types? A: Common types include int, float, str, list, tuple, dict, and bool.
Q: What is a Python module? A: A file containing Python code that can be imported.
Q: What are *args and **kwargs? A:*args passes variable-length positional arguments; **kwargs passes variable-length keyword arguments.
Q: How do you define a function in Python? A: Using the def keyword, e.g., def func_name():.
Q: What are lambda functions? A: Anonymous functions defined with the lambda keyword.
Q: Explain the difference between del and remove() in lists. A:del removes an element by index, whereas remove() removes by value.
Q: What is recursion? A: A function calling itself directly or indirectly.
Q: How do you read a file in Python? A: Using open() followed by .read() or .readlines().
Q: What is the purpose of the with statement in file handling? A: It ensures proper cleanup of file resources.
Q: How do you import a specific function from a module? A: Using from module import function.
Q: How do you concatenate strings in Python? A: Using the + operator or join() method.
MySQL Questions
Q: What is SQL? A: SQL stands for Structured Query Language used to manage relational databases.
Q: What are primary keys? A: A column or set of columns uniquely identifying a row in a table.
Q: What is the difference between CHAR and VARCHAR? A:CHAR is fixed-length, while VARCHAR is variable-length.
Q: How do you fetch data from a table? A: Using the SELECT statement, e.g., SELECT * FROM table_name;.
Q: Explain the use of the WHERE clause. A: Filters rows based on a condition.
Q: What is a foreign key? A: A key in one table referencing a primary key in another.
Q: How do you add a column to an existing table? A: Using ALTER TABLE table_name ADD column_name datatype;.
Q: What are joins in SQL? A: Joins combine rows from two or more tables based on a related column.
Q: Explain the difference between INNER JOIN and OUTER JOIN. A:INNER JOIN returns matching rows; OUTER JOIN includes unmatched rows too.
Q: How do you create a database? A: Using CREATE DATABASE db_name;.
Q: What are constraints in SQL? A: Rules enforced on columns, like NOT NULL, UNIQUE, and CHECK.
Q: How do you delete a table? A: Using DROP TABLE table_name;.
Q: What is the use of GROUP BY? A: Groups rows sharing a property and performs aggregate calculations.
Q: How do you sort results in SQL? A: Using ORDER BY column_name ASC/DESC;.
Q: What are aggregate functions? A: Functions like SUM(), AVG(), COUNT(), MIN(), and MAX().
Q: Explain the LIKE operator. A: Used for pattern matching with % and _.
Q: What is the difference between TRUNCATE and DELETE? A:TRUNCATE removes all rows, DELETE can filter rows.
Q: How do you back up a MySQL database? A: Using mysqldump utility.
Q: What is indexing in SQL? A: It improves query performance by reducing data retrieval time.
Q: How do you count rows in a table? A: Using SELECT COUNT(*) FROM table_name;.
Networking Questions
Q: What is a computer network? A: A collection of interconnected devices sharing resources and information.
Q: What are the types of networks? A: LAN, MAN, WAN, PAN, and WLAN.
Q: Define IP address. A: A unique address identifying devices on a network.
Q: What is the difference between IPv4 and IPv6? A: IPv4 uses 32-bit addresses; IPv6 uses 128-bit addresses.
Q: What is a MAC address? A: A hardware address unique to a network interface.
Q: What are the layers of the OSI model? A: Physical, Data Link, Network, Transport, Session, Presentation, Application.
Q: What is DNS? A: Domain Name System maps domain names to IP addresses.
Q: Define HTTP and HTTPS. A: HTTP is unsecured; HTTPS uses SSL/TLS for encryption.
Q: What is the role of a router? A: Directs data packets between networks.
Q: What is a firewall? A: A security system to monitor and control network traffic.
Societal Impacts Questions
Q: What is digital divide? A: The gap between those with and without access to technology.
Q: What are the ethical concerns in AI? A: Bias, job displacement, privacy, and accountability.
Q: How can social media impact mental health? A: It can lead to anxiety, depression, and self-esteem issues.
Q: What are the benefits of e-governance? A: Transparency, efficiency, and accessibility of government services.
Q: Explain phishing. A: Fraudulent attempts to obtain sensitive information via fake emails or websites.
Q: What is cyberbullying? A: Bullying through digital platforms like social media.
Q: Define intellectual property rights (IPR). A: Legal rights protecting creators’ works.
Q: What is net neutrality? A: The principle that ISPs must treat all data equally.
Q: What is the impact of e-waste? A: Pollution, health hazards, and resource depletion.
Q: How can technology reduce carbon footprints? A: Through energy-efficient devices and renewable energy technologies.
Additional Questions
Q: What is the difference between sort() and sorted() in Python? A:sort() modifies the list in place, while sorted() returns a new sorted list.
Q: How do you create a virtual environment in Python? A: Using venv, e.g., python -m venv env_name.
Q: What is the use of super() in Python? A: It is used to call a method from a parent class.
Q: What is the purpose of the zip() function in Python? A: It combines two or more iterables into tuples.
Q: How do you create a view in MySQL? A: Using CREATE VIEW view_name AS SELECT ....
Q: What is a self-join in SQL? A: A table joining with itself.
Q: What is subnetting in networking? A: Dividing a network into smaller subnetworks.
Q: What is an IP conflict? A: When two devices have the same IP address on a network.
Q: Explain the concept of port numbers. A: Port numbers identify specific processes or services on a network.
Q: What is a proxy server? A: It acts as an intermediary between a client and the internet.
Q: What are cookies in web technology? A: Small data files stored on a user’s device by websites.
Q: What is the difference between symmetric and asymmetric encryption? A: Symmetric uses one key for encryption and decryption; asymmetric uses a key pair.
Q: Define data encapsulation in networking. A: Wrapping data with protocol information at each layer of the OSI model.
Q: What is the purpose of a gateway in a network? A: It connects different networks and translates protocols.
Q: How does two-factor authentication work? A: It combines two verification methods, like a password and an OTP.
Q: What is the purpose of a data dictionary in a database? A: It stores metadata about the database structure.
Q: What is an ER diagram? A: A visual representation of entities and relationships in a database.
Q: What is the difference between HAVING and WHERE in SQL? A:HAVING filters grouped data; WHERE filters rows before grouping.
Q: What is latency in networking? A: The delay in data transfer from source to destination.
Q: What is the importance of green computing? A: Reducing energy consumption and environmental impact of computing.