Computer Knowledge
Data Structures and Algorithms
1,518 Questions
Data Structures and Algorithms form the core of computer science, focusing on arrays, linked lists, trees, and sorting mechanisms. These concepts are essential for solving complex computational problems efficiently. Test takers preparing for technical and administrative IT exams will find these questions highly relevant.
Array OperationsLinked List ApplicationsSorting AlgorithmsTree Data StructuresMultilevel IndexingAlgorithm Time Complexity
Data Structures and Algorithms Questions
-
Arrays are dense lists and static data structure
-
data elements in linked list need not be stored in adjecent space in memory
-
pointers store the next data element of a list
-
linked lists are collection of the nodes that contain information part and next pointer
C
Correct answer
Explanation
Option C is false because pointers store the ADDRESS of the next node, not the data element itself. Options A, B, and D are true: arrays are dense static structures, linked list elements need not be adjacent in memory (linked by pointers), and linked lists are collections of nodes with data and pointer fields.
-
sorted linked list
-
sorted binary trees
-
sorted linear array
-
pointer array
A
Correct answer
Explanation
Binary search requires O(1) direct access to the middle element, which is not possible in linked lists as they require sequential traversal. Binary search CAN be applied to sorted linear arrays (direct index access), sorted binary trees (balanced BSTs allow O(log n) access), and pointer arrays (also support direct access).
-
underflow
-
overflow
-
housefull
-
saturated
B
Correct answer
Explanation
Overflow occurs when trying to insert data into a data structure that has no remaining space. Underflow is the opposite - attempting to remove from an empty structure. 'Housefull' and 'saturated' are not standard computer science terminology for this condition.
-
FIFO lists
-
LIFO list
-
Piles
-
Push-down lists
A
Correct answer
Explanation
Stacks operate on LIFO (Last In First Out) principle, meaning the last element added is the first one removed. FIFO (First In First Out) is the characteristic of queues, not stacks. LIFO, piles, and push-down lists are all names associated with stack data structures, while FIFO specifically describes queue behavior.
-
array
-
lists
-
stacks
-
all of above
C
Correct answer
Explanation
Push and pop are the fundamental operations of stack data structures. Push adds an element to the top of the stack, while pop removes the top element. While stacks can be implemented using arrays or linked lists, the terms push and pop specifically refer to stack operations and are standard terminology for this abstract data type.
-
Partition by key
-
join
-
Gather
-
reformat
C
Correct answer
Explanation
Gather is a de-partitioning component that collects data from multiple partitions and consolidates it into a single partition. This is the opposite of partitioning operations (like Partition by Key) that split data across partitions, making it the correct answer.
-
Partition by key
-
join
-
Gather
-
reformat
C
Correct answer
Explanation
Gather is a de-partitioning component because it collects data from multiple partitioned flows and reunites them into a single flow. The opposite operation is partitioning (by key, round robin, etc.). Components like Partition by key and Join are partitioning operations, not de-partitioning.
-
Round Robin
-
Same
-
Hash
-
Modulus
A,B
Correct answer
Explanation
Keyless partitioning methods distribute or maintain data flow without requiring a key column value. Round Robin rotates rows sequentially across partitions without reading any field. Same partitioning preserves the existing partitioning from the previous stage without applying any key-based logic. In contrast, Hash and Modulus both require a key column to calculate partition assignments.
B
Correct answer
Explanation
Transformer Stage Variables are strictly local to the Transformer stage where they're defined. They cannot be referenced or accessed outside that specific stage, unlike some other DataStage constructs. This scope limitation is by design to maintain encapsulation within the stage logic.
A
Correct answer
Explanation
Mapplets can be nested within other mapplets in Informatica. This allows building reusable transformation components that themselves contain other mapplets, creating modular hierarchical designs.
-
Analysis of Framework Manager
-
Filtering run time macros
-
Analysis of multi-dimensional model
-
Analysis of relational model
C
Correct answer
Explanation
Cognos Analysis Studio is designed for analyzing multi-dimensional data models (OLAP cubes), allowing users to explore data across multiple dimensions like time, geography, and product categories. It is not used for Framework Manager analysis (A), runtime macro filtering (B), or analyzing purely relational models (D). The tool specializes in OLAP and business intelligence analysis.
-
Vector
-
Array List
-
Linked List
-
None of the above
C
Correct answer
Explanation
LinkedList is theoretically the fastest for inserting into the middle of a list because it only requires updating the pointers of neighboring nodes, which is an O(1) operation once located. Array-based structures like ArrayList and Vector require shifting all subsequent elements, which is an O(N) operation and significantly slower.
-
Repository Server
-
Repository Database
-
Repository Manager
-
1 & 2
-
None
D
Correct answer
Explanation
Power Center Server consists of the Repository Server and Repository Database. The Repository Server manages connections and metadata storage, while the Repository Database stores all metadata objects. Repository Manager is a client tool for accessing the repository, not a server component.
B
Correct answer
Explanation
Transformer stage variables (also called stage variables) have scope limited to within the Transformer stage itself. They cannot be referenced or used outside of their defining Transformer stage, which is a fundamental scoping rule in DataStage job design.
-
Shared container
-
Transformer
-
Merge
-
Join
A
Correct answer
Explanation
Shared Containers are specifically designed to encapsulate reusable stage logic that can be shared across multiple jobs and projects. They promote code reuse and consistency when building similar jobs, making them the ideal choice for this requirement.