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
-
Filters
-
Sort
-
Rank
-
Data aggregation
B
Correct answer
Explanation
To find the top N or bottom N items, you must sort the data first. Ranking assigns position numbers, and filters can then select based on those ranks, but the fundamental operation is sorting to establish order.
-
Filters
-
Sort
-
Rank
-
Data aggregation
B
Correct answer
Explanation
Top n and Bottom n queries are achieved using Sort operations, which order data based on specified criteria and then allow selecting the highest or lowest values. Filters restrict data based on conditions, Rank assigns position numbers, and Data aggregation combines values - none directly produce ordered Top/Bottom selections.
-
Filters
-
Sort
-
Rank
-
Data aggregation
B
Correct answer
Explanation
To achieve Top n or Bottom n results, you need to Sort the data first to establish ordering, then select the first or last n records. Filters reduce rows but don't guarantee ordering, Rank assigns position numbers but doesn't subset data, and Data aggregation summarizes rather than selects extremes.
-
Entire
-
Round Robin
-
Random
-
Hash
-
Modulus
A,B,C
Correct answer
Explanation
Keyless partitioning methods distribute data without using a specific key column: Entire places all rows in one partition, Round Robin distributes rows sequentially across partitions, and Random assigns rows randomly. Hash and Modulus require key columns to calculate partition assignments.
B
Correct answer
Explanation
Array operations are faster than Vector because arrays are fixed-size, lightweight data structures with no synchronization overhead. Vector is a synchronized, thread-safe legacy class that acquires locks for every operation, making it slower even in single-threaded contexts.
C
Correct answer
Explanation
A Map is a collection data structure designed to associate unique key objects with corresponding value objects, allowing efficient retrieval of values based on their keys.
-
Using lookup() function
-
Using Generate Records component
-
Using re_index() function
-
Using next_in_sequence() function
D
Correct answer
Explanation
The next_in_sequence() function generates unique sequential numbers, which is the standard way to create surrogate keys in Ab Initio for maintaining unique identifiers across records.
-
Inner Join
-
Explicit Join ( record-required 0 = true, record-required 1 = true )
-
Explicit Join ( record-required 0 = false, record-required 1 = true )
-
Explicit Join ( record-required 0 = true, record-required 1 = false )
C
Correct answer
Explanation
Setting record-required 0 to false allows unmatched records from In0 to pass through (like a left outer join), while record-required 1 = true requires matches from In1. This gives all matching records plus unmatched In0 records.
-
Pipeline parallelism
-
Costly in terms of space and time
-
Removes duplicates on the key specified
-
None of the above
B
Correct answer
Explanation
Sort components are resource-intensive because they must collect all records before sorting, often require disk spillover for large datasets, and perform expensive comparison operations across the entire dataset.
-
Linked list
-
Twisted pair
-
Circular buffer
-
Sparse matrix
B
Correct answer
Explanation
A twisted pair is a type of copper wiring used for telecommunications, not a computer science data structure. The other options (linked list, circular buffer, sparse matrix) are all legitimate data structures used in programming.
-
proc printto allows to redirect the output
-
no difference
-
proc printto is faster and takes less memory space
-
proc printto does not exists
A
Correct answer
Explanation
In SAS, PROC PRINT writes data to the default output destination, whereas PROC PRINTTO is used to redirect SAS log or procedure output to an external file or alternative destination.
-
p is a pointer to a 10 element integer array
-
p is a 10-element array of pointers to integer quantity
-
p is a pointer to an integer quantity
-
None of the above
B
Correct answer
Explanation
In int *p[10], the array operator [ ] has higher precedence than *. This means p is an array of 10 elements, where each element is a pointer to an integer. int (*p)[10] would be a pointer to an array.
-
p is a pointer to a 10 element integer array
-
p is a pointer to an integer quantity
-
p is a 10-element array of pointers to an integer
-
None of the above
A
Correct answer
Explanation
The parentheses override default operator precedence. Because *p is grouped together, p is declared as a pointer. It points to an array of 10 integers. Without parentheses, int *p[10] would be an array of 10 pointers.
-
Similar Data
-
Isolated data
-
Unique data
-
None of Above
B
Correct answer
Explanation
In data warehousing, a 'stovepipe' refers to isolated data marts that are developed independently without conforming to enterprise standards. These stovepipe systems cannot easily share or integrate data with other parts of the organization, creating information silos. The term comes from the analogy of separate stove pipes that don't connect.
-
Clean Data
-
Dirty Data
-
Clean and Dirty Data
-
None of above
A
Correct answer
Explanation
A core purpose of data warehousing is the ETL (Extract, Transform, Load) process that cleanses source data by removing errors, handling missing values, standardizing formats, and applying business rules. The data warehouse stores this cleaned, consistent, integrated data - this is a fundamental differentiator from operational systems that may contain dirty, inconsistent data.