HBSE Class 12 Computer Science SAT-1 Question Paper 2026 Answer Key

Haryana Board (HBSE) Class 12 Computer Science SAT-1 Question Paper 2026 Answer Key. Get the Students Assessment Test (SAT) Class 12 Computer Science question paper with complete solution, accurate answer key, and expert preparation tips. The Haryana Board of School Education (HBSE) conducts SAT as an important assessment for Class 12 students. Best resource for Haryana Board Class 12 SAT Computer Science exam practice, quick revision, and scoring better marks.

HBSE Class 12 Computer Science SAT-1 Question Paper 2026 Answer Key

Instructions :
• All questions are compulsory.
• Questions (1-6) carry 1 mark each.
• Questions (7-9) carry 2 marks each.
• Questions (10-11) carry 4 marks each.

1. Which of the following is not a SQL Command Category?
(A) DML
(B) XML
(C) DDL
(D) DCL
Answer – (B) XML

2. The access mode to open a text file in reading mode is ……………
Answer – ‘r’

3. For Binary Search, the element list must be sorted. (True / False)
Answer – True

4. Assertion (A) : The first element inserted in the stack is removed first.
Reason (R) : Stack uses the FIFO (First In First Out) method.
(A) Both Assertion (A) and Reason (R) are true and Reason (R) is not correct explanation of Assertion (A).
(B) Both Assertion (A) and Reason (R) are true but Reason (R) is not correct explanation of Assertion (A).
(C) Assertion (A) is true but Reason (R) is false.
(D) Both Assertion (A) and Reason (R) are false.
Answer – (D) Both Assertion (A) and Reason (R) are false.

5. Write the name of the function used to open a file in python.
Answer – open ()

6. On which Principle does Queue work?
Answer – FIFO (First In, First Out)

7. Write any two differences between binary file and text file?
Answer – Differences between binary file and text file :
• Binary Files – Store data in a machine-readable (binary) format that is not directly readable by humans. They contain raw binary data (sequences of 0s and 1s) representing various data types like images, audio, videos, or executable files. When opened in a text editor, they appear as unreadable or jumbled characters. Examples: .bin, .exe, .jpg
• Text Files – Store data in a human-readable format using character encoding schemes like ASCII or Unicode. They can be opened and viewed in standard text editors such as Notepad or VS Code, and their content is directly understandable by humans. Examples: .txt, .csv, .py

8. CASE STUDY : In a bank’s token system, customers are served in the order they arrive. Which data structure is most suitable for managing this system, and why?
Answer – The data structure most suitable for managing a bank’s token system where customers are served in the order they arrive is a Queue because a queue follows the FIFO (First In First Out) principle, so the first customer to take a token is served first. This ensures customers are served in the order they arrive, making it ideal for a bank’s token system.

9. Name any two built-in exceptions in python.
Answer – Two built-in exceptions in Python are :
(i) ZeroDivisionError – Raised when a number is divided by zero, since division by zero is mathematically undefined.
(ii) IndexError – Raised when trying to access an element in a list, tuple, or string using an index that is out of range.

OR

What is serialization and deserialization in python?
Answer : Serialization (Pickling) – Serialization is the process of converting a Python object (like a list, dictionary, or custom object) into a byte stream. This allows the object to be saved to a file, sent over a network, or stored in a database while preserving its structure and data. Python provides the pickle module to perform serialization.
• Deserialization (Unpickling) – Deserialization is the reverse process, where the byte stream is converted back into the original Python object. This allows the program to restore the object exactly as it was. The pickle module is also used for deserialization.

10. Write an algorithm / program in Python to implement Binary Search.
Answer – Simple Python program to implement Binary Search :

# Binary Search in Python

def binary_search(arr, target):
low = 0
high = len(arr) – 1

while low <= high:
mid = (low + high) // 2

if arr[mid] == target:
return mid # Element found, return index
elif arr[mid] < target:
low = mid + 1 # Search in the right half
else:
high = mid – 1 # Search in the left half

return -1 # Element not found

# Example usage
arr = [2, 5, 8, 12, 16, 23, 38]
target = 12

result = binary_search(arr, target)

if result != -1:
print(f”Element found at index {result}”)
else:
print(“Element not found”)

OR

Write an algorithm / program in Python to insert an element in Stack Data Structure.
Answer – Algorithm to Insert an Element in Stack (Push Operation) :
1. Start
2. Initialize an empty stack (using a list).
3. Read the element to be inserted (element).
4. Append the element to the stack (top of the stack).
5. Display the updated stack.
6. End

Python Program :

# Stack implementation using list

# Initialize an empty stack
stack = []

# Function to push an element into stack
def push(stack, element):
stack.append(element) # Insert element at the top
print(f”Element {element} pushed to stack”)

# Example usage
push(stack, 10)
push(stack, 20)
push(stack, 30)

print(“Current Stack:”, stack)

11. Explain the process of exception handling.
Answer – Exception handling is the process of handling runtime errors in a program to prevent it from crashing. Python provides special blocks to catch and manage exceptions.
• Process of Exception Handling :
(i) Try Block – The code that may cause an exception is written inside the try block.
(ii) Except Block – If an exception occurs in the try block, the except block executes to handle the error.
(iii) Else Block (Optional) – If no exception occurs, the else block executes.
(iv) Finally Block (Optional) – Code inside the finally block executes regardless of whether an exception occurs or not, usually for cleanup tasks.

Example of Python :

try:
num1 = int(input(“Enter first number: “))
num2 = int(input(“Enter second number: “))
result = num1 / num2
except ZeroDivisionError:
print(“Error: Division by zero is not allowed!”)
except ValueError:
print(“Error: Invalid input, please enter integers only!”)
else:
print(“Result is:”, result)
finally:
print(“Execution completed.”)

OR

Write an algorithm / program in Python to implement Bubble Sort.
Answer – Algorithm for Bubble Sort :
1. Start
2. Read the array/list of n elements.
3. Repeat steps 4-5 for i from 0 to n-1.
4. Compare each pair of adjacent elements.
If the current element is greater than the next element, swap them.
5. Repeat until the array is completely sorted.
6. End

Python Program for Bubble Sort :

# Bubble Sort in Python

def bubble_sort(arr):
n = len(arr)
for i in range(n):
# Last i elements are already in place
for j in range(0, n-i-1):
if arr[j] > arr[j+1]:
# Swap if the element found is greater than next
arr[j], arr[j+1] = arr[j+1], arr[j]

# Example usage
arr = [64, 25, 12, 22, 11]
print(“Original Array:”, arr)

bubble_sort(arr)
print(“Sorted Array:”, arr)