0% found this document useful (0 votes)
29 views

Computer Sciece Mock Exit Exam

cs exam

Uploaded by

Mike Gudeta
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Computer Sciece Mock Exit Exam

cs exam

Uploaded by

Mike Gudeta
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Which of the following is NOT a common cause of software vulnerabilities?

A. Lack of secure coding practices


B. Insufficient security testing
Intentional backdoors by developers
C.
D. Proper configuration of security controls
ANSWER: D
Which of the following is a technique for ensuring inference control in databases?
A. Role-based access control (RBAC)
B. Data masking
C. Database auditing
D. Data aggregationANSWER: A
In the evaluation process, what does the term "orange book" refer to?
A. A comprehensive guide for system administrators
B. A rating system for evaluating system security
C. A collection of case studies on security breaches
D. A standard reference manual for software developers
ANSWER: B
Which security principle is violated when a program allows a user with limited privileges
to access sensitive data or perform unauthorized actions?
A. Confidentiality
B. Integrity
C. Availability
D. Authentication
ANSWER: A
What does XSS stand for in the context of software security?
A. Extended Server Security
B. Cross-Site Scripting
C. Extra Security Software
D. External System Shutdown
ANSWER: B
Which cryptographic technique is used to ensure the integrity and authenticity of a message?
A. Encryption
B. Hashing
C. Steganography
D. Digital Signature
ANSWER: D
You are evaluating two different design approaches for a new software feature. Which criteria should
be prioritized when making a decision?
A. The design with the most visually appealing user interface.
B. The design that is easiest for the development team to implement quickly.
C. The design that meets the functional requirements, is maintainable, and performs well.
D. The design that uses the latest programming language and libraries
ANSWER: C
What is the benefit of using a version control system in software development?
A. Automates the software testing process
B. Generates user documentation automatically
C. Allows for tracking changes made to the code over time, facilitating collaboration.
D. Improves the performance of the compiled code
ANSWER: C
What does the term "API" (Application Programming Interface) stand for in software development?
A.A graphical user interface for interacting with the software
B. The programming language used to develop the software
C. The underlying hardware components of the system
D.A set of defined methods and protocols for interacting with a software component
ANSWER: D
Which of the following is the primary purpose of a UML (Unified Modeling Language) diagram?
A. Define the user interface layout
B. Visually represent the structure and interactions of a software system.
C. Write the code for the software functionalities
D. Test and debug the software
ANSWER: B
What does the term "unit testing" refer to in software development?
A. Testing the functionality of the entire software system
B. Verifying the correctness of individual software modules (units)
C. Testing the user interface for usability and accessibility
D. Checking for compatibility with different operating systems
ANSWER: B
During the design phase of a mobile application, you identify a potential conflict between two user
stories. How should you approach this situation?
A. Ignore the conflict and prioritize the more complex user story.
B. Analyse the conflict, discuss with stakeholders, and find a compromise solution.
C. Completely redesign the application to avoid any user story conflicts.
D. Implement both user stories without considering the potential impact on each other
ANSWER: B
You are creating a database schema for a hotel management system. Which of the following would be
an example of a one-to-many relationship?
A. One room belongs to many hotel guests
B. One hotel guest can book many rooms
C. One hotel guest can have many hotel reservations
D. One hotel room can have many hotel reservations
ANSWER: D
A company wants to improve the performance of their database by optimizing queries and indexes.
Which of the following database concepts should be applied in this scenario?
A. Normalization
B. Data warehousing
C. Query optimization
D. Big data analytics
ANSWER: C
Which of the following is an advantage of a relational database over a flat file database?
A. Relational databases are easier to maintain
B. Flat file databases have better performance
C. Relational databases are less complex
D. Flat file databases are more scalable
ANSWER: A
The clause in SQL that specifies that the query result should be sorted in ascending or descending
order based on the values of one or more columns is?
A. View
B. Order by
C. Group by
D. Having
ANSWER: B
Using Relational Algebra the query that finds customers, who have a balance of over 1000 is?
A. σ Customer_name( Π balance >1000(Deposit))
B. Π Customer_name( σ balance >1000(Borrow))
C. Π Customer_name( σ balance >1000(Deposit))
D. σ Customer_name( Π balance >1000(Borrow))
ANSWER: C
in an E-R, Y is the dominant entity and X is a subordinate entity. Then which of the following is
incorrect :
A. Operationally, if Y is deleted, so is X
B. Existence is dependent on Y.
C. Operationally, if X is deleted, so is Y.
D. Operationally, if X is deleted, & remains the same
ANSWER: C
The statement that is executed automatically by the system as a side effect of the modification of the
database is?
A. Backup
B. Assertion
C. Recovery
D. Trigger
ANSWER: D
In SQL the statement select * from R, S is equivalent to?
A. Select * from R natural join S.
B. Select * from R cross join S.
C. Select * from R union join S.
D. Select * from R inner join S.
ANSWER: B
The keyword to eliminate duplicate rows from the query result in SQL is?
A. DISTINCT
B. NO DUPLICATE
C. UNIQUE
D. DELETE
ANSWER: A
Precedence graphs help to find a?
A. Recoverable schedule
B. Deadlock free schedule.
C. Serializable schedule.
D. Cascadeless schedule
ANSWER: C
Checkpoints are a part of?
A. Recovery measures.
B. Security measures.
C. Concurrency measures.
D. Authorization measures.
ANSWER: A
A company wants to analyze their sales data to identify which products sell well together. Which SQL
join would be used to accomplish this task?
A. Inner join
B. Outer join
C. Left join
D. Right join
ANSWER: A
What should be the output of the code below

A.5
B.4
C.7
D.6
ANSWER: D

Which loop structure is suitable when the number of iterations is known in advance?
A.do-while loop
B. while loop
C. for loop
D. switch statement
ANSWER: C
What is the purpose of a function prototype in C++?
A. To define the body of a function
B. To declare the existence of a function
C. To specify the return type of a function
D. To provide the input parameters for a function
ANSWER: B
What is the output of the following code snippet?

A.10
B.20
C. Compiler error
D. Runtime error
ANSWER: B
One of the following is NOT true?
A. when the result of condition is true in if else, the body of the else statement is never executed
B. when result of condition is false, the body of the if statement is executed
C. case keyword is used to identify possible entry points of switch statement
D. In do while, its body is executed first and then the loop condition is examined
ANSWER: B
How many times will the following loop execute?

A. 3
B. 5
C. 4
D. 6
ANSWER: C
Which of the following best describes the difference between a static method and an instance method
in Java?
A. Instance methods can be accessed without creating an instance of the class, whereas static methods
are accessed through an object of the class
B. Static methods are called by other methods, whereas instance methods are called by the main()
method
C. Instance methods are used for performing calculations, whereas static methods are used for
input/output operations
D. Static methods can be accessed without creating an instance of the class, whereas instance methods
are accessed through an object of the class
ANSWER: D
Which feature of OOP is indicated by the following code?

A. Encapsulation and Inheritance


B. Inheritance and polymorphism
C. Polymorphism
D. Inheritance
ANSWER: D
Which of the following handles exception in Java when a catch is not used?
A. finally
B. throw handler
C. default handler
D. Java run time system
ANSWER: D
What will be output of the following Java program?

A.0
B.1
C. Compilation Error
D. Runtime Error
ANSWER: B
In which access should a constructor be defined, so that object of the class can be created in any
function?
A. Any access specifier will work
B. Private
C. Public
D. Protected
ANSWER: C
Runtime polymorphism feature in java is
A. Method overriding
B. Method overloading
C. Operator overloading
D. Constructor overloading
ANSWER: A
In a frame-based knowledge representation system, what does the term "attribute" refer to?
A.A characteristic of a frame that defines its relationship to other frames.
B.A property of a frame that describes its properties or characteristics.
C. The frame's location in a hierarchical structure.
D. The rule that relates a frame to other frames.
ANSWER: B
Which of the following situations incorporates the application of reinforcement learning?
A. Educating a chatbot to interpret and interact with user inquiries.
B. Examining customer data to recognize market segments.
C. Instructing a robot to traverse a maze and determine the most efficient route.
D. Grouping news articles according to their content characteristics.
ANSWER: C
Which learning approach is commonly used when the target variable is numerical?
A. Classification
B. Regression
C. Clustering
D. Reinforcement Learning
ANSWER: B
In AI, if agent knows exactly about the state, the problem type is?
A. Single-state problem
B. Conformant problem
C. Exploration problem
D. Contingency problem
ANSWER: A
Which of the following exemplifies Association Mining?
A. Predicting stock prices.
B. Categorizing emails as spam or non-spam.
C. Recommending products to customers using their purchase history.
D. Analysing the sentiment expressed in customer reviews.
ANSWER: C
Which of the following is an advantage of using informed search strategies in search problems and
games?
A. They guarantee finding the optimal solution.
B. They are always faster than uninformed search strategies.
C. They can use domain-specific knowledge to guide the search.
D. They are less complex than uninformed search strategies.
ANSWER: C
What is the primary purpose of HyperText Markup Language (HTML) in web development?
A. To add interactivity to web pages
B. To define the structure and content of web pages
C. To handle communication between server and client
D. To create animations and graphics
ANSWER: B
When encountering a JavaScript error message, the first step in debugging should be:
A. Ignoring the error and hoping it goes away
B. Re-writing the entire code from scratch
C. Reading the error message carefully and identifying the line causing the issue
D. Searching online for generic solutions without understanding the context
ANSWER: C
A client wants a website showcasing their photography portfolio. They have hundreds of high-
resolution images. How would you optimize the website's content management and user experience
for these images?
A. Display all images in full resolution on a single page, potentially causing slow loading
times.
B. Use a single, large image file containing all photos.
C. Implement a database to manage image information and utilize thumbnails for browsing
with options to view full-size versions on demand.
D. Upload all images directly into HTML code.
ANSWER: C
You are tasked with creating a website for a news organization with daily content updates. How
would you ensure efficient content management and user experience for readers?
A. Create static HTML pages for each news article, requiring manual updates for new content.
B. Develop a content management system (CMS) allowing for easy content creation, editing, and
organization for a dynamic website.
C. Rely on users to submit news articles directly through HTML forms, leading to potential quality
and security issues.
D. Use a single, long webpage with all news articles listed chronologically, making navigation
challenging for older content.
ANSWER: B
When designing a client-server system with multiple clients accessing the server concurrently, what
concurrency control mechanism would be most effective in preventing data inconsistencies?
A.No concurrency control
B.Hyperlinks: Used for linking web pages
C.Cookies: Used for client-side state management.
D.Semaphores: Signaling mechanism for controlling access to shared resources, a viable
option.
ANSWER: D
When designing the communication protocol for a client-server system, which element is MOST
crucial for ensuring data integrity and security?
A. Using clear and concise language in the protocol specifications.
B. Defining the format and structure of data messages.
C. Implementing data encryption and authentication mechanisms to protect sensitive
information.
D. Specifying error codes for various communication failures.
ANSWER: C
You're designing a website for a local museum with a vast collection of artifacts. Users should be able
to search for specific artifacts based on criteria like category, date, or artist. Which approach would be
most effective in managing this content for efficient searching and display?
A. Create individual web pages for each artifact, making searching cumbersome.
B. Store all artifact information in a single, long webpage, leading to poor user experience.
C. Develop a database to store artifact information and use server-side scripting to
dynamically generate search results and detailed pages for each artifact.
D. Rely solely on client-side search functionality within the browser for efficiency
ANSWER: C
A user submits a form on your website. Which combination of technologies best represents how the
form data would be processed for server-side validation and storage?
A.Client-side validation with JavaScript and server-side processing using HTML forms.
B.Only client-side validation with JavaScript for a more responsive experience.
C.Only server-side validation to avoid user manipulation of data.
D.Client-side validation with JavaScript, but storing data directly in the browser for security
reasons.
ANSWER: A
A user clicks a button on your webpage. How can you use client-side scripting (JavaScript) to
enhance the user experience without requiring a full page reload?
A.The button should submit a form to the server for processing.
B.Use JavaScript to handle the button click event and perform actions like displaying
animations or updating content dynamically on the page.
C.Re-render the entire page using JavaScript to simulate interactivity.
D.Client-side scripting cannot handle button clicks without server interaction.
ANSWER: B
Which of the following data structures can be used to reverse the order of set of data items?
A.Queue
B.Stack
C.Linked list
D.Heap
ANSWER: B
Which of the following operations is performed more efficiently by doubly linked list than by singly
linked list?
A. Deleting a node whose location in given
B. Searching of an unsorted list for a given item
C. Inverting a node after the node with given location
D. Traversing a list to process each node
ANSWER: A
For the linked list implementation of the queue, where are the enqueue and dequeues performed?
A. Enqueue in front of the first element, dequeue the first element
B. Enqueue after the last element, dequeue the last element
C. Enqueue after the last element, dequeue the first element
D. Enqueue after the first element, dequeue the last element
ANSWER: C
The disadvantage in using a circular linked list is?
A.It is possible to get into infinite loop
B.Last node points to first node.
C.Time consuming
D.Requires more memory space
ANSWER: C
In algorithm analysis, what does asymptotic complexity refer to?
A. The complexity in the best case
B. The complexity in the worst case
C. The complexity in the average case
D. The behavior of an algorithm as the input size grows
ANSWER: C
Which data structure is most efficient for implementing a priority queue?
A.Binary search tree
B.Hash table
C.Binary heap
D.Linked list
ANSWER: C
A structure definition is a user-defined variable type which is a grouping of one or
more variables. Which one of the following is not correct about structure?
A.Once the type has been defined through the C++ ‘struct’ keyword, you can create variables from it
just like you would any other type.
B.After creating a structure variable you must create a structure definition.
C.The structure definition is a listing of all member variables with their types and names.
D.Defining a structure is giving the compiler a blueprint for creating your type.
ANSWER: B
In a min-heap, the minimum element can be found in
A.O(n)
B.O(log n)
C.O(n log n)
D.O(1)
ANSWER: D
Which algorithm is used to find all pairs shortest paths in a graph?
A.Dijkstra's Algorithm
B.Bellman-Ford Algorithm
C.Floyd-Warshall Algorithm
D.Kruskal's Algorithm
ANSWER: C
Which of the following is NOT an advantage of using backtracking algorithms?
A.To solve problem in which a sequence of object is chosen from a specified set
B.They always find the optimal solution
C.They can be easily implemented using recursion
D.They can solve constraint satisfaction problems
ANSWER: B
The recurrence relation for the Merge Sort algorithm is:
A.T(n) = 2T(n/2) + O(n)
B.T(n) = T(n/2) + O(n)
C.T(n) = 2T(n/2) + O(1)
D.T(n) = T(n-1) + O(n)
ANSWER: A
Which of the following is not a characteristic of a greedy algorithm?
A.It makes a locally optimal choice at each step
B.It guarantees a globally optimal solution for all problems
C.It is used in problems like the minimum spanning tree
D.It is generally easier to implement than dynamic programming
ANSWER: A
What is the time complexity of searching for an element in a hash table with n elements and m slots,
assuming no collisions?
A.O(n)
B.O(m)
C.O(1)
D.O(n log n)
ANSWER: C
Which of the following is a potential disadvantage of using threads over processes?
A .Increased concurrency
B. Reduced memory usage
C. Improved fault isolation
D. Increased complexity in synchronization
ANSWER: D
Which of the following memory management techniques allows the operating system to load only the
necessary portions of a program into memory at a given time?
A. Demand paging
B. Segmentation
C. Paging
D. Virtual memory
ANSWER: A
Which of the following mutual exclusion solutions is considered the most efficient in terms of
minimizing the number of context switches?
A. Semaphore-based solution
B. Message-passing-based solution
C. Spin-lock-based solution
D. Monitor-based solution
ANSWER: C
When evaluating the suitability of preemptive and non-preemptive scheduling algorithms for real-time
systems, which of the following is the most important consideration?
A. Fairness in resource allocation
B. Responsiveness and ability to meet deadlines
C. Simplicity of implementation
D. Overall system throughput
ANSWER: B
Which of the following is the primary advantage of non-preemptive scheduling algorithms over
preemptive algorithms?
A. Improved real-time performance
B. Reduced task starvation
C. Simpler implementation and reduced overhead
D. Better support for dynamic workloads
ANSWER: C
Which of the following is the most effective way to prevent deadlocks in a computer system?
A. Avoid the Hold and Wait condition
B. Prevent Circular Wait
C. Eliminate the Mutual Exclusion condition
D. Ensure No Preemption
ANSWER: B
What is the role of the instruction decode (ID) stage in pipelining?
A. To execute the instruction
B. To write the result back to the register
C. To fetch the instruction from memory
D. To translate the instruction into signals for the other stages
ANSWER: C
Which one of the following circuits requires memory to store the state of the output?
A. Combinational circuit
B. Sequential circuits
C. Logical circuit
D. Physical circuit
ANSWER: B
How does the CPU's control unit coordinate the execution of instructions?
A. The control unit manages the allocation and translation of virtual memory addresses to physical
memory addresses.
B. The control unit retrieves instructions from memory, interprets them, and then coordinates the
execution of those instructions.
C. The control unit provides connectivity and integration for the computer's components.
D. The control unit manages input/output operations.
ANSWER: B
Which of the following circuit is used to store one bit of data?
A. Decoder
B. Encoder
C. Flip Flop
D. Register
ANSWER: D
What characteristic of RAM memory makes it not suitable for permanent storage?
A. too slow
B. unreliable
C. it is volatile
D. too bulky
ANSWER: C
In computers, subtraction is generally carried out by
A. 9's complement
B. 10's complement
C. 1'scomplement
D. 2's complement
ANSWER: D
What is the language and grammar accepted by pushdown automata?
A. Regular language and type-3 grammar
B. Context-free language and type-2 grammar
C. Context-free language and type-3 grammar
D. Context-sensitive language and type-1 grammar
ANSWER: B
Which one of the following languages over the alphabet {0, 1} is described
by the regular expression: (0+1)*0(0+1)*0(0+1)*?
A. The set of all strings containing the substring 00
B. The set of all strings containing at most two 0’s
C. The set of all strings containing at least two 0’s
D. The set of all strings that begin and end with either 0 and 1
ANSWER: C
Which of the following is the most powerful type of machine?
A.Deterministic finite automata (DFA)
B.Non-deterministic finite automata (NFA)
C.Turing machine
D. Pushdown automata
ANSWER: C
The Kleene star operation "*" in regular expressions represents:
A. Concatenation
B. Union
C. One or more repetitions
D. Zero or more repetitions
ANSWER:D
Regular expression for all strings starts with 01 and ends with 110 is.
A.010*1*110
B. 01(01)*110
C. 01(0+1)*110
D.01110
ANSWER: C
Which complexity class represents decision problems that can be solved by a deterministic Turing
Machine in polynomial time?
A.P
B.NP
C. Co-NP
D.PSPACE
ANSWER: A
Which of the following statements about context-free grammars is true?
A. They are more powerful than regular expressions.
B. They are less powerful than regular expressions.
C. They are equivalent in power to regular expressions.
D. They cannot be used to describe programming languages.
ANSWER: A
Which data structure is typically used to implement a symbol table in a compiler?
A. Linked List
B. Stack
C. Queue
D. Hash Table
ANSWER: D
Which of the following is NOT a role of a lexer in a compiler?
A. Identifying tokens
B. Performing semantic analysis
C. Ignoring whitespace and comments
D. Generating errors for invalid tokens
ANSWER: B
Which of the following memory sections typically holds the executable code of a program?
A. Stack
B. Heap
C. Data segment
D. Code segment
ANSWER: D
Which component of the compiler interacts with all phases of the compilation process and is
responsible for storing information about identifiers, such as variable names and their types?
A. Lexical Analyzer
B. Parser
C. Symbol Table
D. Code Generator
ANSWER: C
Which principle of compiler design ensures that the generated code runs efficiently on the target
platform?
A. Lexical Analysis
B. Syntax Analysis
C. Semantic Analysis
D. Code Optimization
ANSWER: D
Which protocol is used for secure communication over the internet, providing encryption and
authentication?
A.HTTPS
B.FTPS
C.SSH
D.SSL
ANSWER: D
Which wireless technology is commonly used for local area networking and internet access within
buildings?
A. Bluetooth
B. Cellular
C. Wi-Fi
D.NFC (Near Field Communication)
ANSWER: C
What is the purpose of CIDR (Classless Inter-Domain Routing)?
A. To allocate IP addresses based on classes (A, B, C)
B. To simplify the allocation of IP addresses and routing table entries
C. To encrypt data packets for secure transmission
D. To determine the physical location of an IP address
ANSWER: B
In IPv4, what is the subnet mask used for?
A. To identify the network portion of an IP address
B. To identify the host portion of an IP address
C. To encrypt data packets
D. To determine the physical location of an IP address
ANSWER: A
Which layer of the OSI model ensures that data is transferred reliably between two network hosts,
providing features like flow control, error correction, and sequencing?
A. Physical Layer
B. Transport Layer
C. Network Layer
D. Data Link Layer
ANSWER: A
What is the primary function of the ARP (Address Resolution Protocol)?
A. Translates domain names to IP addresses
B. Determines the MAC address of a device based on its IP address
C. Routes packets between different networks
D. Establishes a secure connection between client and server
ANSWER: B
What network service provides centralized authentication and authorization for users and devices?
A.LDAP
B.DHCP
C.DNS
D.SNMP
ANSWER: A
What is the purpose of a shebang line (#!/bin/bash) in a Bash script?
A. It comments out code
B. It specifies the author of the script
C .It identifies the interpreter to use for executing the script
D. It indicates the version of the script
ANSWER: C
Which file is commonly used to configure zones in BIND?
A .named.conf
B .dns.conf
C. zone.conf
D. bind.conf
ANSWER: A
Which of the following is NOT a common component of a security policy?
A. Data encryption
B. User training
C. Hardware maintenance
D. Incident response procedures
ANSWER: C
What is the purpose of the MX record in DNS?
A. It specifies the mail server responsible for receiving email on behalf of a domain
B. It specifies the web server for a domain
C. It specifies the authoritative name server for a domain
D. It specifies the IP address for a domain
ANSWER: A
What is the primary function of Postfix?
A. Serving DNS queries
B. Managing mail transfer
C. Hosting websites
D. Managing databases
ANSWER: B

You might also like