GOVERNEMENT OF KARNATAKA
KARNATAKA SCHOOL EXAMINATION AND ASSEMENT BOARD
6th CROSS, MALLESHWARAM, BENGALURU-560 003
2025-26 II PUC MODEL QUESTION PAPER- 1
SUBJECT : COMPUTER SCIENCE (41) MAXIMUM MARKS – 70
TIME : 03.00 HRS No. OF QUESTIONS - 44
PART-A
Answer ALL the questions. Each question carries ONE mark.
I. Select the correct answer from the choices given. 20 x 1 = 20
1. The exception raised when the requested module definition is not found.
(a) io error (b) syntax error (c) import error (d) index error
2. The method which is used to convert python objects for writing data in a binary file
(a) load() (b) dump( ) (c) seek( ) (d) tell( )
3. Assertion : (A) stack follows LIFO rule.
Reason : (R) Insertion and deletion takes place at same end
(a) A is true and R is correct reason
(b) A is true and R is not correct reason
(c) A is false and R is correct reason
(d) A is false and R is not correct reason
4. Deque is a version of queue which allows insertion and deletion at
(a) front end (b) rear end (c) both ends (d) not both ends
5. In bubble sort while sorting in ascending order, which element reaches its correct position
after the first pass.
a) The smallest element
b) The middle element
c) The largest element
d) The second largest element
6. (A) In selection sort the smallest element is selected in each pass and placed in its correct
position.
(B) In selection sort the nth element is the last, and it is already in place
(a) A is true and B is false
(b) A is false and B is true
(c) A and B are true
(d) A and B are false
7. The number of attributes in a relation is called
(a) degree (b) cardinality (c) domain (d) tuple
8. The most popular query language used by RDBMS is
(a) MYSQL (b) PYTHON (c) COBOL (d) JAVA
9. Which of the following is a string single row built in function
(a) Length ( ) (b) Min ( ) (c) Now ( ) (d) Count ( )
10. The operation is used to combine the selected rows of two tables at a time.
(a) Union (b) Intersect (c) Minus (d) Product
11. Correct expansion form of HTTP is :
a) Hyperlink Text Transmit Protocol
b) Hyper Transfer Transmission Protocol
c) Hyper Text Transfer Protocol
d) Hypermedia Text Transmit Protocol
12. The network topology where data can be transmitted in only one direction is
a) Star b) Ring c) Mesh d) Bus
13. The example for Half duplex communication mode :
a) Radio b) Walkie-Talkie c) Television d) Telephone
14. The communication protocol which establishes a dedicated and direct connection between two
communicating devices.
a) FTP b) SMTP c) PPP d) TCP
15. The standalone programs that are capable of working on its own
a) Worm b) Trojan horse c) Ransom ware d) Spy ware
II. Fill in the blanks choosing the appropriate word/words from those given in
the brackets. (insert, assert, raise, binary, max, record, attribute)
16. The __________ statement in python is used to test an expression in the program code.
17. ______ file consists of data stored as a stream of bytes.
18. Each row of a table is called _______ .
19. ________ is a command which comes under DML.
20. ________ is an aggregate function in SQL.
PART-B
III. Answer any FOUR questions. Each question carries TWO marks. 4x2 =8
21. What is prefix and postfix expression?
22. Write any two applications of queues in computer science.
23. What is collision situation and collision resolution in hashing?
24. Write the rules which are imposed on an attribute of the relation.
25. Give the difference between char and varchar data types in SQL.
26. Mention any two network devices.
27. Define data and communication.
PART – C
IV. Answer any FOUR questions. Each question carries THREE marks. 4 x 3 = 12
28. What is the need for exception handling?
29. Explain any three file opening modes in data file handling.
30. Define: a) Constant time algorithm
b) Linear time algorithm
c) Quadratic time algorithm
31. Write an algorithm to search an element using linear search method.
32. Briefly explain database schema, data constraint and data manipulation.
33. Explain different math single row functions used in SQL.
34. Write a note on local area network.
PART – D
V. Answer any FOUR questions. Each question carries FIVE marks. 4 x 5 = 20
35. Write the applications of stacks in programming.
36. Write an algorithm to check whether a string is palindrome or not using deque.
37. Briefly explain the working of binary search algorithm.
38. What is a key in relational database? Explain types of keys.
39. Define network topology? Explain star and bus topologies.
40. Write the properties of radio waves transmission.
41. Explain the methods of malware identification used by antivirus.
PART – E
VI. Answer any TWO questions. Each question carries FIVE marks. 2 x 5 = 10
42. Write the process to sort the following elements using insertion sort method.
80, 60, 20, 40, 50, 10
43. Consider the marks scored by students in a subject given [90, 80, 70, 95, 95, 85, 80] Calculate the
statistical technique for the following:
a) Find the range of marks scored
b) Find the standard deviation of marks
44. Write appropriate SQL query for the following.
Table Name : student
StuReg StuName Marks Phone
Stu_001 Karthik 94 9845123456
Stu_002 Abhay 91 9845123457
Stu_003 Samanvitha 92 9845123458
Stu_004 Sindura 96 9845123459
Stu_005 Krithika 95 9845123460
a) Add constraint primary key for StuReg column of the above table.
b) Find average marks of all the students.
c) Add five marks for student with StuReg- Stu_001.
d) Display all the records in the order highest to lowest marks.
e) Remove all the records of the table whose marks less than 93.
(())
COMPUTER SCIENCE
II PU MODEL QUESTION PAPER - 1 (2026)
ANSWER KEY
PART – A
I. Select the correct answer from the choices given. 15x1=15
1. (c) import error
2. (b) dump()
3. (a) A is true and R is correct reason
4. (c) both ends
5. (c) Largest element
6. (c) A and B is true
7. (a) Degree
8. (a) MYSQL
9. (a) Length()
10. (a) Union
11. (c) Hyper Text Transfer Protocol
12. (b) Ring
13. (b) Walkie-Talkie
14. (c) PPP
15. (a) Worm
II. Fill in the blanks choosing the appropriate word. 5x1=5
16. assert
17. Binary
18. Record
19. insert
20. max
PART – B
III. Answer any FOUR questions. 4x2=8
21. Prefix (Polish) Operators are placed before the corresponding operands
Postfix (Reverse Polish) Operators are placed after the corresponding operands
22. Applications of Queues:
1. web-server hosting
2. print command from multiple files
3. job scheduling by OS
23. If two or more elements cannot be in the same position in the list. This situation is called collision in hashing.
We must have a mechanism for placing the other items with the same hash value in the hash table. This
process is called collision resolution.
24. Rules imposed on attributes of a relation
Each attribute in a relation has a unique name.
Sequence of attributes in a relation is immaterial
25. CHAR : Specifies character type data of length n where n could be any value from 0 to 255.
VARCHAR: Specifies character type data of length where n could be any value from 0 to 65535.
26. Network Devices(any 2) : MODEM, Ethernet card, Router, Gateway, Hub, Switch, Repeater, RJ45
27. Data: Data can be any text, image, audio, video, and multimedia files.
Communication: Communication is an act of sending or receiving data.
PART – C
IV. Answer any FOUR questions. 4x3=12
28. Need for Exception handling :
Python categorises exceptions into distinct types so that specific exception handlers (code to handle that
particular exception) can be created for each type.
Exception handlers separate the main logic of the program from the error detection and correction code.
The compiler or interpreter keeps track of the exact position where the error has occurred.
Exception handling can be done for both user-defined and built-in exceptions.
29. File opening modes(any 3)
30. a) Constant time algorithm - Any algorithm that does not have any loop will have time complexity as 1 since the
number of instructions to be executed will be constant, irrespective of the data size. Such algorithms are known as
Constant time algorithms.
b) Linear time algorithm - Any algorithm that has a loop (usually 1 to n) will have the time complexity as n because
the loop will execute the statement inside its body n number of times. Such algorithms are known as Linear time
algorithms.
c) Quadratic time algorithm - A loop within a loop (nested loop) will have the time complexity as n2. Such
algorithms are known as Quadratic time algorithms.
31. Linear Search Algorithm:
Linear Search LinearSearch(numList, key, n)
Step 1: SET index = 0
Step 2: WHILE index < n, REPEAT
Step 3 Step 3: IF numlist[index]= key THEN
PRINT “Element found at position”, index+1
STOP
ELSE
index = index+1
Step 4: PRINT “Search unsuccessful”
32. Database Schema : Database Schema is the design of a database. It is the skeleton of the database that
represents the structure (table names and their fields/columns), the type of data each column can hold,
constraints on the data to be stored (if any), and the relationships among the tables. Database schema is also
called the visual or logical architecture as it tells us how the data are organised in a database
Data Constraint: Sometimes we put certain restrictions or limitations on the type of data that can be
inserted in one or more columns of a table. This is done by specifying one or more constraints on that
column(s) while creating the tables. For example, one can define the constraint that the column mobile
number can only have non-negative integer values of exactly 10 digits. Since each student shall have one
unique roll number, we can put the NOT NULL and UNIQUE constraints on the RollNumber column.
Constraints are used to ensure accuracy and reliability of data in the database.
Data Manipulation: Modification of database consists of three operations viz. Insertion, Deletion or Update.
Suppose, Rivaan joins as a new student in the class then the student details need to be added in STUDENT as
well as in GUARDIAN files of the Student Attendance database. This is called Insertion operation on the
database. In case a student leaves the school, then his/her data as well as her guardian details need to be
removed from STUDENT, GUARDIAN and ATTENDANCE files, respectively. This is called Deletion operation
on the database. Suppose Atharv’s Guardian has changed his mobile number, his GPhone should be updated
in GUARDIAN file. This is called Update operation on the database.
33. Math Single Row Functions in SQL
34. Local Area Network: It is a network that connects computers, mobile phones, tablet, mouse, printer, etc.,
placed at a limited distance. The geographical area covered by a LAN can range from a single room, a floor, an
office having one or more buildings in the same premise, laboratory, a school, college, or university campus. The
connectivity is done by means of wires, Ethernet cables, fibre optics, or Wi-Fi. LAN is comparatively secure as only
authentic users in the network can access other computers or shared resources. Users can print documents using
a connected printer, upload/download documents and software to and from the local server. Such LANs provide
the short range communication with the high speed data transfer rates. These types of networks can be extended
up to 1 km. Data transfer in LAN is quite high, and usually varies from 10 Mbps (called Ethernet) to 1000 Mbps
(called Gigabit Ethernet), where Mbps stands for Megabits per second. Ethernet is a set of rules that decides how
computers and other devices connect with each other through cables in a local area network or LAN.
PART – D
V. Answer any FOUR questions. 4x5=20
35. Applications of stack in programming
1. Reversing a string
2. Converting infix to postfix expressions
3. Web browsing history
4. Red/undo in editing
5. Evaluating postfix expressions
36. Algorithm to find whether a string is a palindrome or not
37. Working of Binary Search Algorithm:
In binary search, the rule is the numbers should be in ascending order. The key to be searched is compared with
the element in the middle of a sorted list. This could result in any of the three possibilities:
i) the element at the middle position itself matches the key - we declare the search successful and the searching
process ends.
ii) the element at the middle position is greater than the key - key it means that if the key is present in the list, it
must surely be in the first half and ignore the second half
iii) the element at the middle position is smaller than the key - it means if the key is present in the list, it must be
in the second half and the first half can be ignored
This splitting and reduction in list size continued till the key is either found or the remaining list consists of only
one item. If that item is not the key, then the search is unsuccessful as the key is not in the list.
38. Key : one attribute in which data are distinct (unique) and not NULL. So, relational data model imposes some
restrictions or constraints on the values of the attributes and how the contents of one relation be referred through
another relation. These restrictions are specified at the time of defining the database through different types of
keys as given below
Candidate Key: A relation can have one or more attributes that takes distinct values. Any of these attributes
can be used to uniquely identify the tuples in the relation. Such attributes are called candidate keys
Primary Key: Out of one or more candidate keys, the attribute chosen by the database designer to uniquely
identify the tuples in a relation is called the primary key of that relation.
Composite Key: If no single attribute in a relation is able to uniquely distinguish the tuples, then more than one
attribute are taken together as primary key. Such primary key consisting of more than one attribute is called
Composite Primary key.
Foreign Key: A foreign key is used to represent the relationship between two relations. A foreign key is an
attribute whose value is derived from the primary key of another relation. This means that any attribute of a
relation (referencing), which is used to refer contents from another (referenced) relation, becomes foreign key if it
refers to the primary key of referenced relation. The referencing relation is called Foreign Relation.
39. The arrangement of computers and other peripherals in a network is called its topology.
In bus topology, each communicating device connects to a transmission medium, known as bus. Data sent from a
node are passed on to the bus and hence are transmitted to the length of the bus in both directions. That means,
data can be received by any of the nodes connected to the bus. In this topology, a single backbone wire called bus
is shared among the nodes, which makes it cheaper and easier to maintain. Both ring and bus topologies are
considered to be less secure and less reliable.
In star topology, each communicating device is connected to a central node, which is a networking device like a
hub or a switch, as shown in Figure 10.18. Star topology is considered very effective, efficient and fast as each
device is directly connected with the central device. Although disturbance in one device will not affect the rest of
the network, any failure in a central networking device may lead to the failure of complete network.
40. Properties of Radio wave transmission
41. Methods of malware identification by antivirus
(A) Signature-based detection In this method, an antivirus works with the help of a signature database known as
“Virus Definition File (VDF)”. This file consists of virus signatures and is updated continuously on a real-time basis.
This makes the regular update of the antivirus software a must. If there is antivirus software with an out-dated
VDF, it is as good as having no antivirus software installed, as the new malware will infect the system without
getting detected. This method also fails to detect malware that has an ability to change its signature (polymorphic)
and the malware that has some portion of its code encrypted.
(B) Sandbox detection In this method, a new application or file is executed in a virtual environment (sandbox) and
its behavioural fingerprint is observed for a possible malware. Depending on its behaviour, the antivirus engine
determines if it is a potential threat or not and proceeds accordingly. Although this method is a little slow, it is very
safe as the new unknown application is not given access to actual resources of the system.
(C) Data mining techniques This method employs various data mining and machine learning techniques to classify
the behaviour of a file as either benign or malicious.
(D) Heuristics Often, a malware infection follows a certain pattern. Here, the source code of a suspected program
is compared to viruses that are already known and are in the heuristic database. If the majority of the source code
matches with any code in the heuristic database, the code is flagged as a possible threat.
(E) Real-time protection Some malware remains dormant or gets activated after some time. Such malware needs
to be checked on a real-time basis. In this technique, the anti-malware software keeps running in the background
and observes the behaviour of an application or file for any suspicious activity while it is being executed i.e. when
it resides in the active (main) memory of the computer system.
PART – E
VI. Answer any TWO questions. 2x5=10
42. Write the process to sort the following elements using insertion sort method. 80, 60, 20, 40, 50, 10
43. Consider the marks scored by students in a subject given *90, 80, 70, 95, 95, 85, 80+
Calculate the statistical technique for the following:
a) Find the range of marks scored – Max value – min value = 95-70=25
b) Find the standard deviation of marks
Sum: 500
Stadard Deviation :
44. Write appropriate SQL query for the following. Table Name : student
StuReg StuName Marks Phone
Stu_001 Karthik 94 9845123456
Stu_002 Abhay 91 9845123457
Stu_003 Samanvitha 92 9845123458
Stu_004 Sindura 96 9845123459
Stu_005 Krithika 95 9845123460
a) Add constraint primary key for StuReg column of the above table.
ALTER TABLE STUDENT ADD PRIMARY KEY(StuReg);
b) Find average marks of all the students.
SELECT AVG(marks) FROM STUDENT;
c) Add five marks for student with StuReg- Stu_001.
UPDATE STUDENT SET marks=marks+5 WHERE StuReg=’Stu_001’;
d) Display all the records in the order highest to lowest marks.
SELECT * FROM STUDENT ORDER BY marks DESC;
e) Remove all the records of the table whose marks less than 93.
DELETE FROM student WHERE marks<93;
GOVERNEMENT OF KARNATAKA
KARNATAKA SCHOOL EXAMINATION AND ASSEMENT BOARD
6th CROSS, MALLESHWARAM, BENGALURU-560 003
2025-26 II PUC MODEL QUESTION PAPER- 2
SUBJECT : COMPUTER SCIENCE (41) MAXIMUM MARKS – 70
TIME : 03.00 HRS No. OF QUESTIONS - 44
PART A
Answer ALL the questions. Each question carries ONE mark.
I. Select the correct answer from the choices given. 20 x 1 = 20
1) Given Q=N/D, if D=0 and N=50, which built-in exception occurs?
a. Syntax Error b. Index Error c. Value Error d. ZeroDivisionError
2) The function which returns an integer that specifies the current position of the file_object in the file
is
a. seek b. load c. tell d. dump
3) Assertion (A): Stack data structure is used in accessing link of the last visited webpage.
Reason (R): The ordering principle is FIFO.
a. A is true, R is the correct reason.
b. A is true, R is not the correct reason.
c. A is false, R is correct reason.
d. A is false, R is not correct reason.
4) An arrangement of linear data structure in which addition and removal of elements can happen
from any end is known as
a. Stack b. Queue c. Deque d. Enqueue
5) Changing the position of two elements with each other means
a. Sorting b. Hashing c. Swapping d. Searching
6) The nested loop will have the time complexity as
a) n2 b) log n c) 1 d) n
7) Identify the DBMS software
a. Microsoft Access b. Microsoft Outlook
c. Microsoft PowerPoint d. Microsoft Excel
8) The symbol used to represent intersect operation is
a. U b. c. X d. –
9) Which datatype is used to hold numbers with decimal points in MYSQL?
a. FLOAT b. DATE c. INT d. INTEGER
10) The clause used to enforce condition is
a. distinct b. group by c. order by d. where
11) Conversion of the domain name of each web server to its corresponding IP address is
a. Network b. Domain Name System c. URI d. Domain Name Resolution
12) Printing of documents with in a building, can be done by using which type of network?
a. MAN b. WAN c. LAN d. PAN
13) Mobile phones are example of which type of data communication?
a. Full duplex b. Simplex c. Half duplex d. Semi Duplex
14) With respect to bandwidth how many hertz can make 1KHz?
a. 10 b. 100 c. 1000 d. 10000
15) The malware that targets user data is
a. Spyware b. Worms c. Ransomware d. Trojan
II. Fill in the blanks choosing the appropriate word/words from those given in the brackets. (lcase,
redundancy, between, throwing , ucase, serialization)
16) The process of creating an exception object and handing it over to the runtime system is called
_________an exception.
17) ________process is also called as pickling.
18) _____________means same data are duplicated in different places (files).
19) _____________operator defines the range of values inclusive of boundary values.
20) The function that converts string into uppercase is ________________.
PART B
Answer any FOUR questions. Each question carries TWO marks 4x2=8
21) Write implementation of stack in python to check whether the stack is empty or not.
22) For the elements z, x and c perform enqueue and dequeue operations.
23) Define the terms
a) Hashing
b) Perfect hash function
24) List any two uses of database in real life application.
25) Why delete statement is used for? Write its syntax.
26) Write a note on bus topology.
27) Mention different types of switching techniques.
PART C
Answer any FOUR questions. Each question carries THREE marks 4 x 3 = 12
28) What is the purpose of assert statement? Write its syntax and give an example.
29) Write a note on text files.
30) Write a bubble sort algorithm to sort a list in ascending order.
31) List the three possibilities that can occur in binary search.
32) Explain limitations of manual record keeping.
33) Differentiate between single and multiple row functions.
34) Expand the following
a) MAC
b) HTTP
c) URI.
PART D
Answer any FOUR questions. Each question carries FIVE marks 4 x 5 = 20
35) Convert the following infix notation A+B-C*D to postfix notation showing stack and string contents at
each step.
36) Define deque. Explain the operations on deque.
37) Give the other name of linear search and write an algorithm to find position of an element using linear
search method.
38) Define the below terms:
a. attribute
b. tuple
c. domain
d. degree
e. cardinality
39) Explain different network devices used to configure networks.
40) What are the three categories of wired media? Explain any two.
41) List and explain different types of security threats.
PART E
Answer any TWO questions. Each question carries FIVE marks 2 x 5 = 10
42) Arrange the following elements in ascending order using insertion sort algorithm 4, 3, 10, 1, -6, 2
43) Consider the temperature of 7 days of a week as 34, 34, 27, 28, 34, 34. Identify the appropriate statistical
technique used to calculate the following
a. Find the average temperature.
b. Find the temperature range of temperature
c. Find the standard deviation of the temperature
44) Given the table ,table name being product write the queries for the below questions.
PCode Pname Uprice Manufacturer
P01 Washing powder 120 Surf
P02 Tooth paste 54 colagate
P03 Soap 25 Lux
P04 Tooth paste 65 Pepsodent
P05 Soap 43 Dove
P06 Shampoo 245 Dove
i) Identify the primary key in the product table
ii) List the productcode,product name and price in descending order of their product name
iii) Add a new column discount to the product table
iv) Calculate the value of the discount in the table product as 10% of the uprice for all those products
where the uprice is more then 100, otherwise the discount will be 0.
v) Increase the price by 12% for all the products manufactured by Dove.
****
COMPUTER SCIENCE
II PU SCIENCE MODEL PAPER (2) ANSWER KEY
PART – A
I. Select the correct answer from the choices given. 15x1=15
1. (d) Zero Division Error
2. (c) tell
3. (b) A is true, R is not the correct reason.
4. (c) Deque
5. (a) Sorting
6. (a) n2
7. (a) Microsoft Access
8. (b) ∩
9. (a) FLOAT
10. (d) where
11. (b) Domain Name System
12. (c) LAN
13. (a) Full duplex
14. (c) 1000
15. (c)Ransomware
II. Fill in the blanks choosing the appropriate word. 5x1=5
1. throwing
2. serialization
3. redundancy
4. between
5. ucase
PART – B
III. Answer any FOUR questions. 4x2=8
21. def is Empty(glassStack):
if len(glassStack)==0:
return True
else:
return False
22. Operation performed Status of queue after operation
enqueue(z) F--> Z <--R
enqueue(X) F--> Z |X <--R
enqueue(C) F--> Z |X|C <--R
dequue() F--> X | C <--R
dequue() F--> C <--R
dequue() Empty Queue
23.a. Hashing is a technique which can be used to know the presence of a key in a list in just one step.
b. If every item of the list maps to a unique index in the hash table, the hash function is called
a perfect hash function.
24. Uses of database in real life application.
[Link]: Customer information, account details, transaction details, loan details etc.
2. Online shopping: Item description,user login,user preferences details etc.
25. DELETE statement is used to delete/remove one or more records from a table.
Syntax: DELETE FROM table_name WHERE condition;
26. Bus Topology
In bus topology each communicating device connects to a transmission medium, known as bus. Data
sent from a node are passed on to the bus and hence are transmitted to the length of the bus in both
directions.
In this topology, a single backbone wire called bus is shared among the nodes, which makes it cheaper
and
easier to maintain.
27. 1. Circuit Switching
2. Packet Switching
PART – C
IV. Answer any FOUR questions. 4x3=12
28. An assert statement in Python is used to test an expression in the program code.
The syntax for assert statement is: assert Expression [, arguments]
29.
A text file can be understood as a sequence of characters consisting of alphabets,
numbers and other special symbols.
Files with extensions like .txt, .py, .csv, etc. are some examples of text files.
They are stored in sequence of bytes consisting of 0s and 1s. In ASCII, UNICODE or
any other encoding scheme, the value of each character of the text file is stored as
bytes.
So, while opening a text file, the text editor translates each ASCII value and shows us
the equivalent character that is readable by the human being.
Each line of a text file is terminated by a special character, called the End of Line
(EOL). For example, the default EOL character in Python is the newline (\n).
30. Algorithm 5.1: Bubble Sort
BUBBLESORT( numList, n)
Step 1: SET i = 0
Step 2: WHILE i< n REPEAT STEPS 3 to 8
Step 3: SET j = 0
Step 4: WHILE j< n-i-1,REPEAT STEPS 5 to 7
Step 5: IF numList[j] > numList[j+1] THEN
Step 6: swap(numList[j],numList[j+1])
Step 7: SET j=j+1
Step 8: SET i=i+1
31. Three possibilities that occur in binary search are
i. the element at the middle position itself matches the key or
ii. the element at the middle position is greater than the key or
iii. the element at the middle position is smaller than the key
32. The limitations of manual record keeping
i. Entry student details in the new attendance register when the student is prompted to the next
class.
ii. Writing student details on each month’s attendance page where inconsistency may happen due
to incorrectly written names, skipped student records, etc.
iii. Loss of data in case attendance register is lost or damaged.
iv. Erroneous calculation while consolidating attendance record manually.
33.
34. a. MAC: Media Access Control
b. HTTP: Hyper Text Transfer Protocol
c. URI: Uniform Resource Identifier
PART – D
V. Answer any FOUR questions. 4x5=20
35.
36. Deque is an arrangement in which addition and removal of element(s) can happen from any end, i.e. head/front
or tail/rear.
Operations on Deque
• INSERTFRONT: This operation is used to insert a new element at the front of the deque.
• INSERTREAR: This operation is the same as a normal queue, i.e. insert a new element at the rear of the
deque.
• DELETIONFRONT: This operation is the same as normal queue, i.e. to remove an element from the front
of the deque.
• DELETIONREAR: This operation is used to remove one element at a time from the rear of the deque.
37. Linear search is also known as sequential search or serial search.
LinearSearch(numList, key, n)
Step 1: SET index = 0
Step 2: WHILE index < n, REPEAT Step 3
Step 3: IF numlist[index]= key THEN
PRINT “Element found at position”, index+1
STOP
ELSE
index = index+1
Step 4: PRINT “Search unsuccessful”
38. a. ATTRIBUTE: Characteristic or parameters for which data are to be stored in a relation. Simply
stated, the columns of a relation are the attributes which are also referred as fields.
b. TUPLE: Each row of data in a relation (table) is called a tuple. In a table with n columns, a tuple is a
relationship between the n related values.
c. DOMAIN: It is a set of values from which an attribute can take a value in each row. Usually, a data type is
used to specify domain for an attribute.
d. DEGREE: The number of attributes in a relation is called the Degree of the relation.
e. CARDINALITY: The number of tuples in a relation is called the Cardinality of the relation.
39.
1. Modem stands for ‘MOdulator DEModulator’. It refers to a device used for conversion between analog
signals and digital bits. We know computers store and process data in terms of 0s and 1s. However, to
transmit data from a sender to a receiver, or while browsing the internet, digital data are converted to an
analog signal and the medium (be it free-space or a physical media) carries the signal to the receiver.
2. Ethernet card, also known as Network Interface Card (NIC card in short) is a network adapter used to
set up a wired network. It acts as an interface between computer and the network. The Ethernet cable
connects the computer to the network through NIC. Ethernet cards can support data transfer between 10
Mbps and 1 Gbps (1000 Mbps). Each NIC has a MAC address, which helps in uniquely identifying the
computer network.
3.RJ45 RJ 45 or Registered Jack-45 is an eight-pin connector (Figure 10.10) that is used exclusively with
Ethernet cables for networking. It is a standard networking interface that can be seen at the end of all
network cables. Basically, it is a small plastic plug that fits into RJ-45 jacks of the Ethernet cards present in
various computing devices.
4. Repeater Data are carried in the form of signals over the cable. These signals can travel a specified
distance (usually about 100 m). Signals lose their strength beyond this limit and become weak. In such
conditions, original signals need to be regenerated.
A repeater is an analog device that works with signals on the cables to which it is connected. The
weakened signal appearing on the cable is regenerated and put back on the cable by a repeater.
5. Hub An Ethernet hub is a network device used to connect different devices through wires. Data arriving
on any of the lines are sent out on all the others. The limitation of Hub is that if data from two devices
come at the same time, they will collide.
40. Three types wired media are, twisted pair cable, coaxial cable, and fiber optic cable.
[Link]-pair consists of two copper wires twisted like a DNA helical structure. Both the copper wires
are insulated with plastic covers. Usually, a number of such pairs are combined together and covered with
a protective outer wrapping.
Twisted pairs are less expensive and most commonly used in telephone lines and LANs.
These cables are of two types: Unshielded twisted-pair (UTP) and Shielded twisted-pair (STP).
2. Coaxial cable is another type of data transmission medium. It is better shielded and has more
bandwidth than a twisted pair. It has a copper wire at the core of the cable which is surrounded with
insulating material.
The insulator is further surrounded with an outer conductor.
These types of cables are used to carry signals of higher frequencies to a longer distance.
41. Network security threats
Denial of service, network intrusion, snooping, eavesdropping.
Denial of Service (DoS) - Here an attacker (Hacker) limits or stops an authorised user to access a service,
device, or any such resource by overloading that resource with illegitimate requests. The DoS attack f
loads the victim resource with traffic, making the resource appear busy.
Network Intrusion - It refers to any unauthorised activity on a computer network. These activities may
involve unauthorised use of network resources (DoS) or threatening the security of the network and the
data.
Snooping - It refers to the process of secret capture and analysis of network traffic. In this attack, the
hacker taps or listens to a channel of communication by picking all of the traffic passing through it. Once
the network packets are analysed by the snooping device or software, it reproduces the exact traffic
packets and places them back in the channel, as if nothing has happened.
Eavesdropping - It is an unauthorised real-time interception or monitoring of private communication
between two entities over a network. The targets are usually the private communication channels like
phone calls (VoIP), instant messages, video conference, fax transmission, etc.
PART – E
Answer any TWO questions. Each question carries FIVE marks 2 x 5 = 10
42. Initial List:
4, 3, 10, 1, –6, 2
Pass1
i=1,temp=3
4,3,10,1,-6,2 (swap 4and 3)
3,4,10,1,-6,2
Pass 2
i=2, temp=10
3,4,10,1,-6,2 (no swap)
Pass 3
i=3, temp=1
3,4,10,1,-6,2 (swap 10and 1)
3,4,1,10,-6,2 (swap 4 and 1)
3,1,4,10,-6,2 (swap 3 and 1)
1,3,4,10,-6,2
Pass 4
i=4, temp=-6
1,3,4,10,-6,2 (swap 10and -6)
1,3,4,-6,10,2 (swap 4 and -6)
1,3,-6,4,10,2 (swap 3 and -6)
1,-6,3,4,10,2 (swap 1 and -6)
-6,1,3,4,10,2
Pass 5
i=5,temp=2
-6,1,3,4,10,2 (swap 10 and 2)
-6,1,3,4,2,10 (swap 4 and 2)
-6,1,3,2,4,10 (swap 3 and 2)
-6,1,2,3,4,10
43. Given temperatures (7 days): 34, 34, 27, 28, 34, 34
Step 3: Sum of squares
4.71+4.71+23.33+14.68+4.71+4.71=56.854.
44. i Primary key in the given table is pcode
[Link] PCode, Pname, UpriceFROM productORDER BY Pname DESC;
iii. ALTER TABLE product ADD discount float(10,2);
iv. UPDATE product SET discount = Uprice * 0.10 WHERE Uprice > 100;
UPDATE product SET discount = 0 WHERE Uprice <= 100;
v. UPDATE product SET Uprice = Uprice * 1.12 WHERE Manufacturer = 'Dove';
GOVERNEMENT OF KARNATAKA
KARNATAKA SCHOOL EXAMINATION AND ASSEMENT BOARD
6th CROSS, MALLESHWARAM, BENGALURU-560 003
2025-26 II PUC MODEL QUESTION PAPER- 3
SUBJECT: COMPUTER SCIENCE (41) MAXIMUM MARKS – 70
TIME: 03 HRS No. OF QUESTIONS – 44
__________________________________________________________________________________
PART A
Answer ALL the questions. Each question carries ONE mark.
I. Select the correct answer from the choices given. 20 x 1= 20
1. The exception raised when a local or global variable is not defined is
a. ImportError
b. TypeError
c. ValueError
d. NameError
2. The default file opening mode in Python is
a. <r> the read only mode
b. <w> the write mode
c. <a> the append mode
d. <r+> the read write mode
3. Assertion(A): A stack is a linear data structure that stores the elements in
FIFO
order
Reason(R): In stack a new element is added and removed from one end only
a. Both A and R are correct, and R is the correct explanation of A
b. Both A and R are correct, and A is not the correct explanation for R
c. A is true but R is false
d. A is false bur R is true
4. The operations used to view elements at the front of the Queue, without removing it from the
Queue is
a. Dequeue ()
b. Peek ()
c. Enqueue ()
d. Tell ()
5. The time complexity of a quadratic time algorithm is
a. n2
b. n3
c. log(n)
d. 1
6. Number of passes required to sort a list of size 100 using bubble sort is
a. 100
b. 1000
c. 10
d. 99
7. The purpose of data constraint in database is
a. to ensure reliability
b. to define size of databases
c. to specify storage format
d. to speedup query
8. The degree of the cartesian product of two relations A and B is the
a. Product of their cardinalities
b. Difference of their cardinalities
c. Quotient of their cardinalities
d. Sum of their cardinalities
9. Identify the correct date function from the following
a. FINDDATE ()
b. JULIANDATE ()
c. NOW ()
d. SYSTEM_DATE ()
10. The SQL command to modify the structure of a table is
a. CREATE
b. UPDATE
c. INSERT
d. ALTER
11. The device used for conversion between digital and analogue signal is
a. Modem
b. Repeater
c. Router
d. Switch
12. The approximate range of personal area networks is
a. 14 meters
b. 5 meters
c. 10 meters
d. 20 meters
13. Choose full duplex communications device from the following
a. Mobile phones
b. Walkie-talkie
c. Television
d. Microphone
14. Identify the request respond protocol from the following
a. IP
b. TCP
c. UDP
d. HTTP
15. Choose the item not belonging to the group
a. Firewall
b. Virus
c. Worms
d. Ransomware
II. Fill in the blanks choosing appropriate words from those given in the brackets (Pickle,
Exceptions, Product, Distinct, Union, Redundancy, Order By)
16. _______disrupts the normal execution of a program
17. ________ Python module is used to perform read-write operations on binary file
18. ________refers to duplication of data in a database
19. _______clause is used along with select to avoid duplicate values in an SQL query
20. ________operation is used to combine the selected rows of two tables at a time
PART B
III. Answer any FOUR questions. Each question carries TWO marks 4 x 2 = 8
21. With appropriate syntax explain PUSH operation on stack using Python
22. List out two operations on double ended queue
23. Mention any two applications of modified binary search
24. Explain the role of UNIQUE constraint in a database
25. Describe INSTR() function in MySql
26. What is URL? Explain.
27. Explain Point-To-Point protocol
PART C
IV. Answer any FOUR questions. Each question carries THREE marks 4 x 3 = 12
28. Define the following
a. Exception handler
b. Throwing an exception
c. Catching an exception
29. Answer the following
a. Open a file “[Link]” in “r” mode using with clause
b. Print the contents using appropriate function
30. What is the basic principle behind bubble sort?
31. What is hashing? Explain how it improves the efficiency of searching
32. Describe database schema
33. Explain natural join
34. Explain bus topology
PART D
V. Answer any FOUR questions. Each question carries FIVE marks 4 x 5 = 20
35. Using stack evaluate the postfix expression A B * C / D * with
A=3, B=5, C=1, D=4
36. Write a Python program test whether a given string STR stored in a double ended
queue DQ is a palindrome or not
37. Write an algorithm to perform linear search on a list L of N elements
38. Define DBMS and explain the following in respect of DBMS
a. Database Engine
b. Candidate Key
c. Query
d. Cardinality
39. Explain Local Area Network
40. What is transmission media? Explain types of transmission media
41. Explain Keyloggers in detail
PART E
Answer any TWO questions. Each question carries FIVE marks 2 x 5 = 10
42. Perform Selection sort algorithm on the following list of elements correctly
and neatly showing the various passes while sorting in ascending order
99 88 77 65 55
43. The following are the runs scored by two batsman’s A and B of team Alpha
on the first five innings of three consecutive test matches
Batsman A: 77,89,45,63,70 runs per innings
Batsman B: 100,45,122,88,99 runs per innings
a. Find standard deviation of scores of both Batsman A and B
b. Based on standard deviation who is more consistent in scoring
44. Write SQL commands for questions (a) to (e) based on data given in the
EMPLOYEE table given below
ID NAME DOB DEPARTMENT SALARY SEX
1111 AAAA 01-08-1998 ACCOUNTS 156780 M
2222 BBBB 12-12-200 HR 199950 F
1010 CCCC 23-06-2000 SALES 140000 F
5456 ZZZZ 01-01-2002 PRODUCTION 250000 M
7272 DDDD 11-01-2001 ACCOUNTS 180000 M
3486 LLLL 08-08-1998 HR 200000 M
a. Display information of all the employees in ascending order of their date of birth
b. To Compute the average salary of all the employees
c. To Display count of employees working in various departments
d. Command to Calculate the total salary of all the employees
e. Generate report of employees whose salary is in the range 150000 and 200000
***************
COMPUTER SCIENCE
II PU MODEL QUESTION PAPER – 3
ANSWER KEY
PART – A
I. Select the correct answer from the choices given. 15x1=15
1. (d) Name error
2. (a) <r> the read only mode
3. (a) Both A and R are correct, and R is the correct explanation of A
4. (b) Peek ()
5. (a) n2
6. (d) 99
7. (a) to ensure reliability
8. (a) Product of their cardinalities
9. (c) NOW ()
10. (d) ALTER
11. (a) MODEM
12. (c) 10 meters
13. (a) Mobile Phones
14. (d) HTTP
15. (a) Firewall
II. Fill in the blanks choosing the appropriate word. 5x1=5
16. Exceptions
17. Pickle
18. Redundancy
19. DISTINCT
20. Product
PART – B
III. Answer any FOUR questions. 4x2=8
21. PUSH inserts an element in the stack on TOP. The following code in Python declares an empty list. The user defined
function push inserts the item in the stack_list using append which adds on the Top of the list which is the end of the list
stack = []
def push(stack_list, item):
stack_list.append(item)
print("Pushed item:",item)
22. Operations in double ended Queue(any two)
INSERT FRONT – inserts an element in the FRONT of the Queue
INSERT REAR – inserts an element in the REAR of the Queue
DELETE FRONT – deletes an element in the FRONT of the Queue
DELETE REAR – deletes an element in the REAR of the Queue
23. Applications of Modified binary searchany two)
1. Indexing in databases
2. Implementing routing tables in routers
3. Data compression code
24. UNIQUE Ensures that all the values in a column are distinct/unique
For example,
ALTER TABLE GUARDIAN ADD UNIQUE(GPhone);
Here the attribute GPhone in the table Guardian will take values which are not repeated
25. INSTR(string, substring)
Returns the position of the first occurrence of the substring in the given string.
Returns 0, if the substring is not present in the string.
mysql> SELECT INSTR(“Informatics”, “ma”);
Output: 6
26. URI – Uniform Resource Identifier. It is a unique address or path for each resource located on the web. It is also known
as Uniform Resource Locator (URL). Every page on the web has a unique URL.
Examples are:
[Link]
http:// [Link],
[Link] etc.
URL is sometimes also called web address. However, a URL is not only the domain name. It contains other information
that completes a web address, as depicted below:(Its optional)
27. PPP is a communication protocol which establishes a dedicated and direct connection between two communicating
devices. This protocol defines how two devices will authenticate each other and establish a direct link between them to
exchange data. For example, two routers with direct connection communicate using PPP. The Internet users who
connect their home computers to the server of an Internet Service Provider (ISP) through a modem also use PPP. The
communicating devices should have duplex modes for using this protocol. This protocol maintains data integrity
ensuring that the packets arrive in order. It intimates the sender about damage or lost packets and asks to resend it.
PART – C
IV. Answer any FOUR questions. 4x3=12
28. a) Exception Handler: Exception handlers separate the main logic of the program from the error detection and
correction code.
b) Throwing an exception: The process of creating an exception object and handing it over to the runtime system is
called throwing an exception.
c) Catching an exception: The process of executing a suitable handler is known as catching the exception.
29. a) Open a file “[Link]” in “r” mode using with clause
with open(“[Link]”,”r”) as myObject:
content = [Link]()
b) Print the contents using appropriate function
with open(“[Link]”,”r”) as myObject:
content = [Link]()
print(“The content of the file is”,content)
30. It sorts a given list of elements by repeatedly comparing the adjacent elements and swapping them if they are
unordered. Swapping two elements means changing their positions with each other. In algorithm, every iteration
through each element of a list is called a pass. For a list with n elements, the bubble sort makes a total of n – 1 passes to
sort the list. In each pass, the required pairs of adjacent elements of the list will be compared. In order to arrange
elements in ascending order, the largest element is identified after each pass and placed at the correct position in the
list. This can be considered as the largest element being ‘bubbled up’. Hence the name Bubble sort. This sorted element
is not considered in the remaining passes and thus the list of elements gets reduced in successive passes.
31. Hashing is a technique which can be used to know the presence of a key in a list in just one step.
How it improves efficiency? (a brief of the following)
Hashing makes searching operations very efficient. A formula called hash function is used to calculate the value at an
index in the list. Thus, a hash function takes elements of a list one by one and generates an index value for every
element. This will generate a new list called the hash table. Each index of the hash table can hold only one item and the
positions are indexed by integer values starting from 0. Note that the size of the hash table can be larger than the size of
the list. A simple hash function that works with numeric values is known as the remainder method. It takes an element
from a list and divides it by the size of the hash table. The remainder so generated is called the hash value.
h(element) = element % size(hash table)
32. Database Schema is the design of a database. It is the skeleton of the database that represents the structure (table
names and their fields/columns), the type of data each column can hold, constraints on the data to be stored (if any),
and the relationships among the tables. Database schema is also called the visual or logical architecture as it tells us
how the data are organised in a database.
.33. Natural join is similar to Join that takes the product of two different tables which has a common attribute with same
values being repeated but natural join removes the redundant attribute. For example consider the following two tables:
As shown in the above table Ucode is repeated in Uniform Table and also cost table but it’s shown only once in the
natural join.
34. In bus topology, each communicating device connects to a transmission medium, known as bus. Data sent from a node
are passed on to the bus and hence are transmitted to the length of the bus in both directions. That means, data can be
received by any of the nodes connected to the bus. In this topology, a single backbone wire called bus is shared among
the nodes, which makes it cheaper and easier to maintain. Both ring and bus topologies are considered to be less secure
and less reliable.
PART – D
V. Answer any FOUR questions. 4x5=20
35. Using stack evaluate the postfix expression A B * C / D * with A=3, B=5, C=1, D=4
Ans: The value of A B * C / D * is 12
36. Algorithm for palindrome implementation using double ended queue
37. Algorithm for Linear Search
LinearSearch(numList, key, n)
Step 1: SET index = 0
Step 2: WHILE index < n, REPEAT Step 3
Step 3: IF numlist[index]= key THEN
PRINT “Element found at position”, index+1
STOP
ELSE
index = index+1
Step 4: PRINT “Search unsuccessful”
38. a. Database Engine - Database engine is the underlying component or set of programs used by a DBMS to create
database and handle various queries for data retrieval and manipulation
b. Candidate Key - A relation can have one or more attributes that takes distinct values. Any of these attributes can be
used to uniquely identify the tuples in the relation. Such attributes are called candidate keys as each of them are
candidates for the primary key.
c. Query - A query is a request to a database for obtaining information in a desired way. Query can be made to get data
from one table or from a combination of tables.
d. Cardinality - The number of tuples in a relation is called the Cardinality of the relation. For example, the cardinality
of relation GUARDIAN is 5 as there are 5 tuples in the table.
39. It is a network that connects computers, mobile phones, tablet, mouse, printer, etc., placed at a limited distance. The
geographical area covered by a LAN can range from a single room, a floor, an office having one or more buildings in the
same premise, laboratory, a school, college, or university campus. The connectivity is done by means of wires, Ethernet
cables, fibre optics, or Wi-Fi. LAN is comparatively secure as only authentic users in the network can access other
computers or shared resources. Users can print documents using a connected printer, upload/download documents
and software to and from the local server. Such LANs provide the short range communication with the high speed data
transfer rates. These types of networks can be extended up to 1 km. Data transfer in LAN is quite high, and usually
varies from 10 Mbps (called Ethernet) to 1000 Mbps (called Gigabit Ethernet), where Mbps stands for Megabits per
second. Ethernet is a set of rules that decides how computers and other devices connect with each other through cables
in a local area network or LAN.
40. A transmission medium can be anything that can carry signals or data between the source (transmitter) and destination
(receiver). There are two major types are there,
1. Wired/guided transmission media
a) Twisted pair - A twisted-pair consists of two copper wires twisted like a DNA helical structure. Both the
copper wires are insulated with plastic covers, covered with a protective outer wrapping. Twisted pairs are less
expensive and most commonly used in telephone lines and LANs. These cables are of two types: Unshielded
twisted-pair (UTP) and Shielded twisted-pair (STP)
b) Coaxial cable - it has a copper wire at the core of the cable which is surrounded with insulating material. The
insulator is further surrounded with an outer conductor (usually a copper mesh. The key to success of coaxial
cable is its shielded design that allows the cable's copper core to transmit data quickly, without interference of
environmental factors. They are used to carry signals of higher frequencies to a longer distance.
c) Optical fibre - Optic fibre uses refraction to direct the light through the media. A thin transparent strand of
glass at the centre is covered with a layer of less dense glass called cladding. These cables are of light weight
and have higher bandwidth which means higher data transfer rate. Signals can travel longer distances and
electromagnetic noise cannot affect the cable. However, optic fibers are expensive and unidirectional. Two
cables are required for full duplex communication
2. Wireless/unguided transmission media (any 2 points in each)
a) Radio waves
1. Waves of frequency range 3 KHz - 1 GHz
2. Omni-directional, these waves can move in all directions
3. Susceptible to interference
4. Radio waves can penetrate walls
5. These waves are used in AM and FM radio, television, cordless phones
b) Microwaves
1. Electromagnetic waves of frequency range 1GHz - 300GHz.
2. Unidirectional, can move in only one direction.
3. Cannot penetrate solid objects such as walls, hills or mountains.
4. Needs line-of-sight propagation i.e. both communicating antenna must be in the direction of each
other.
5. Used in point-to-point communication or unicast communication such as radar and satellite.
6. Provide very large information-carrying capacity
c) Infrared waves
1. Electromagnetic waves of frequency range 300GHz - 400THz.
2. Very high frequency waves.
3. Cannot penetrate solid objects such as walls.
4. Used for short-distance point-to-point communication such as mobile to-mobile, mobile-to-printer,
remote-control-to-TV, and Bluetooth enabled devices to other devices like mouse, keyboards etc
41. A keylogger can either be malware or hardware. The main purpose of this malware is to record the keys pressed by a
user on the keyboard. A keylogger makes logs of daily keyboard usage and may send it to an external entity as well. In
this way, very sensitive and personal information like passwords, emails, private conversations, etc. can be revealed to
an external entity without the knowledge of the user. One strategy to avoid the threat of password leaks by keyloggers is
to use a virtual keyboard while signing into your online accounts from an unknown computer.
Online Virtual Keyboard Vs On-Screen Keyboard : The names “on-screen” and “virtual” keyboard refer to any
software-based keyboard and are sometimes used interchangeably. But, there exists a notable difference between “on-
screen” and “online virtual” keyboards. Both types of keyboards may look the same, but the difference is in terms of the
layout or ordering of the keys. The on-screen keyboard of an operating system uses a fixed QWERTY key layout (Figure
12.3), which can be exploited by sophisticated keylogger software. However, an online virtual keyboard randomises the
key layout every time it is used (Figure 12.4), thereby making it very difficult for a keylogger software to know or record
the key(s) pressed by the user.
PART – E
VI. Answer any TWO questions. 2x5=10
42. Perform Selection sort algorithm on the following list of elements correctly
and neatly showing the various passes while sorting in ascending order
43. The following are the runs scored by two batsman’s A and B of team Alpha on the first five innings of three consecutive
test matches
Batsman A: 77,89,45,63,70 runs per innings
Batsman B: 100,45,122,88,99 runs per innings
a. Find standard deviation of scores of both Batsman A and B
b. Based on standard deviation who is more consistent in scoring
a) For Batsman A
For Batsman B
b) Batsman A Standard Deviation = 14.6
Batsman B Standard Deviation = 25.4
Therefore, Batsman A is consistent as his standard deviation is 14.6
44. Write appropriate SQL query for the following. Table Name : EMPLOYEE
a. Display information of all the employees in ascending order of their date of birth
SELECT * FROM EMPLYEE ORDER BY DOB;
b. To Compute the average salary of all the employees
SELECT AVG(SALARY) FROM EMPLOYEE;
c. To Display count of employees working in various departments
SELECT DEPARTMENET, COUNT(*) FROM EMPLOYEE GROUP BY DEPARTMENT;
d. Command to Calculate the total salary of all the employees
SELECT SUM(SALARY) FROM EMPLOYEE;
e. Generate report of employees whose salary is in the range 150000 and 200000
SELECT * FROM EMPLOYEE WHERE SALARY BETWEEN 150000 AND 200000