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 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
  1. Set set = new TreeSet();

  2. Set set = new HashSet();

  3. Set set = new SortedSet();

  4. List set = new SortedList();

  5. Set set = new LinkedHashSet();

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

TreeSet guarantees sorted order and uses natural ordering for Integers, so it will output [1, 2]. HashSet does not guarantee order. SortedSet is an interface, not a class, and cannot be instantiated. SortedList does not exist. LinkedHashSet maintains insertion order, not sorted order.

Multiple choice technology
  1. A, B, C,

  2. B, C, A,

  3. Compilation fails.

  4. The code runs with no output

  5. An exception is thrown at runtime.

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

LinkedList maintains insertion order. Elements B, C, A are added in that order, so iteration returns 'B, C, A, '. The for-each loop iterates in the order elements were inserted.

Multiple choice technology platforms and products
  1. SQl

  2. Query

  3. Case

  4. Validation

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

Both Case statements and Validation components can be used to validate data in different contexts - Case transformation validates data conditionally, while Validation is a dedicated validation mechanism. SQL is for queries, Query is for data retrieval, not validation.

Multiple choice technology platforms and products
  1. Insert,Update,Delete,Normal

  2. Insert,Update,Normal

  3. Insert,Update,Delete

  4. Insert,Update,Delete,Reduce

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

Table comparison transformation in ETL tools like Informatica produces four record types: Insert (new rows in target), Update (changed rows), Delete (rows removed from source), and Normal (unchanged rows that pass through). The Normal flag identifies rows that matched but had no changes, which is useful for auditing and tracking processing statistics.

Multiple choice technology architecture
  1. Subject orientation

  2. Non-volatile

  3. Integrated

  4. Time variant

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

Data warehouses have four key characteristics per W.H. Inmon: subject-oriented (organized around major subjects), non-volatile (data is read-only), integrated (data from multiple sources is standardized), and time-variant (provides historical perspective). All options are correct.

Multiple choice technology architecture
  1. Fact

  2. Dimension

  3. Granularity

  4. Summary

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

Granularity refers to the level of detail stored in the data warehouse - how fine or coarse the data is. For example, sales data stored by day versus by month represents different granularity levels. Facts are measurements, dimensions provide context, and summary is an aggregation.

Multiple choice technology programming languages
  1. a. arr.length

  2. b. arr.length - 1

  3. c. arr.size

  4. d. arr.size - 1

  5. e. arr.length()

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

In Java, 'length' is a public final field of an array object that stores the number of elements. Unlike Strings (which use length()) or Collections (which use size()), arrays use the '.length' property.