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

Multiple choice technology programming languages
  1. active

  2. passive

  3. connected

  4. Connected and unconnected

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology packaged enterprise solutions
  1. Sendind and receiving heart beat packets

  2. management of starting,stoping and relocating packages

  3. monitoring network connectivity

  4. management and coordination of node membership

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology testing
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. Stack is a data structure that is based on First-in-First-Out (FIFO) rule

  2. Queues are based on Last-In-First-Out (LIFO) rule

  3. Neither (a) nor (b)

  4. Both (a) and (b)

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology mainframe
  1. Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of the array.

  2. An index can only be modified using PERFORM, SEARCH & SET.

  3. Need to have index for a table in order to use SEARCH, SEARCH ALL.

  4. None of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology databases
  1. CHILD

  2. DEPENDENT

  3. TWIN

  4. SIBLINGS

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. Port that receives small amount of data

  2. Port that receives large amount of data

  3. Both ports

  4. None of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. Interleave

  2. Gather

  3. Merge

  4. Broadcast

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. Converting an XML string to a XML schema tree, based on the XSD or DTD specified

  2. Taking an instance of an XML schema element and transform it to a stream of bytes containing XML or an XML string

  3. Both

  4. None

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. Big-O

  2. Small-O

  3. Omega

  4. theta

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. Algorithm1 beats algorithm2 when n tends to infinity

  2. Algorithm2 beats algorithm when n tends to infinity

  3. Nothing can be said about the performance of both algorithms for lower values of n

  4. Algorithm1 performs the same as algorithm2

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. A class that contains groups of unique sequences of bits

  2. A method for flipping individual bits in instance of a primitive type

  3. An array of boolean primitives that indicate zeros or ones

  4. A collection for storing bits as on-off information, like a vector of bits

Reveal answer Fill a bubble to check yourself
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).