Class 12 Computer Science Sample Paper Set 2 — Free PDF
This advanced computer science paper covers programming, data structures, database management, and networking. It evaluates practical coding skills and con
TL;DR: This advanced computer science paper covers programming, data structures, database management, and networking. It evaluates practical coding skills an…
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
This advanced computer science paper covers programming, data structures, database management, and networking. It evaluates practical coding skills and conceptual understanding required for IT careers.
Board: CBSE · Class: Class 12 · Subject: Computer Science · Total: 70 marks · Time: 3 hours
Section A: Programming and Data Structures — 25 marks
Answer programming questions with code snippets and explanations.
Q1. Write a Python function to check if a number is prime and test it with at least two examples. (5 marks)
Answer: def is_prime(n): if n < 2: return False; for i in range(2, int(n**0.5) + 1): if n % i == 0: return False; return True. Test: is_prime(17) returns True, is_prime(10) returns False.
Q2. Explain stack and queue data structures. Give real-world applications of each. (5 marks)
Answer: Stack: LIFO (Last In First Out). Applications: undo operations in text editors, function call stack. Queue: FIFO (First In First Out). Applications: printer queue, customer service lines, breadth-first search.
Q3. What is recursion? Write a recursive function to calculate factorial. (5 marks)
Answer: Recursion is when a function calls itself. def factorial(n): if n <= 1: return 1; return n * factorial(n-1). Example: factorial(5) = 120.
Q4. Explain the difference between arrays and linked lists with advantages and disadvantages. (5 marks)
Answer: Arrays: contiguous memory, fast access O(1), slow insertion/deletion. Linked lists: non-contiguous memory, slow access O(n), fast insertion/deletion. Choice depends on use case.
Q5. What is sorting? Name two sorting algorithms and compare their time complexities. (5 marks)
Answer: Sorting arranges data in order. Bubble sort: O(n^2) simple, inefficient for large data. Quick sort: O(n log n) average case, very efficient. Merge sort: O(n log n) guaranteed, requires extra space.
Section B: Database Management and SQL — 20 marks
Write SQL queries and explain database concepts.
Q1. Create a table for Students with fields: RollNo (primary key), Name, Class, Percentage. (5 marks)
Answer: CREATE TABLE Students (RollNo INT PRIMARY KEY, Name VARCHAR(50), Class VARCHAR(5), Percentage FLOAT);
Q2. Write a query to find students with percentage greater than 75, sorted by percentage descending. (5 marks)
Answer: SELECT * FROM Students WHERE Percentage > 75 ORDER BY Percentage DESC;
Q3. Explain normalization and why it is important in database design. (5 marks)
Answer: Normalization removes redundancy and organizes data into related tables following normal forms (1NF, 2NF, 3NF). It improves data integrity, reduces storage, and makes updates efficient.
Q4. What are constraints in SQL? Explain PRIMARY KEY, UNIQUE, and FOREIGN KEY. (5 marks)
Answer: Constraints enforce data integrity. PRIMARY KEY uniquely identifies records and cannot be null. UNIQUE ensures no duplicate values. FOREIGN KEY creates relationships between tables by referencing another tables primary key.
Section C: Networking and Cybersecurity — 15 marks
Answer questions on computer networks and security.
Q1. What is the OSI model? List all seven layers. (5 marks)
Answer: OSI is a framework for network communication. Layers: 1. Physical, 2. Data Link, 3. Network, 4. Transport, 5. Session, 6. Presentation, 7. Application.
Q2. Explain TCP/IP and how it differs from OSI model. (5 marks)
Answer: TCP/IP is a practical model with 4 layers: Link, Internet, Transport, Application. It is simpler than OSI, combines some layers, and is the actual model used on the internet.
Q3. What are common cybersecurity threats and how can they be prevented? (5 marks)
Answer: Threats: malware, phishing, ransomware. Prevention: use firewalls, antivirus software, strong passwords, regular updates, two-factor authentication, and awareness training.
Section D: Emerging Technologies and Ethics — 10 marks
Discuss modern technologies and ethical implications.
Q1. What is artificial intelligence? List three applications and discuss one ethical concern. (5 marks)
Answer: AI simulates human intelligence. Applications: face recognition, recommendation systems, autonomous vehicles. Ethical concern: bias in algorithms leading to discrimination against minorities.
Q2. Discuss the role of cloud computing in modern IT infrastructure. (5 marks)
Answer: Cloud computing provides on-demand computing resources over internet. Benefits: scalability, cost-efficiency, accessibility. Concerns: data security, vendor lock-in, privacy issues.
FAQs
Is practical coding experience necessary for this exam?
Yes, strong practical coding skills are essential. Practice writing and debugging code regularly using Python or C++.
How much weight is given to theory vs practical?
Approximately 60-70% is practical (coding, SQL queries) and 30-40% is theory (concepts, algorithms, security).
Should I prepare all programming languages mentioned in curriculum?
Focus deeply on one language (Python recommended) and understand fundamental concepts. Knowledge of SQL for databases is mandatory.
All sample papers → · Previous-year questions → · Chapter-wise MCQs →