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
-
active
-
passive
-
connected
-
Connected and unconnected
D
Correct answer
Explanation
Lookups in Informatica are classified into two types: Connected lookup (part of the data flow pipeline, receives input rows directly) and Unconnected lookup (called from within another transformation using :LKP reference, not directly in data flow). Active and passive refer to transformation types, not lookup categories. Connected vs unconnected determines how the lookup is invoked and whether it's part of the main flow.
-
Sendind and receiving heart beat packets
-
management of starting,stoping and relocating packages
-
monitoring network connectivity
-
management and coordination of node membership
D
Correct answer
Explanation
The cluster manager in Serviceguard handles node membership - tracking which nodes join, leave, or fail in the cluster. It coordinates membership changes during reconfiguration. Heartbeat monitoring is typically handled by separate cluster communication protocols, not the membership manager itself.
B
Correct answer
Explanation
The statement is false because NULL values mapping to non-nullable target fields MUST be handled in code through validation logic, default value assignment, or data cleansing rules. Without such handling, the ETL process would fail with constraint violations when attempting to insert NULL into NOT NULL database columns.
-
Stack is a data structure that is based on First-in-First-Out (FIFO) rule
-
Queues are based on Last-In-First-Out (LIFO) rule
-
Neither (a) nor (b)
-
Both (a) and (b)
C
Correct answer
Explanation
Stack follows LIFO (Last-In-First-Out) - the last element pushed is the first one popped. Queues follow FIFO (First-In-First-Out) - the first element enqueued is the first one dequeued. Therefore neither statement (a) nor (b) is correct.
-
Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of the array.
-
An index can only be modified using PERFORM, SEARCH & SET.
-
Need to have index for a table in order to use SEARCH, SEARCH ALL.
-
None of the above
D
Correct answer
Explanation
All statements A, B, and C are true in COBOL. A subscript refers to the occurrence number in an array, while an index represents byte displacement. Indices can only be modified with PERFORM, SEARCH, or SET statements, and SEARCH operations require an index. Since all A, B, C are true, D (None of the above is False) is the correct answer.
-
CHILD
-
DEPENDENT
-
TWIN
-
SIBLINGS
C
Correct answer
Explanation
In IMS database terminology, when a parent segment has multiple occurrences of the same child segment type, those child segments are called 'twins'. For example, if an ORDER segment has multiple LINE-ITEM segments of type 'LINE-ITEM', those LINE-ITEMs are twins of each other under that ORDER.
-
Port that receives small amount of data
-
Port that receives large amount of data
-
Both ports
-
None of the above
B
Correct answer
Explanation
In a join component, the driving port should be the one receiving the larger amount of data. This optimizes performance because the join operation processes data more efficiently when driving from the larger dataset.
-
Interleave
-
Gather
-
Merge
-
Broadcast
D
Correct answer
Explanation
Broadcast is a PARTITION component that distributes data to multiple output flows. Departition components collect and combine data from multiple partitions - Interleave, Gather, and Merge are all departition components.
-
next_in_sequence()
-
sequence_generator()
-
serial_generator()
-
random_generator()
A
Correct answer
Explanation
next_in_sequence() is the built-in Ab Initio function that generates sequential numbers within a transform. It increments automatically for each record processed, providing a unique sequence number.
-
Point-to-Point
-
Hub and Spoke
-
Bus
-
All the above
-
Converting an XML string to a XML schema tree, based on the XSD or DTD specified
-
Taking an instance of an XML schema element and transform it to a stream of bytes containing XML or an XML string
-
Both
-
None
A
Correct answer
Explanation
Parse XML activity converts an XML string into an XML schema tree structure based on a specified XSD or DTD. Option B describes the inverse operation (generating XML from a schema element tree), which is handled by Render XML or similar activities, not Parse XML.
-
Big-O
-
Small-O
-
Omega
-
theta
D
Correct answer
Explanation
Theta (Θ) notation provides both upper and lower bounds, making it the tightest bound among the asymptotic notations. Big-O only gives an upper bound, Omega (Ω) only gives a lower bound, and small-o (o) is a strict upper bound. Theta means the function grows at the same rate within constant factors.
-
Algorithm1 beats algorithm2 when n tends to infinity
-
Algorithm2 beats algorithm when n tends to infinity
-
Nothing can be said about the performance of both algorithms for lower values of n
-
Algorithm1 performs the same as algorithm2
B,C
Correct answer
Explanation
Algorithm2 with T(n) time complexity is asymptotically faster than Algorithm1 with T(n^2). As n approaches infinity, n grows much slower than n^2, so Algorithm2 dominates. However, for small values of n, the constant factors hidden by Big-O notation may cause either algorithm to perform better, so nothing definitive can be said for lower n values.
-
AVL trees.
-
JBL trees
-
Red-black Trees
-
Blue-Green Trees
A,C
Correct answer
Explanation
AVL trees and Red-Black trees are self-balancing binary search trees that maintain balance through rotations during insertions and deletions. JBL trees and Blue-Green trees are not standard balanced BST data structures in computer science literature.
-
A class that contains groups of unique sequences of bits
-
A method for flipping individual bits in instance of a primitive type
-
An array of boolean primitives that indicate zeros or ones
-
A collection for storing bits as on-off information, like a vector of bits
D
Correct answer
Explanation
A BitSet in Java is specifically designed to efficiently store and manipulate bits as on-off information, functioning like a vector of bits where each bit represents a boolean state (true/false or 1/0). It's not just a boolean array (option C), nor is it about flipping bits in primitives (B) or storing unique sequences (A).