Connect with us

Hi, what are you looking for?

Past Questions and Answers

NABTEB Computer Science Past Questions And Answers (Objective and Theory)

Sponsored Links

NABTEB Computer Science Past Questions And Answers (Objective and Theory)

 

Section A: Multiple Choice Questions

Which of the following is a dynamically-typed programming language?

 

A) Java

B) C++

C) Python

D) C#

Answer: C

What is the purpose of the “finally” block in exception handling?

 

A) Execute code regardless of an exception

B) Handle specific exceptions

C) Ignore exceptions

D) Terminate the program

Answer: A

In computer graphics, what does GPU stand for?

 

A) Graphics Processing Unit

B) General Processing Unit

C) Graphical Performance Unit

D) General Purpose Unit

Answer: A

Which algorithm is commonly used for pathfinding in video games and robotics?

 

A) A* (A-star)

B) BubbleSort

C) QuickSort

D) Depth-First Search (DFS)

Answer: A

What is the purpose of a foreign key in a relational database?

 

A) Ensure data integrity

B) Sort data alphabetically

C) Create primary indexes

D) Encrypt sensitive information

Answer: A

What is the difference between TCP (Transmission Control Protocol) and UDP (User Datagram Protocol)?

 

A) TCP is connection-oriented, while UDP is connectionless

B) UDP is more secure than TCP

C) TCP is faster for real-time applications

D) UDP is used for file transfer

Answer: A

Which design pattern is used to create objects without specifying the exact class of the object that will be created?

 

A) Factory Method

B) Singleton

C) Abstract Factory

D) Builder

Answer: A

What is a binary tree in data structures?

 

A) A tree with only one child per node

B) A tree with two children per node

C) A tree with no children

D) A tree with arbitrary children

Answer: B

What is the purpose of AJAX (Asynchronous JavaScript and XML) in web development?

 

A) Asynchronous loading of web pages

B) Animation effects in CSS

C) Database management

D) Synchronous communication with the server

Answer: A

What does the acronym API stand for in programming?

 

A) Advanced Programming Interface

B) Application Programming Interface

C) Automated Program Integration

D) Advanced Protocol Implementation

Answer: B

 

Section B: Theory Questions

Explain the concept of polymorphism and provide an example in object-oriented programming.

 

Answer: Polymorphism allows objects of different types to be treated as objects of a common base type. Example: method overloading or overriding in Java.

Define the term “hashing” and explain its application in data structures.

 

Answer: Hashing is the process of mapping data of arbitrary size to fixed-size values. It is commonly used in data structures like hash tables to achieve constant-time average complexity for key-based operations.

Discuss the advantages of using a linked list over an array in certain scenarios.

 

Answer: Linked lists offer dynamic size, efficient insertion/deletion, and better memory utilization compared to arrays. However, they have drawbacks like increased storage overhead and slower random access.

What is the significance of the P vs NP problem in computer science?

 

Answer: The P vs NP problem addresses the efficiency of algorithms. P represents problems solvable in polynomial time, while NP represents problems verifiable in polynomial time. The question of whether P equals NP is a major open problem in computer science.

Explain the concept of virtual memory in operating systems and its role in managing memory.

 

Answer: Virtual memory allows the execution of processes larger than physical memory by using disk space as an extension. It provides an illusion of a vast memory space, facilitating efficient memory management and multitasking.

Share This:
Click to comment

Leave a Reply

You May Also Like

Sponsored Links

You cannot copy content of this page