KEMBAR78
Operating System MCQs and Answers | PDF | Scheduling (Computing) | Microsoft Sql Server
0% found this document useful (0 votes)
867 views47 pages

Operating System MCQs and Answers

The document contains questions and answers related to operating system concepts like processes, scheduling, memory management, and more. Some key points: - An operating system manages hardware resources, provides services to applications, and acts as an interface between hardware and software. - Common scheduling algorithms include first-come first-served, round robin, and priority scheduling. Ready queues are used to track processes waiting to execute. - Memory management techniques like paging and segmentation break memory into pages/segments and use page/segment tables to map virtual to physical addresses. Frame tables track available memory frames. - Other concepts covered include deadlocks, I/O handling, and the role of the kernel, dispatcher, and

Uploaded by

Priyanka Mahajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
867 views47 pages

Operating System MCQs and Answers

The document contains questions and answers related to operating system concepts like processes, scheduling, memory management, and more. Some key points: - An operating system manages hardware resources, provides services to applications, and acts as an interface between hardware and software. - Common scheduling algorithms include first-come first-served, round robin, and priority scheduling. Ready queues are used to track processes waiting to execute. - Memory management techniques like paging and segmentation break memory into pages/segments and use page/segment tables to map virtual to physical addresses. Frame tables track available memory frames. - Other concepts covered include deadlocks, I/O handling, and the role of the kernel, dispatcher, and

Uploaded by

Priyanka Mahajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Subject Name- Operating System A

& N
Paper Code- UG-CS-321 S
1 What is operating system? d
a) collection of programs that manages hardware resources
b) system service provider to the application programs
c) link to interface the hardware and application programs
d) all of the mentioned
2 To access the services of operating system, the interface is provided by the _____ a
a) System calls
b) API
c) Library
d) Assembly instructions
3 Which one of the following is not true? c
a) kernel is the program that constitutes the central core of the operating system
b) kernel is the first part of operating system to load into memory during booting
c) kernel is made of various modules which can not be loaded in running
operating system
d) kernel remains in the memory during the entire computer session
4 What is the main function of the command interpreter? a
a) to get and execute the next user-specified command
b) to provide the interface between the API and application program
c) to handle the files in operating system
d) none of the mentioned
5 If a process fails, most operating system write the error information to a ______ a
a) log file
b) another running process
c) new file
d) none of the mentioned
6 Which of the following do not belong to queues for processes? b
a) Job Queue
b) PCB queue
c) Device Queue
d) Ready Queue
7 When the process issues an I/O request __________ a
a) It is placed in an I/O queue
b) It is placed in a waiting queue
c) It is placed in the ready queue
d) It is placed in the Job queue
8 Which module gives control of the CPU to the process selected by the short-term a
scheduler?
a) dispatcher
b) interrupt
c) scheduler
d) none of the mentioned
9 The processes that are residing in main memory and are ready and waiting to b
execute are kept on a list called _____________
a) job queue
b) ready queue
c) execution queue
d) process queue
10 Which scheduling algorithm allocates the CPU first to the process that requests a
the CPU first?
a) first-come, first-served scheduling
b) SHORTEST job scheduling
c) priority scheduling
d) none of the mentioned
11 In priority scheduling algorithm ____________ a
a) CPU is allocated to the process with highest priority
b) CPU is allocated to the process with lowest priority
c) Equal priority processes can not be scheduled
d) None of the mentioned
12 Process are classified into different groups in ____________ d
a) shortest job scheduling algorithm
b) round robin scheduling algorithm
c) priority scheduling algorithm
d) multilevel queue scheduling algorithm
13 Round robin scheduling falls under the category of ____________ b
a) Non-preemptive scheduling
b) Preemptive scheduling
c) All of the mentioned
d) None of the mentioned
14 The portion of the process scheduler in an operating system that dispatches a
processes is concerned with ____________
a) assigning ready processes to CPU
b) assigning ready processes to waiting queue
c) assigning running processes to blocked queue
d) all of the mentioned
15 What is FIFO algorithm? b
a) first executes the job that came in last in the queue
b) first executes the job that came in first in the queue
c) first executes the job that needs minimal processor
d) first executes the job that has maximum processor needs
16 What is Scheduling? a
a) allowing a job to use the processor
b) making proper use of processor
c) all of the mentioned
d) none of the mentioned
17 What is a reusable resource? a
a) that can be used by one process at a time and is not depleted by that use
b) that can be used by more than one process at a time
c) that can be shared between various threads
d) none of the mentioned
18 Which of the following condition is required for a deadlock to be possible? d
a) mutual exclusion
b) a process may hold allocated resources while awaiting assignment of other
resources
c) no resource can be forcibly removed from a process holding it
d) all of the mentioned
19 A system is in the safe state if ____________ a
a) the system can allocate resources to each process in some order and still avoid
a deadlock
b) there exist a safe sequence
c) all of the mentioned
d) none of the mentioned
20 The circular wait condition can be prevented by ____________ a
a) defining a linear ordering of resource types
b) using thread
c) using pipes
d) all of the mentioned
21 To avoid deadlock ____________ a
a) there must be a fixed number of resources to allocate
b) resource allocation must be done only once
c) all deadlocked processes must be aborted
d) inversion technique can be used
22 The ___________ swaps processes in and out of the memory. a
a) Memory manager
b) CPU
c) CPU manager
d) User
23 In a system that does not support swapping ____________ a
a) the compiler normally binds symbolic addresses (variables) to relocatable
addresses
b) the compiler normally binds symbolic addresses to physical addresses
c) the loader binds relocatable addresses to physical addresses
d) binding of symbolic addresses to physical addresses normally takes place
during execution
24 CPU fetches the instruction from memory according to the value of a
____________
a) program counter
b) status register
c) instruction register
d) program status word
25 A memory buffer used to accommodate a speed differential is called b
____________
a) stack pointer
b) cache
c) accumulator
d) disk buffer
26 Which one of the following is the address generated by CPU? c
a) physical address
b) absolute address
c) logical address
d) none of the mentioned
27 Memory management technique in which system stores and retrieves data from b
secondary storage for use in main memory is called?
a) fragmentation
b) paging
c) mapping
d) none of the mentioned
28 The address of a page table in memory is pointed by ____________ b
a) stack pointer
b) page table base register
c) page register
d) program counter
29 The page table contains ____________ a
a) base address of each page in physical memory
b) page offset
c) page size
d) none of the mentioned
30 Physical memory is broken into fixed-sized blocks called ________ a
a) frames
b) pages
c) backing store
d) none of the mentioned
31 Logical memory is broken into blocks of the same size called _________ b
a) frames
b) pages
c) backing store
d) none of the mentioned
32 Every address generated by the CPU is divided into two parts. They are b
____________
a) frame bit & page number
b) page number & page offset
c) page offset & frame bit
d) frame offset & page offset
33 The __________ is used as an index into the page table. b
a) frame bit
b) page number
c) page offset
d) frame offset
34 The size of a page is typically ____________ b
a) varied
b) power of 2
c) power of 4
d) none of the mentioned
35 The operating system maintains a ______ table that keeps track of how many c
frames have been allocated, how many are there, and how many are available.
a) page
b) mapping
c) frame
d) memory
36 Smaller page tables are implemented as a set of _______ d
a) queues
b) stacks
c) counters
d) registers
37 he page table registers should be built with _______ b
a) very low speed logic
b) very high speed logic
c) a large memory space
d) none of the mentioned
38 For every process there is a __________ a
a) page table
b) copy of page table
c) pointer to page table
d) all of the mentioned
39 In segmentation, each address is specified by ____________ a
a) a segment number & offset
b) an offset & value
c) a value & segment number
d) a key & value
40 In paging the user provides only ________ which is partitioned by the hardware a
into ________ and ______
a) one address, page number, offset
b) one offset, page number, address
c) page number, offset, address
d) none of the mentioned
41 Each entry in a segment table has a ____________ a
a) segment base
b) segment peak
c) segment value
d) none of the mentioned
42 The segment base contains the ____________ b
a) starting logical address of the process
b) starting physical address of the segment in memory
c) segment length
d) none of the mentioned
43 The protection bit is 0/1 based on ____________ c
a) write only
b) read only
c) read – write
d) none of the mentioned
44 If one or more devices use a common set of wires to communicate with the d
computer system, the connection is called ______
a) CPU
b) Monitor
c) Wirefull
d) Bus
45 A ________ is a collection of electronics that can operate a port, a bus, or a a
device.
a) controller
b) driver
c) host
d) bus
46 Each request requires that the system consider the _____________ to decide a
whether the current request can be satisfied or must wait to avoid a future
possible deadlock.
a) resources currently available
b) processes that have previously been in the system
c) resources currently allocated to each process
d) future requests and releases of each process
47 Given a priori information about the ________ number of resources of each type c
that maybe requested for each process, it is possible to construct an algorithm that
ensures that the system will never enter a deadlock state.
a) minimum
b) average
c) maximum
d) approximate
48 A deadlock avoidance algorithm dynamically examines the __________ to a
ensure that a circular wait condition can never exist.
a) resource allocation state
b) system storage state
c) operating system
d) resources
49 A state is safe, if ____________ b
a) the system does not crash due to deadlock occurrence
b) the system can allocate resources to each process in some order and still avoid
a deadlock
c) the state keeps the system protected and safe
d) all of the mentioned
50 A system is in a safe state only if there exists a ____________ c
a) safe allocation
b) safe resource
c) safe sequence
d) all of the mentioned
51 The data structures available in the Banker’s algorithm are ____________ d
a) Available
b) Need
c) Allocation
d) All of the mentioned
52 The address generated by the CPU is referred to as ____________ b
a) Physical address
b) Logical address
c) Neither physical nor logical
d) None of the mentioned
53 The address loaded into the memory address register of the memory is referred to a
as ____________
a) Physical address
b) Logical address
c) Neither physical nor logical
d) None of the mentioned
54 The size of a process is limited to the size of ____________ a
a) physical memory
b) external storage
c) secondary storage
d) none of the mentioned
55 If execution time binding is being used, then a process ______ be swapped to a d
different memory space.
a) has to be
b) can never
c) must
d) may
56 The ________ consists of all processes whose memory images are in the backing b
store or in memory and are ready to run.
a) wait queue
b) ready queue
c) cpu
d) secondary storage
57 The major part of swap time is _______ time. b
a) waiting
b) transfer
c) execution
d) none of the mentioned
58 Swap space is allocated ____________ a
a) as a chunk of disk
b) separate from a file system
c) into a file system
d) all of the mentioned
59 Which process can be affected by other processes executing in the system? a
a) cooperating process
b) child process
c) parent process
d) init process
60 When several processes access the same data concurrently and the outcome of the b
execution depends on the particular order in which the access takes place, is
called?
a) dynamic condition
b) race condition
c) essential condition
d) critical condition
Subject Name- MS SQL Server A
& N
Paper Code- UG-CS-322 S
1 Reasons for consideration of the stored procedure can be? D
a) With which tables will you have to work? Does it make sense to create a
VIEW first?
b) How often will this procedure actually be used?
c) Do you want to view data in the database (SELECT), insert new records
(INSERT INTO), or do I want to change an existing record (UPDATE)?
d) All of the mentioned
2 Point out the correct statement. A
a) Conditional logic applied to the results of the first SQL statements determines
which subsequent SQL statements are executed
b) A stored procedure is a group of Transact-SQL statements pre compiled into a
single execution plan
c) Stored procedures cannot improve performance
d) All of the mentioned
3 Which of the following stored procedure is used for error messages? A
a) sp_addmessage
b) sp_dropmessage
c) sp_altermessage
d) all of the mentioned
4 Stored procedure used to remember the exact number of bytes is B
a) sp_datatype
b) sp_datatype_info
c) sp_info
d) none of the mentioned
5 Which of the following statements is/are false for Declarative Management C
Framework (DMF) in sql server 2008?
A. System for managing the instances of SQL Server 2008
B. SQL Server does not enforce to define the policies by using Management
Studio
C. Both b and d
D. A policy can be designed for allowing the usage of unauthorized applications
6 CPUs can dynamically be added to a running system, by using ____________ B
feature.
A. Cold Add CPU
B. Hot Add CPU
C. Dynamic add CPU
D. Passive add CPU
7 Which of the following statements is/are true for SQL server? B
A. SQL Server has Logical Architecture and Physical Architecture.
B. Both a and c
C. SQL Server is compatible with structured query language and has rich support
for XML
D. SQL Server is a DBMS, a complete database.
8 Which utilities can we used to export data from sql server to a text file? D
A. DTS export wizard
B. BCP
C. ISQL
D. A and b
9 Tools for importing and exporting data in sql server D
A. bcp command utility
B. BULK inserts statement
C. DTS
D. ALL of the above
10 Which of the following is not correct for DELETE and TRUNCATE? C
A. DELETE table can be rolled back
B. TRUNCATE table cannot have triggers
C. TRUNCATE table can have criteria
D. DELETE table can have criteria
11 B
The SQL WHERE clause:
A.limits the column data that are returned.
B.limits the row data are returned.
C.Both A and B are correct.
D.Neither A nor B are correct

12 Which type of integrity preserves the defined relationship between tables when C
records are entered or deleted?
A. Entity integrity
B. Domain integrity
C. Referential integrity
D. User-defined integrity
13 How many Primary key constraints can be included in a table definition? A
A. One
B. Two
14 Which of the following stored procedure is used for error messages? A
a) sp_addmessage
b) sp_dropmessage
c) sp_altermessage
d) all of the mentioned
15 Which of the following is/are false for RAW mode of FOR XML? D
A. XMLSCHEMA option does not returns an in-line XSD schema.
B. BINARY BASE32 returns the binary data in base32-encoded format.
C. Each row in the query result is transformed into an XML element
D. Both a and b above
16 Which utilities can we used to export data from sql server to a text file? D
A. DTS export wizard
B. BCP
C. ISQL
D. A and b
17 How inserting data through stored procedure do reduces network traffic and C
increase database performance?
A. Stored procedure can accept parameter
B. Permission check is not required
C. The execution plan is stored in the cache after it was executed the first time.
18 Which statement is used to define a cursor? C
A. OPEN
B. FETCH
C. DECLARE CURSOR
D. @@FETCH_STATUS
19 Cursor that reflects the changes made to the database table even after the result B
set is returned
A. Static
B. Dynamic
C. FORWARD_ONLY
D. Keyset
20 By default sql server has ___________ isolation level A
A. READ COMMITTED
B. READ UNCOMMITTED
C. SERIALIZABLE
D. REPEATABLE READ
21 Choose the incorrect option about the sql server index D
A. Two types of indexes – clustered indexes and non-clustered indexes
B. Both types use B-TREE for searching data
C. Only one clustered index on a table
D. More than one clustered index on a table
22 Which of the following DBCC command is used to see when was the last time A
the index rebuild?
A. DBCC SHOW_STATISTICS
B. DBCC SHOWCONFIG
C. DBCC DBREINDEX
23 Tools for importing and exporting data in sql server D
A. bcp command utility
B. BULK inserts statement
C. DTS
D. ALL of the above
24 The identifers in SQL can have a character range from? D
A. 1 to 100
B. 1 to 128
C. 1 to 64
D. 1 to 132
25 Which of the following procedures are created by user for own actions? A
a) User Defined Stored Procedure
b) Extended Procedure
c) CLR Stored Procedure
d) All of the mentioned
26 Which of the following stored procedure is already defined in Sql Server? D
a) User Defined Stored Procedure
b) Extended Procedure
c) CLR Stored Procedure
d) System defined Procedure
27 Type of procedure that are based on the CLR (Common Language Runtime) is C
____________
a) User Defined Stored Procedure
b) Extended Procedure
c) CLR Stored Procedure
d) System defined Procedure
28 Nesting limit OF stored procedure is up to ________level. B
a) 30
b) 32
c) 34
d) 36
29 Stored procedure is a __________ set of one or more SQL statements. C
a) interpreted
b) compiled
c) pre compiled
d) none of the mentioned
30 Function cannot be used for __________ statement. D
a) Create
b) Drop
c) Select
d) Insert
31 Syntax for creation of user defined function is ____________ B
a) CREATE FUNCTIONS
b) CREATE FUNCTION
c) CREATE FUNC
d) All of the mentioned
32 User defined scalar function can return only __________ data type values. D
a) Numerical
b) String
c) Float
d) All of the mentioned
33 Trigger is special type of __________ procedure. A
a) Stored
b) Function
c) View
d) Table
34 How many types of DML triggers are present in SQL Server? D
a) 1
b) 3
c) 5
d) None of the mentioned
35 AFTER trigger in SQL Server can be applied to _________________ C
a) Table
b) Views
c) Table and Views
d) Function
36 Which of the following is not a typical trigger action? B
a) Insert
b) Select
c) Delete
d) All of the mentioned
37 Triggers can be enabled or disabled with the ________ statement. A
a) ALTER TABLE statement
b) DROP TABLE statement
c) DELETE TABLE statement
d) None of the mentioned
38 _____________ is special type of trigger based on CLR environment. D
a) DML
b) DDL
c) LOGON
d) CLR
39 DDL triggers can be applied to __________ statement. A
a) CREATE
b) UPDATE
c) DELETE
d) INSERT
40 Scope of DDL triggers in SQL Server can be _____________ A
a) Server
b) Client
c) Views
d) None of the mentioned
41 Which of the following is a calling syntax for sp_executesql? C
a) sp_execute<@stmt> [<@param1 data_type>,<@param2 data_type>, …]
b) sp_sql<@stmt> [<@param1 data_type>,<@param2 data_type>, …]
c) sp_executesql<@stmt> [<@param1 data_type>,<@param2 data_type>, …]
d) sp_executesql [<@param1 data_type>,<@param2 data_type>, …]
42 The Dynamic SQL Queries in a variable are __________ until they are executed. D
a) Compiled
b) Parsed
c) Checked for errors
d) All of the mentioned
43 Which of the stored procedure used for dynamic SQL is prone to attacks? D
a) xp_executesql
b) executesql
c) sp_execute
d) sp_executesql
44 Which of the following script is an example of Quick detection in the SQL B
injection attack?
a) SELECT loginame FROM master..sysprocesses WHERE spid = @@SPID
b) For integer inputs : convert(int,@@version)
c) IF condition true-part ELSE false-part (S)
d) SELECT header, txt FROM news UNION ALL SELECT name, pass FROM
members
45 SQL injection is an attack in which _________ code is inserted into strings that A
are later passed to an instance of SQL Server.
a) malicious
b) redundant
c) clean
d) non malicious
46 Which is the default field terminator for bulk insert in SQL Server? A
a) Comma
b) Full stop
c) Parenthesis
d) Brackets
47 Which of the following feature cannot be used in simple recovery mode? D
a) Media recovery without data loss
b) Log shipping
c) Database mirroring
d) All of the mentioned
48 What types of database maintenance should be executed? D
a) Update SQL Server’s usage
b) Validate the database objects and system catalogs are free of corruption
c) Determine the fragmentation for tables and indexes
d) All of the mentioned
49 SQL Server Agent consist of _____ component. B
a) 2
b) 3
c) 4
d) 5
50 SQL Agent Job definitions are specified in which database? A
a) msdb
b) master
c) tempdb
d) all of the mentioned
51 _________start and stop the SQL Server Agent Service . D
a) SSMS
b) Windows Services console
c) QL Server Service Manager
d) All of the mentioned
52 Which of the following wizard provides creation logins on the destination server? A
a) Copy Database
b) Move Database
c) Detach database
d) Attach database
53 Which of the following table stores history detail for log shipping jobs? C
a) log_shipping_monitor_alert
b) log_shipping_monitor_primary
c) log_shipping_monitor_history_detail
d) none of the mentioned
54 Which of the following benefit is provided by database mirroring? D
a) Increases data protection
b) Improves the availability of the production database
c) Increases availability of a database
d) All of the mentioned
55 Which of the following pair of technology is supported in SQL Server? D
a) Mirroring and Replication
b) Mirroring and Clustering
c) Mirroring and Log Shipping
d) All of the mentioned
56 Which of the following mode allows for the collection and uploading of data to A
occur on demand?
a) Non-cached mode
b) Cached mode
c) Mixed mode
d) All of the mentioned
57 Which of the following resource can be locked in SQL Server? B
a) TID
b) RID
c) PID
d) SID
58 _________ is a feature that is used for tracking the changes on a table C
A. Change schema Capture
B. Change table Capture
C. Change Data Capture
D. Change database Capture
59 To remove archival compression and restore the data to columnstore compression A
_____________
a) Use ALTER TABLE
b) Use ALTER COLUMN
c) Use ALTER DATABASE
d) All of the mentioned
60 SQL Server 2008 provides enhanced partitioning information for __________ C
execution plans.
a) compile-time
b) run time
c) both compile-time and run-time
d) all of the mentioned
Subject Name- Internet Programming using PHP A
& N
Paper Code- UG-CS-323 S
1 What does PHP stand for? d
i) Personal Home Page
ii) Hypertext Preprocessor
iii) Pretext Hypertext Processor
iv) Preprocessor Home Page
a) Both i) and iii)
b) Both ii) and iv)
c) Only ii)
d) Both i) and ii)
2 PHP files have a default file extension of_______ c
a) .html
b) .xml
c) .php
d) .ph
3 What should be the correct syntax to write a PHP code? c
a) < php >
b) < ? php ?>
c) <? ?>
d) <?php ?>
4 Which version of PHP introduced Try/catch Exception? d
a) PHP 4
b) PHP 5
c) PHP 6
d) PHP 5 and later
5 How should we add a single line comment in our PHP code? c
i) /?
ii) //
iii) #
iv) /* */
a) Only ii)
b) i), iii) and iv)
c) ii), iii) and iv)
d) Both ii) and iv)
6 Which of the following PHP statement/statements will store 111 in variable num? c
i) int $num = 111;
ii) int mum = 111;
iii) $num = 111;
iv) 111 = $num;
a) Both i) and ii)
b) i), ii), iii) and iv)
c) Only iii)
d) Only i)
7 What will be the output of the following PHP code? b
<?php
$num = 1;
$num1 = 2;
print $num . "+". $num1;
?>
a) 3
b) 1+2
c) 1.+.2
d) Error
8 Which is the right way of declaring a variable in PHP? d
i) $3hello
ii) $_hello
iii) $this
iv) $This
a) Only ii)
b) Only iii)
c) ii), iii) and iv)
d) ii) and iv)
9 What will be the output of the following PHP code? c
<?php
$foo = 'Bob';
$bar = &$foo;
$bar = "My name is $bar";
echo $bar;
echo $foo;
?>
a) Error
b) My name is BobBob
c) My name is BobMy name is Bob
d) My name is Bob Bob
10 What will be the output of the following PHP code? c
<?php
$total = "25 students";
$more = 10;
$total = $total + $more;
echo "$total";
?>
a) Error
b) 35 students
c) 35
d) 25 students
11 Which statement will output $x on the screen? a
a) echo “\$x”;
b) echo “$$x”;
c) echo “/$x”;
d) echo “$x;”;
12 What will be the output of the following PHP code? d
<?php
$a = "clue";
$a .= "get";
echo "$a";
?>
a) get
b) true
c) false
d) clueget
13 Which type of function call is used in line 8 in the following PHP code? a
<?php
function calc($price, $tax)
{
$total = $price + $tax;
}
$pricetag = 15;
$taxtag = 3;
calc($pricetag, $taxtag);
?>
a) Call By Value
b) Call By Reference
c) Default Argument Value
d) Type Hinting
14 What will be the output of the following PHP code? c
<?php
function calc($price, $tax="")
{
$total = $price + ($price * $tax);
echo "$total";
}
calc(42);
?>
a) Error
b) 0
c) 42
d) 84
15 Which of the following are valid function names? b
i) function()
ii) €()
iii) .function()
iv) $function()
a) Only i)
b) Only ii)
c) i) and ii)
d) iii) and iv)
16 What will be the output of the following PHP code? c
<?php
function a()
{
function b()
{
echo 'I am b';
}
echo 'I am a';
}
b();
a();
?>
a) I am b
b) I am bI am a
c) Error
d) I am a Error
17 Which one of the following PHP functions can be used to find files? d
a) glob()
b) file()
c) fold()
d) get_file()
18 Which one of the following functions can be used to compress a string? d
a) zip_compress()
b) zip()
c) compress()
d) gzcompress()
19 What will be the output of the following PHP code? d
<?php
echo chr(52);
?>
a) 1
b) 2
c) 3
d) 4
20 PHP’s numerically indexed array begin with position ___________ c
a) 1
b) 2
c) 0
d) -1
21 Which of the following are correct ways of creating an array? a
i) state[0] = "karnataka";
ii) $state[] = array("karnataka");
iii) $state[0] = "karnataka";
iv) $state = array("karnataka");
a) iii) and iv)
b) ii) and iii)
c) Only i)
d) ii), iii) and iv)
22 What will be the output of the following PHP code? d
<?php
$fruits = array ("apple", "orange", array ("pear", "mango"),
"banana");
echo (count($fruits, 1));
?>
a) 3
b) 4
c) 5
d) 6
23 The practice of separating the user from the true inner workings of an application c
through well-known interfaces is known as _________
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Abstraction
24 Which of the following term originates from the Greek language that means b
“having multiple forms,” defines OOP’s ability to redefine, a class’s
characteristics?
a) Abstraction
b) Polymorphism
c) Inheritance
d) Differentia
25 The practice of creating objects based on predefined classes is often referred to d
as ______________
a) class creation
b) object creation
c) object instantiation
d) class instantiation
26 Which one of the following property scopes is not supported by PHP? a
a) friendly
b) final
c) public
d) static
27 Which one of the following is the right way to define a constant? d
a) constant PI = “3.1415”;
b) const $PI = “3.1415”;
c) constant PI = ‘3.1415’;
d) const PI = ‘3.1415’;
28 Which version of PHP was added with Exception handling? b
a) PHP 4
b) PHP 5
c) PHP 5.3
d) PHP 6
29 How many methods are available for the exception class? c
a) 5
b) 6
c) 7
d) 8
30 Which version added the method getPrevious()? d
a) PHP 4
b) PHP 5
c) PHP 5.1
d) PHP 5.3
31 Which of the following statements invoke the exception class? b
a) throws new Exception();
b) throw new Exception();
c) new Exception();
d) new throws Exception();
32 You can extend the exception base class, but you cannot override any of the b
preceding methods because the are declared as__________
a) protected
b) final
c) static
d) private
33 You can extend the exception base class, but you cannot override any of the a
preceding methods because the are declared as__________
a) protected
b) final
c) static
d) private
34 Which two predefined variables are used to retrieve information from forms? b
a) $GET & $SET
b) $_GET & $_SET
c) $__GET & $__SET
d) GET & SET
35 The attack which involves the insertion of malicious code into a page frequented c
by other users is known as _______________
a) basic sql injection
b) advanced sql injection
c) cross-site scripting
d) scripting
36 When you use the $_GET variable to collect data, the data is visible to c
___________
a) none
b) only you
c) everyone
d) selected few
37 Which one of the following should not be used while sending passwords or other a
sensitive information?
a) GET
b) POST
c) REQUEST
d) NEXT
38 Which function is used to remove all HTML tags from a string passed to a form? b
a) remove_tags()
b) strip_tags()
c) tags_strip()
d) tags_remove()
39 To validate an email address, which flag is to be passed to the function a
filter_var()?
a) FILTER_VALIDATE_EMAIL
b) FILTER_VALIDATE_MAIL
c) VALIDATE_EMAIL
d) VALIDATE_MAIL
40 Which one of the following is the very first task executed by a session enabled c
page?
a) Delete the previous session
b) Start a new session
c) Check whether a valid session exists
d) Handle the session
41 How many ways can a session data be stored? b
a) 3
b) 4
c) 5
d) 6
42 Which directive determines how the session information will be stored? d
a) save_data
b) session.save
c) session.save_data
d) session.save_handler
43 If session.use_cookie is set to 0, this results in use of _____________ c
a) Session
b) Cookie
c) URL rewriting
d) Nothing happens
44 Which one of the following is the default PHP session name? a
a) PHPSESSID
b) PHPSESID
c) PHPSESSIONID
d) PHPIDSESS
45 Which one of the following function is used to start a session? b
a) start_session()
b) session_start()
c) session_begin()
d) begin_session()
46 Which one of the following databases has PHP supported almost since the d
beginning?
a) Oracle Database
b) SQL
c) SQL+
d) MySQL
47 The updated MySQL extension released with PHP 5 is typically referred to as c
_______________
a) MySQL
b) mysql
c) mysqli
d) mysqly
48 Which one of the following statements is used to create a table? a
a) CREATE TABLE table_name (column_name column_type);
b) CREATE table_name (column_type column_name);
c) CREATE table_name (column_name column_type);
d) CREATE TABLE table_name (column_type column_name);
49 Which one of the following statements can be used to select the database? d
a) $mysqli=select_db('databasename');
b) mysqli=select_db('databasename');
c) mysqli->select_db('databasename');
d) $mysqli->select_db('databasename');
50 Which one of the following methods can be used to diagnose and display c
information about a MySQL connection error?
a) connect_errno()
b) connect_error()
c) mysqli_connect_errno()
d) mysqli_connect_error()
51 What will be the output of the following PHP code? a
<?php
$x;
if ($x)
print "hi" ;
else
print "how are u";
?>
a) how are u
b) hi
c) error
d) no output
52 What will be the output of the following PHP code? b
<?php
$a = "2";
switch ($a)
{
case 1:
print "hi";
case 2:
print "hello";
break;
default:
print "hi1";
}
?>
a) hihellohi1
b) hello
c) hihi1
d) hi1
53 What will be the output of the following PHP code? b
<?php
do
{
print "hi";
}
while(0);
print "hello";
?>
a) infinite loop
b) hihello
c) hello
d) error
54 What will be the output of the following PHP code? a
<?php
$colors = array("red","green","blue","yellow");
foreach ($colors as $value)
{
echo "$value <br>";
}
?>
a) red green blue yellow
b) red
c) no output
d) error
55 What will be the output of the following PHP code? c
<?php
function calc($price, $tax="")
{
$total = $price + ($price * $tax);
echo "$total";
}
calc(42);
?>
a) Error
b) 0
c) 42
d) 84
56 What will be the output of the following PHP code? d
<?php
define("GREETING", "PHP is a scripting language", true);
echo GREETING;
echo "<br>"
echo GREETING;
?>
a) PHP is a scripting language
b) GREETING GREEtING
c) GREETING
d) PHP is a scripting language PHP is a scripting language
57 What will be the output of the following PHP code? d
<?php
one = 1;
two = 2;
three = 3;
four = 4;
echo "one / two + three / four";
?>
a) 0.75
b) 0.05
c) 1.25
d) Error
58 Once your application can generate administrative links, you need to load those c
links into _________
a) php.ini
b) index.ini
c) index.php
d) start.php
59 The (|/) tells the server to match ___________ d
a) nothing
b) forward slash
c) backward slash
d) either nothing or a forward slash
60 When a user confirms that he wishes to delete an entry, that entry’s URL is c
passed to a function which removes the entry from the __________
a) index.php
b) function.inc.php
c) database
d) admin.php
Subject Name-Theoretical Computer Science A
& N
Paper Code- UG-CS-324 S
1 Assume the R is a relation on a set A, aRb is partially ordered such that a and b d
are _____________
a) reflexive
b) transitive
c) symmetric
d) reflexive and transitive
2 The non- Kleene Star operation accepts the following string of finite length over b
set A = {0,1} | where string s contains even number of 0 and 1
a) 01,0011,010101
b) 0011,11001100
c) ε,0011,11001100
d) ε,0011,11001100
3 A regular language over an alphabet ∑ is one that cannot be obtained from the d
basic languages using the operation
a) Union
b) Concatenation
c) Kleene*
d) All of the mentioned
4 Which of the following is a not a part of 5-tuple finite automata? d
a) Input alphabet
b) Transition function
c) Initial State
d) Output Alphabet
5 Moore Machine is an application of: b
a) Finite automata without input
b) Finite automata with output
c) Non- Finite automata with output
d) None of the mentioned
6 What is the output for the given language? a
Language: A set of strings over ∑= {a, b} is taken as input and it prints 1 as an
output “for every occurrence of a, b as its substring. (INPUT: abaaab)
a) 0010001
b) 0101010
c) 0111010
d) 0010000
7 The output alphabet can be represented as: b
a) δ
b) ∆
c) ∑
d) None of the mentioned
8 Which of the following is a correct statement? a
a) Moore machine has no accepting states
b) Mealy machine has accepting states
c) We can convert Mealy to Moore but not vice versa
d) All of the mentioned
9 In mealy machine, the O/P depends upon? c
a) State
b) Previous State
c) State and Input
d) Only Input
10 The following mealy machine outputs which of the following? b

a) 9’s Complement
b) 2’s Complement
c) 1’s Complement
d) 10’s Complement
11 A Language for which no DFA exist is a________ b
a) Regular Language
b) Non-Regular Language
c) May be Regular
d) Cannot be said
12 A DFA cannot be represented in the following format d
a) Transition graph
b) Transition Table
c) C code
d) None of the mentioned
13 What the following DFA accepts? a

a) x is a string such that it ends with ‘101’


b) x is a string such that it ends with ‘01’
c) x is a string such that it has odd 1’s and even 0’s
d) x is a strings such that it has starting and ending character as 1
14 Which of the following will not be accepted by the following DFA? a

a) ababaabaa
b) abbbaa
c) abbbaabb
d) abbaabbaa
15 Which of the following is not an example of finite state machine system? d
a) Control Mechanism of an elevator
b) Combinational Locks
c) Traffic Lights
d) Digital Watches
16 According to the 5-tuple representation i.e. FA= {Q, ∑, δ, q, F} b
Statement 1: q ϵ Q’; Statement 2: FϵQ
a) Statement 1 is true, Statement 2 is false
b) Statement 1 is false, Statement 2 is true
c) Statement 1 is false, Statement 2 may be true
d) Statement 1 may be true, Statement 2 is false
17 Which of the following x is accepted by the given DFA (x is a binary string ∑= d
{0,1})?

a) divisible by 3
b) divisible by 2
c) divisible by 2 and 3
d) divisible by 3 and 2
18 The sum of minimum and maximum number of final states for a DFA n states is a
equal to:
a) n+1
b) n
c) n-1
d) n+2
19 Which of the following options is correct? a
Statement 1: Initial State of NFA is Initial State of DFA.
Statement 2: The final state of DFA will be every combination of final state of
NFA.
a) Statement 1 is true and Statement 2 is true
b) Statement 1 is true and Statement 2 is false
c) Statement 1 can be true and Statement 2 is true
d) Statement 1 is false and Statement 2 is also false
20 Under which of the following operation, NFA is not closed? d
a) Negation
b) Kleene
c) Concatenation
d) None of the mentione
21 Which of the following is an application of Finite Automaton? d
a) Compiler Design
b) Grammar Parsers
c) Text Search
d) All of the mentioned
22 Which of the following is an application of Finite Automaton? d
a) Compiler Design
b) Grammar Parsers
c) Text Search
d) All of the mentioned
23 According to the given transitions, which among the following are the epsilon d
closures of q1 for the given NFA?
Δ (q1, ε) = {q2, q3, q4}
Δ (q4, 1) =q1
Δ (q1, ε) =q1
a) q4
b) q2
c) q1
d) q1, q2, q3, q4
24 ε- closure of q1 in the given transition graph: c
a) {q1}
b) {q0, q2}
c) {q1, q2}
d) {q0, q1, q2}
25 ε- closure of q1 in the given transition graph: c
a) {q1}
b) {q0, q2}
c) {q1, q2}
d) {q0, q1, q2}
26 Which of the following belongs to the epsilon closure set of a? b

a) {f1, f2, f3}


b) {a, f1, f2, f3}
c) {f1, f2}
d) none of the mentioned
27 L is a regular Language if and only If the set of __________ classes of IL is a
finite.
a) Equivalence
b) Reflexive
c) Myhill
d) Nerode
28 A language can be generated from simple primitive language in a simple way if b
and only if
a) It is recognized by a device of infinite states
b) It takes no auxiliary memory
c) Both are correct
d) Both are wrong
29 Which of the following does not represents the given language? d
Language: {0,01}
a) 0+01
b) {0} U {01}
c) {0} U {0}{1}
d) {0} ^ {01}
30 The given NFA corresponds to which of the following Regular expressions? a

a) (0+1) *(00+11) (0+1) *


b) (0+1) *(00+11) *(0+1) *
c) (0+1) *(00+11) (0+1)
d) (0+1) (00+11) (0+1) *

31 Concatenation Operation refers to which of the following set operations: b


a) Union
b) Dot
c) Kleene
d) Two of the options are correct
32 RR* can be expressed in which of the forms: a
a) R+
b) R-
c) R+ U R-
d) R
33 Which of the following is same as the given DFA? a

a) (0+1)*001(0+1)*
b) 1*001(0+1)*
c) (01)*(0+0+1)(01)*
d) None of the mentioned
34 The total number of states required to automate the given regular expression c
(00)*(11)*
a) 3
b) 4
c) 5
d) 6
35 Which of the given regular expressions correspond to the automata shown? c

a) (110+1)*0
b) (11+110)*1
c) (110+11)*0
d) (1+110)*1
36 The minimum number of transitions to pass to reach the final state as per the a
following regular expression is:
{a,b}*{baaa}
a) 4
b) 5
c) 6
d) 3
37 Which kind of proof is used to prove the regularity of a language? a
a) Proof by contradiction
b) Direct proof
c) Proof by induction
d) None of the mentioned
38 Which of the following is not an application of Pumping Lemma? d
a) {0i1i|i>=0}
b) {0ix|i>=0, x∈{0, 1}* and |x|<=i}
c) {0n| n is prime}
d) None of the mentioned
39 Which of the following can refer a language to be non regular? c
a) Pumping Lemma
b) MyphillNerode
c) Both (a) and (b)
d) None of the mentioned
40 The entity which generate Language is termed as: c
a) Automata
b) Tokens
c) Grammar
d) Data
41 The Grammar can be defined as: G=(V, ∑, p, S) b
In the given definition, what does S represents?
a) Accepting State
b) Starting Variable
c) Sensitive Grammar
d) None of these
42 A push down automaton employs ________ data structure. d
a) Queue
b) Linked List
c) Hash Table
d) Stack
43 Which of the following allows stacked values to be sub-stacks rather than just c
finite symbols?
a) Push Down Automaton
b) Turing Machine
c) Nested Stack Automaton
d) None of the mentioned
44 Push down automata accepts _________ languages. b
a) Type 3
b) Type 2
c) Type 1
d) Type 0
45 The production of the form A->B , where A and B are non terminals is called b
a) Null production
b) Unit production
c) Greibach Normal Form
d) Chomsky Normal Form
46 Halting states are of two types. They are: a
a) Accept and Reject
b) Reject and Allow
c) Start and Reject
d) None of the mentioned
47 A pushdown automata can be defined as: (Q, ∑, G, q0, z0, A, d) d
What does the symbol z0 represents?
a) an element of G
b) initial stack symbol
c) top stack alphabet
d) all of the mention
48 Let ∑={0,1}* and the grammar G be: d
S->ε
S->SS
S->0S1|1S0
State which of the following is true for the given
a) Language of all and only Balanced strings
b) It contains equal number of 0’s and 1’s
c) Ambiguous Grammar
d) All of the mentioned
49 Suppose A->xBz and B->y, then the simplified grammar would be: a
a) A->xyz
b) A->xBz|xyz
c) A->xBz|B|y
d) none of the mentioned
50 Given Grammar: S->A, A->aA, A->e, B->bA d
Which among the following productions are Useless productions?
a) S->A
b) A->aA
c) A->e
d) B->bA
51 Given grammar G: c
S->aS|A|C
A->a
B->aa
C->aCb
Find the set of variables thet can produce strings only with the set of terminals.
a) {C}
b) {A,B}
c) {A,B,S}
d) None of the mentioned
52 Inorder to simplify a context free grammar, we can skip the following operation: d
a) Removal of null production
b) Removal of useless symbols
c) Removal of unit productions
d) None of the mentioned
53 The variable which produces an epsilon is called: b
a) empty variable
b) nullable
c) terminal
d) all of the mentioned
54 Statement: b
For A->e ,A can be erased. So whenever it appears on the left side of a
production, replace with another production without the A.
State true or false:
a) true
b) false
55 Simplify the given grammar: a
S->aXb
X->aXb | e
a) S->aXb | ab, X->aXb | ab
b) S->X | ab, X->aXb | ab
c) S->aXb | ab, X-> S | ab
d) None of the mentioned
56 A turing machine that is able to simulate other turing machines: b
a) Nested Turing machines
b) Universal Turing machine
c) Counter machine
d) None of the mentioned
57 Which of the following are the models equivalent to Turing machine? d
a) Multi tape turing machine
b) Multi track turing machine
c) Register machine
d) All of the mentioned
58 Which of the following regular expression resembles the given diagram? b
a) {a}*{b}*{a,b}
b) {a,b}*{aba}
c) {a,b}*{bab}
d) {a,b}*{a}*{b}*
59 Which of the following can accept even palindrome over {a,b} c
a) Push down Automata
b) Turing machine
c) NDFA
d) All of the mentioned
60 A turing machine with several tapes in known as: a
a) Multi-tape turing machine
b) Poly-tape turingmaching
c) Universal turing machine
d) All of the mentioned
Subject Name- Computer Network A
& N
S
Paper Code- UG-CS-325
1 The structure or format of data is called ___________ a
a) Syntax
b) Semantics
c) Struct
d) Formatting
2 Communication between a computer and a keyboard involves ______________ d
transmission.
a) Automatic
b) Half-duplex
c) Full-duplex
d) Simplex
3 The first Network was called ________ d
a) CNNET
b) NSFNET
c) ASAPNET
d) ARPANET
4 A _______ is the physical path over which a message travels. b
a) Path
b) Medium
c) Protocol
d) Route
5 Which organization has authority over interstate and international commerce in c
the communications field?
a) ITU-T
b) IEEE
c) FCC
d) ISOC
6 Three or more devices share a link in ________ connection. b
a) Unipoint
b) Multipoint
c) Point to point
d) Simplex
7 Which of this is not a constituent of residential telephone line? c
a) A high-speed downstream channel
b) A medium-speed downstream channel
c) A low-speed downstream channel
d) An ultra-high speed downstream channel
8 DSL telcos provide which of the following services? c
a) Wired phone access
b) ISP
c) Wired phone access and ISP
d) Network routing and ISP
9 HFC contains _______ c
a) Fibre cable
b) Coaxial cable
c) A combination of Fibre cable and Coaxial cable
d) Twisted Pair Cable
10 StarBand provides __________ d
a) FTTH internet access
b) Cable access
c) Telephone access
d) Satellite access
11 The physical layer is concerned with ___________ a
a) bit-by-bit delivery
p) process to process delivery
c) application to application delivery
d) port to port delivery
12 The physical layer is concerned with ___________ c
a) bit-by-bit delivery
p) process to process delivery
c) application to application delivery
d) port to port delivery
13 Bits can be sent over guided and unguided media as analog signal by a
___________
a) digital modulation
b) amplitude modulation
c) frequency modulation
d) phase modulation
14 The portion of physical layer that interfaces with the media access control a
sublayer is called ___________
a) physical signalling sublayer
b) physical data sublayer
c) physical address sublayer
d) physical transport sublayer
15 The physical layer provides __________ d
a) mechanical specifications of electrical connectors and cables
b) electrical specification of transmission line signal level
c) specification for IR over optical fiber
d) all of the mentioned
16 In asynchronous serial communication the physical layer provides ___________ c
a) start and stop signalling
b) flow control
c) both start & stop signalling and flow control
d) only start signalling
17 The physical layer is responsible for __________ d
a) line coding
b) channel coding
c) modulation
d) all of the mentioned
18 The physical layer translates logical communication requests from the ______ a
into hardware specific operations.
a) data link layer
b) network layer
c) trasnport layer
d) application layer
19 A single channel is shared by multiple signals by ____________ c
a) analog modulation
b) digital modulation
c) multiplexing
d) phase modulation
20 Wireless transmission of signals can be done via ___________ d
a) radio waves
b) microwaves
c) infrared
d) all of the mentioned
21 The data link layer takes the packets from _________ and encapsulates them into a
frames for transmission.
a) network layer
b) physical layer
c) transport layer
d) application layer
22 Which of the following tasks is not done by data link layer? d
a) framing
b) error control
c) flow control
d) channel coding
23 Which sublayer of the data link layer performs data link functions that depend b
upon the type of medium?
a) logical link control sublayer
b) media access control sublayer
c) network interface control sublayer
d) error control sublayer
24 Header of a frame generally contains ______________ d
a) synchronization bytes
b) addresses
c) frame identifier
d) all of the mentioned
25 Automatic repeat request error management mechanism is provided by ________ a
a) logical link control sublayer
b) media access control sublayer
c) network interface control sublayer
d) application access control sublayer
26 When 2 or more bits in a data unit has been changed during the transmission, the b
error is called ____________
a) random error
b) burst error
c) inverted error
d) double error
27 CRC stands for __________ a
a) cyclic redundancy check
b) code repeat check
c) code redundancy check
d) cyclic repeat check
28 Which of the following is a data link protocol? d
a) ethernet
b) point to point protocol
c) hdlc
d) all of the mentioned
29 The technique of temporarily delaying outgoing acknowledgements so that they a
can be hooked onto the next outgoing data frame is called ____________
a) piggybacking
b) cyclic redundancy check
c) fletcher’s checksum
d) parity check
30 The network layer is concerned with __________ of data. c
a) bits
b) frames
c) packets
d) bytes
31 Which one of the following is not a function of network layer? d
a) routing
b) inter-networking
c) congestion control
d) error control
32 A 4 byte IP address consists of __________ c
a) only network address
b) only host address
c) network address & host address
d) network address & MAC address
33 In virtual circuit network each packet contains ___________ b
a) full source and destination address
b) a short VC number
c) only source address
d) only destination address
34 Which of the following routing algorithms can be used for network layer design? d
a) shortest path algorithm
b) distance vector routing
c) link state routing
d) all of the mentioned
35 Which of the following is not correct in relation to multi-destination routing? c
a) is same as broadcast routing
b) contains the list of all destinations
c) data is not sent by packets
d) there are multiple receivers
36 A subset of a network that includes all the routers but contains no loops is called a
________
a) spanning tree
b) spider structure
c) spider tree
d) special tree
37 Which one of the following algorithm is not used for congestion control? d
a) traffic aware routing
b) admission control
c) load shedding
d) routing information protocol
38 ICMP is primarily used for __________ a
a) error and diagnostic functions
b) addressing
c) forwarding
d) routing
39 Transport layer aggregates data from different applications into a single stream a
before passing it to ____________
a) network layer
b) data link layer
c) application layer
d) physical layer
40 Which of the following are transport layer protocols used in networking? c
a) TCP and FTP
b) UDP and HTTP
c) TCP and UDP
d) HTTP and FTP
41 User datagram protocol is called connectionless because _____________ a
a) all UDP packets are treated independently by transport layer
b) it sends data as a stream of related packets
c) it is received in the same order as sent order
d) it sends data very quickly
42 Physical or logical arrangement of network is __________ a
a) Topology
b) Routing
c) Networking
d) Control
43 Which network topology requires a central controller or hub? a
a) Star
b) Mesh
c) Ring
d) Bus
44 . _______ topology requires a multipoint connection. d
a) Star
b) Mesh
c) Ring
d) Bus
45 Data communication system spanning states, countries, or the whole world is b
________
a) LAN
b) WAN
c) MAN
d) PAN
46 WAN stands for __________ b
a) World area network
b) Wide area network
c) Web area network
d) Web access network
47 In TDM, slots are further divided into __________ b
a) Seconds
b) Frames
c) Packets
d) Bits
48 The attacker using a network of compromised devices is known as b
_____________
a) Internet
b) Botnet
c) Telnet
d) D-net
49 Which of the following is a form of DoS attack? d
a) Vulnerability attack
b) Bandwidth flooding
c) Connection flooding
d) All of the mentioned
50 The DoS attack, in which the attacker establishes a large number of half-open or c
fully open TCP connections at the target host is ________
a) Vulnerability attack
b) Bandwidth flooding
c) Connection flooding
d) UDP flooding
51 Packet sniffers involve ____________ b
a) Active receiver
b) Passive receiver
c) Legal receiver
d) Partially-active receiver
52 Firewalls are often configured to block ___________ a
a) UDP traffic
b) TCP traffic
c) Sensitive traffic
d) Best-effort traffic
53 Which is not a application layer protocol? d
a) HTTP
b) SMTP
c) FTP
d) TCP
54 The packet of information at the application layer is called __________ b
a) Packet
b) Message
c) Segment
d) Frame
55 Which one of the following is an architecture paradigms? d
a) Peer to peer
b) Client-server
c) HTTP
d) Both Peer-to-Peer & Client-Server
56 Application developer has permission to decide the following on transport layer c
side
a) Transport layer protocol
b) Maximum buffer size
c) Both Transport layer protocol and Maximum buffer size
d) None of the mentioned
57 E-mail is _________ c
a) Loss-tolerant application
b) Bandwidth-sensitive application
c) Elastic application
d) None of the mentioned
58 Pick the odd one out. d
a) File transfer
b) File download
c) E-mail
d) Interactive games
59 Which of the following is an application layer service? d
a) Network virtual terminal
b) File transfer, access, and management
c) Mail service
d) All of the mentioned
60 Which is a time-sensitive service? d
a) File transfer
b) File download
c) E-mail
d) Internet telephony
Subject Name- Java programming- II A
& N
Paper Code- UG-CS-326 B S
1 A top level window inside another window is called _____ b
a. panel
b. Frame
c. window
d. All of these
2 The JFrame class has following methods d
a. dispose()
b. setIconImage()
c. setTitle()
d. All of these
3 ______ method is used to set the text in the title bar for the frame. a
a. setTitle()
b. setText()
c. drawText()
d. None of these
4 The _______ method of Graphics2D class is used to select a color for drawing. c
a. steColor()
b. setPaint()
c. setpaint()
d. setcolor()
5 Which package is used for drawing graphical 2D shape in java? a
a. java.awt.geom
b. java.geom
c. java.awt.Geom
d. All of these
6 Which class is used to read a graphics file into an application? a
a. Toolkit class
b. TOOLKIT class
c. Image class
d. None of these
7 The drawstring() method has____ parameters c
a. 1
b. 2
c. 3
d. 5
8 Which method is used to display frames. c
a. show()
b. setVisible()
c. both (a) and (b)
d. None of these
9 Which package is used for JFrame,JPanel class? b
a. Java.swing
b. javax.swing
c. java.awt
d. javax.Swing
10 In java which are Graphics2D classes used for drawing graphics shapes d
a. Rectangle2D
b. Point2D
c. Line2D
d. All of these
11 Which of yhe following methods can be used to change the size of component b
a. Dimension()
b.setSize()
c. size()
d. resize()
12 The method draw() and fill() are defined in b
a. Java.lang.geom
b. java.awt.geom
c. java.geom
d. java.util.geom
13 To select a font for the graphics context use _____ method. b
a. getFont()
b. SetFont()
c. setFont()
d. receiveFont()
14 To reposition a component use a
a. setLocation() method
b. setSize() method
c. setResizable() method
d. All of these
15 To fill the interiors of closed shapes with a color use_____ method. a
a. fill()
b. setFill()
c. setPaint()
d. draw()
16 Which of these packages contain all of the classes and methods required for event c
handling in java?
a. java.applet
b. java.awt
c. java.event
d. java.awt.event
17 Which of these methods are used to register a keyboard event listener? c
a. KeyListener
b. addkistener
c. addKeyListener
d. eventKeyboardListener
18 Which of these method is used to register a mouse motion listener? b
a. addMouse()
b. addMouseListener()
c. addMouseMotionListener()
d. eventMouseMotionListener()
19 Event class is defined in which of these libraries? d
a. java.io
b. java.lang
c. java.net
d. java.util
20 Which of these methods can be used to determine the type of event? a
a. getID()
b. getSource()
c. getEvent()
d. getEventObject()
21 Which of these class is super class of all the events? a
a. EventObject
b. EventClass
c. ActionEvent
d. ItemEvent
22 Which of these event will be notified if scroll bar is manipulated? c
a. ActionEvent
b. ComponentEvent
c. AdjustmentEvent
d. WindowEvent
23 Which of these event will be generated if we close an applet’s window? d
a. ActionEvent
b. ComponentEvent
c. AdjustmentEvent
d. WindowEvent
24 Which of the following component generate action events? a
a. Buttons
b. Labels
c. Check boxes
d. Windows
25 Which of the following is not true? b
a. A TextField object may generate an ActionEvent.
b. A TextArea object may generate an ActionEvent.
c. A Button object may generate an ActionEvent.
d. A MenuItem object may generate an ActionEvent.
26 Which of the following are passed as an argument to the paint() method? b
a. A Canvas object
b. A Graphics object
c. An Image object
d. A paint object
27 Which method will cause a Frame to be displayed? b
a. show()
b. setVisible()
c. display()
d. displayFrame()
28 AppletViewer tool is a available in which of the folder of JDK : b
a. bin
b. lib
c. source
d. class
29 The Applet class is in _____ package. a
a. java.applet
b. java.awt
c. java.io
d. java.util
30 To run an applet _____ command is used. c
a. run
b. java
c. appletviewer
d. applet
31 To display text on the applet _____ method is used. b
a. showString()
b. drawstring()
c. printIn()
d. printString()
32 Which method is called first by an applet? c
a. start()
b. run()
c. init()
d. paint()
33 Which of the following is an optional attribute of applet tag? b
a. Code
b. Name
c. Width
d. Height
34 To display text in an applet status bar_____ method is used. a
a. showStatus()
b. showStatusBar()
c. drawStatus()
d. drawStatusBar()
35 Which method can be used to draw a circle in the applet? d
a. drawCircle()
b. drawOval()
c. drawArc()
d. both b and c
36 Which method can be used to draw a rectangle in the Applet? d
a. drawRect()
b. drawPolygon()
c. drawLine()
d. All of these
37 Which class is used to get dimensions of an applet? a
a. Dimension
b. metrics
c. Applet
d. fontMetrics
38 The syntax of paint() method is_____ c
a. public void paint()
b. public void paint(String s)
c. public void paint(Graphics g)
d. public void paint(Graphics g,String s)
39 The syntax of drawstring() method is_____ b
a. void drawstring(String s)
b. void drawstring(String s,intx,int y)
c. void drawstring(intx,inty,string s)
d. void drawstring(String x,int x)
40 How many JDBC driver types does Sun define? d
a. one
b. two
c. three
d. four
41 Which JDBC driver types can be used in either applet or servlet code? c
a. Both Type 1 and Type 2
b. Both Type 1 and Type 3
c. Both Type 3 and Type 4
d. Both Type 4 only
42 What programming language (s) or scripting language (s) does Java Server c
Page(JSP) support?
a. VBScript
b. Jscript
c. Java only
d. All of these above are supported
43 Which JDBC driver tupe is the JDBC-ODBC bridge? a
a. Type 1
b. Type 2
c. Type 3
d. Type 4
44 Which JDBC driver types are use for over communication networks? c
a. Type 3 only
b. Type 4 only
c. Both Type 3 and Type 4
d. Neither Type 3 nor Type 4
45 JDBC stands for: a
a. Java Database Connectivity
b. Java Database Components
c. Java Database Control
d. None of the above is correct
46 In the following JDBC drivers which is known as partially java driver? b
a. JDBC-ODBC bridge driver
b. Native-API driver
c. Network Protocol driver
d. Thin driver
47 In the following JDBC drivers which are known as fully java driver? d
a. Native-API driver
b. Network Protocol driver
c. Thin driver
d. Both B & C
48 The java______ specification defines an application programming interface for a
communication between the Web server and the application program.
a. Servlet
b. Server
c. Program
d. Randomize
49 JavaBeans is a technology that allows one to build complex system from reusable b
software component called
a. JavaBeans
b. Bean
c. Bin
d. Jdk
50 A bean has all benefits java’s________paradigm. a
a. Write-once,run-anywhere
b. Write-thice,run- anywhere
c. Write-once,run-time
d. Write-once,run-anytime
51 What is listener in context to event handling? b
a. a listener is a variable that is notified when an event occurs.
b. A listener is a object that is notified when an event occur.
c. A listener is a method that is notified when an event occurs.
d. None of the mentioned.
52 When two or more objects are added as listener for the same event,which c
a. Listener is first invoked to handle the event?
b. The first object that was added as listener.
c. The last object that was added as listener.
d. There is no way to determine which listener will be invoked first
53 How do you change the current layout manager for a container? a
a. Use the setLayout method
b. Once created you can not change the current layout manager of an component.
c. Use the setLayoutManager method.
d. Use the updateLayout method.
54 CORBA is stands for: c
a. Common oriented request broker architecture
b. Common object request break architecture
c. Common object request broker architecture
d. Common object request broker access
55 Which is the following is true for CORBA? d
a. Protocol for distributed computing
b. Specification for distributed objects
c. Components can be language neural
d. Both (b) and (c) above
56 A JSP page consist of which tags? c
a. HTML tags
b. JSP tags
c. Both a & b
d. None of the above
57 How many JDBC driver types does sun define? c
a. one
b. three
c. four
d. two
58 The life cycle of a servlet is managed by c
a. The supporting protocol
b. servlet context
c. servlet container
d. servlet
59 ________ is the first phase of the servlet life cycle. a
a. initialization
b. Service
c. Destruction
d. Both a and b
60 MVC stands for_______ c
a. Mobile View Control
b. Model Vast control
c. Model View Controller
d. None of the above

You might also like