Computer Knowledge

Data Structures and Algorithms

1,256 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
  1. Stack

  2. Array

  3. Queue

  4. Linked List

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

A buffer operates as a Queue (FIFO - First In First Out) data structure. Items are added to the end and removed from the front, which matches the fundamental behavior of buffers in computer systems.

Multiple choice technology programming languages
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

For binary search methods (like Arrays.binarySearch or Collections.binarySearch) to work correctly, the array or collection must be sorted in the same natural order that the search expects. If the sort order differs from the search order, results are unpredictable. Therefore, the sort and search order MUST be the same.

Multiple choice technology databases
  1. The uniqueness value is a component of the row hash value.

  2. In a table that has a NUPI, all rows with the same NUPI value are distributed to the same AMP.

  3. Two Primary Index values that hash to the same row hash value are called hash synonyms.

  4. The output of the hashing algorithm is called the hash map

Reveal answer Fill a bubble to check yourself
B,C Correct answer
Explanation

In Teradata, rows with the same Non-Unique Primary Index (NUPI) value generate the same row hash and are sent to the same AMP. Different values hashing to the same row hash are called hash synonyms.

Multiple choice technology programming languages
  1. Array

  2. Vector

  3. List

  4. Pointers

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Arrays offer direct, contiguous memory allocation and index-based access without the overhead of synchronization (like Vector) or node traversal (like List), making basic operations faster.

Multiple choice technology programming languages
  1. a

  2. b

  3. same

  4. can't say

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The countdown loop (a) is marginally faster because comparing to zero is more efficient than comparing to 100001 on most processor architectures. However, this difference is negligible in modern JVMs with optimization. The question tests knowledge of low-level loop optimization.

Multiple choice technology databases
  1. Only nested tables need initilization.

  2. Index-by tables is a persistent collection

  3. nested tables are known as associative arrays.

  4. VARRAYs hold fixed number of elements

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In PL/SQL, VARRAYs (variable-size arrays) are defined with a maximum limit and hold a fixed maximum number of elements. Associative arrays are known as index-by tables, and nested tables do not persist in database columns without a storage table.

Multiple choice technology operating systems
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Indexing is primarily used to speed up data retrieval, not sorting. While indexes store data in sorted order (B-tree, etc.), their purpose is fast lookups via search keys, not data organization for sorting operations.

Multiple choice technology mainframe
  1. DATASORT

  2. SUBSET

  3. both a and b

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

DATASORT statement is used to sort data within a file between headers and trailers in mainframe/legacy systems like Easytrieve. This statement specifically handles sorting of data records while preserving the header and trailer records. SUBSET is used for record selection/filtering, not sorting.

Multiple choice technology mainframe
  1. INCLUDE COND = (10,3,CH,EQ,C'YES') SORT FIELDS = (1,5,CH,A)

  2. SORT FIELDS = (1,5,CH,A) INCLUDE COND = (10,3,CH,EQ,C'YES')

  3. Order doesn't matter

  4. INCLUDE COND = (10,3,CH,EQ,C'YES') SORT FIELDS = COPY

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Filtering records with INCLUDE COND before sorting them with SORT FIELDS is much more efficient because it reduces the volume of data that the sort engine needs to process and order in memory.

Multiple choice technology web technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

A hash collision occurs when two different keys produce the same hash value. In Java's Hashtable, these colliding entries are stored in a single bucket (traditionally using a linked list) to resolve the collision, making the statement true.

Multiple choice technology security
  1. Mars

  2. Serpent

  3. Twofish

  4. Des

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Serpent is considered the strongest among these for variable key encryption. It was an AES competition finalist known for its conservative design and high security margins, supporting 128, 192, and 256-bit keys. MARS and Twofish were also AES finalists but Serpent had the highest security margin. DES is weak with only 56-bit keys.