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 architecture
  1. Collection

  2. List

  3. Set

  4. Map

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

A Set is designed to store unique elements and automatically prevents duplicates. Unlike Lists, Sets do not allow duplicate values. Maps store key-value pairs rather than single elements. When uniqueness is the requirement and lookup speed is not critical, a Set is the appropriate choice.

Multiple choice technology architecture
  1. Collection

  2. List

  3. Set

  4. Map

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

A Map stores key-value pairs and ensures keys are unique - attempting to store a duplicate key replaces the old entry, effectively preventing duplicates. Collection and List allow duplicates, Set prevents duplicates but doesn't offer key-value mapping. Since the requirement is uniqueness and searching isn't a priority, Map is most suitable.

Multiple choice technology
  1. Knowledge discovery of databases

  2. Knowledge discovery in databases

  3. Knowledge detection in databases

  4. None of the above

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

KDD stands for Knowledge Discovery in Databases. It is the overall process of discovering useful knowledge from data, encompassing data cleaning, integration, selection, transformation, mining, and interpretation. Note it is 'in' not 'of' - the preposition matters for the correct acronym. This is a foundational concept in data mining and machine learning.

Multiple choice technology packaged enterprise solutions
  1. MultiProviders

  2. Virtual Providers

  3. DSO

  4. InfoCubes

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

In SAP BW, aggregates (pre-summarized data structures for performance) can ONLY be created for InfoCubes (D). MultiProviders (A) are logical views that cannot have aggregates. Virtual Providers (B) provide real-time access and don't support aggregates. DSOs (C) are for data staging, not reporting aggregates.

Multiple choice technology
  1. Sort merge

  2. Ordered

  3. Stable sort

  4. none of the above

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

Sort Merge collects sorted data from multiple partitions. Ordered collection reads all records from one partition before moving to the next. Both are collection methods. Stable Sort is not a standard DataStage collection method.

Multiple choice technology
  1. Same

  2. Entire

  3. Hash By Key

  4. Round robin

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

Round-Robin is often considered the most efficient partitioning method because it requires no computation - rows are simply distributed in rotation to each partition. Same requires no movement but keeps existing distribution, Entire is expensive (broadcasts all data), Hash requires hash computation. Round-Robin's simplicity makes it fastest for even distribution.

Multiple choice technology
  1. a) 2 input links,3 output links and 2 reject links

  2. b) 1 input link,any number of output links and 1 reject link.

  3. c) 1 input link,3 output links and 1 reject link.

  4. None of the above

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

The Transformer stage in DataStage accepts one input link, can have any number of output links for routing transformed data, and has one reject link for capturing records that fail transformation rules. This design allows flexible data transformation with multiple output destinations and error handling.

Multiple choice technology
  1. Broadcast

  2. Replicate

  3. Partition by Round-Robin

  4. Partition by Key

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

Broadcast, Partition by Round-Robin, and Partition by Key are all data partitioning methods in Ab Initio that distribute data across multiple partitions. Replicate, however, is NOT a partitioning method - it copies the entire dataset to every partition (full replication). The key difference is that partitioning divides data (each record goes to one partition), while replication duplicates it (every record goes to all partitions).

Multiple choice technology programming languages
  1. SEQUENTIAL

  2. RANDOM

  3. DYNAMIC

  4. NONE OF THE ABOVE

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

DYNAMIC access mode allows programmers to access records sequentially or randomly on the same file in COBOL. SEQUENTIAL and RANDOM modes limit record retrieval to their respective patterns only. Therefore, DYNAMIC is the correct choice because it is the only mode that permits both access methodologies.

Multiple choice
  1. A recursive function is a special function that calls itself.

  2. A recursive function allows us to break down a complex problem in small parts.

  3. It must have an exit condition.

  4. The first function call should be the first one to complete.

  5. Recursion method is applied in many algorithms such as quick sort or binary sort.

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

One of the properties of recursive functions is that a given function call must wait for the following function calls to complete its run before it itself can finish. The innermost function call must be completed before we can finish the next inner function call. We must make sure that the first function call (the outermost one) will be the last one to complete.

Multiple choice
  1. LinkedList

  2. Binary Tree

  3. Stack

  4. Queue

  5. Array

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

A queue is a data structure which stores the data in First In First Out Mode. A queue consists of two sides - front and rear. The nodes are added from the rear side and removed from the front side just like people join a queue from the end and pull out   from the beginning in a real life queue. The node that was added the first is also the first one to be removed.