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 enterprise content management
  1. Comprised of normalized dimension and fact tables.

  2. Organizes dimension tables into hierarchies and levels.

  3. Allows "real time" analysis against disparate data sources.

  4. Cardinality between tables is typically configured as inner joins.

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

To answer this question, the user needs to understand what OLAP means and the characteristics of an OLAP data structure.

OLAP stands for Online Analytical Processing. It is a technology used to store and analyze large amounts of data in a multidimensional format. OLAP data structures are designed to support complex queries and analysis of data.

Now, let's go through each option and explain why it is right or wrong:

A. Comprised of normalized dimension and fact tables.

This option is incorrect. While OLAP data structures do use dimension and fact tables, they are not necessarily normalized. In fact, OLAP data structures use denormalized tables to improve performance.

B. Organizes dimension tables into hierarchies and levels.

This option is correct. OLAP data structures are designed to organize dimension tables into hierarchies and levels to enable quick and easy analysis of data.

C. Allows "real time" analysis against disparate data sources.

This option is incorrect. While OLAP data structures are designed to support complex queries and analysis of data, they are not typically used for real-time analysis. OLAP systems are often updated on a regular basis, rather than in real-time, to improve performance.

D. Cardinality between tables is typically configured as inner joins.

This option is incorrect. While inner joins are often used in OLAP data structures, other types of joins can also be used depending on the specific requirements of the system.

Therefore, the correct answer is:

The Answer is: B. Organizes dimension tables into hierarchies and levels.

Multiple choice technology databases
  1. In the database

  2. using a source qualifier transformation

  3. using a joiner transformation

  4. his cannot be done in Power Center 8.x

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

When joining two tables from the same database in PowerCenter, using a Source Qualifier transformation is most efficient because it pushes the join to the database level. The database optimized the join using its query engine. Joiner transformation joins data in memory after both tables are read, which is less efficient. The option 'In the database' is vague and not a PowerCenter component.

Multiple choice technology databases
  1. Near to source

  2. Near to target

  3. Can be placed anywhere

  4. (i)Session performance is not affected

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

Placing filters near the source reduces the volume of data processed through subsequent ETL transformations. This minimizes overall network overhead and resource utilization, maximizing performance compared to filtering near the target.

Multiple choice technology databases
  1. Joining two flat files

  2. To join two table from different data bases

  3. To join flat file and relational table

  4. All of the above

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

The Joiner transformation in PowerCenter can join heterogeneous data sources: two flat files, tables from different databases, or a flat file with a relational source. Joiner is designed specifically for joining data from different sources or types, which is why 'All of the above' is correct. It performs the join in Informatica's memory rather than pushing it to a database.

Multiple choice technology programming languages
  1. Compilation fails.

  2. aAaA aAa AAaa AaA

  3. AAaa AaA aAa aAaA

  4. AaA AAaa aAaA aAa

  5. aAa AaA aAaA AAaa

  6. An exception is thrown at runtime

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

To solve this question, the user needs to know the basics of Java programming language and the concept of ArrayList and Collections.sort() method.

The program initializes an ArrayList of strings and adds four different string elements to it. Then, it uses the Collections.sort() method to sort the elements of the ArrayList in ascending order. Finally, it prints the sorted list of strings.

When comparing strings, the sort() method uses lexicographic ordering, meaning that it compares the strings character by character based on their Unicode values.

Now, let's go through each option and explain why it is right or wrong:

A. Compilation fails. This option is incorrect. The program is syntactically correct and will compile without errors.

B. aAaA aAa AAaa AaA. This option is incorrect. The sort() method sorts the strings in ascending order, so the correct output should start with AAaa, followed by AaA, then aAa, and finally aAaA.

C. AAaa AaA aAa aAaA. This option is correct. The sort() method sorts the strings in ascending order based on their Unicode values. Therefore, the correct output is AAaa AaA aAa aAaA.

D. AaA AAaa aAaA aAa. This option is incorrect. The correct output should start with AAaa, followed by AaA, then aAa, and finally aAaA.

E. aAa AaA aAaA AAaa. This option is incorrect. The correct output should start with AAaa, followed by AaA, then aAa, and finally aAaA.

F. An exception is thrown at runtime. This option is incorrect. There are no statements in the program that could throw any exceptions.

Therefore, the correct answer is:

The Answer is: C. AAaa AaA aAa aAaA

Multiple choice technology platforms and products
  1. One-to-one

  2. Many-to-one

  3. One-to-many

  4. Many-to-many

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

In Pega, a Folder can contain multiple items, and each item can belong to multiple Folders simultaneously. For example, a work object might be in a 'High Priority' folder, a 'New York' folder, and a 'Insurance Claims' folder all at once. Similarly, a folder contains many items, creating a many-to-many relationship. One-to-one, many-to-one, and one-to-many don't capture this bidirectional, multi-member relationship that Folders and items share.

Multiple choice technology programming languages
  1. The before() method will print 1 2

  2. The before() method will print 1 2 3

  3. The before() method will print three numbers, but the order cannot be determined

  4. The before() method will not compile

  5. The before() method will throw an exception at runtime

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

TreeSet requires its elements to be mutually Comparable. The code adds String "2", Integer 3, and String "1" to a TreeSet without a Comparator. When TreeSet tries to sort these mixed types, it attempts to compare String with Integer using natural ordering, which throws ClassCastException at runtime because String and Integer are not mutually comparable.

Multiple choice technology databases
  1. Color

  2. example

  3. No base type

  4. Both (A) and (B)

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

In the array declaration Color[] example = new Color[20], Color is the base type (component type) of the array. The variable name is example, but the array's base type - the type of elements it stores - is Color. Every array in Java has a base type that specifies what kind of objects it can hold.

Multiple choice technology databases
  1. OrderedDictionary class

  2. ListDictionary class

  3. HybridDictionary class

  4. Hashtable class

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

The HybridDictionary class is optimized for both small and large collections by starting as a lightweight ListDictionary when the collection has few items, and automatically switching to a Hashtable as the collection grows. ListDictionary is only fast for small lists, while Hashtable has higher overhead.

Multiple choice technology
  1. If selected, case-sensitive string comparisons are done in joiner

  2. A normal or master outer join performs faster than a full outer or detail outer join

  3. A master outer join ONLY keeps all rows of data from the detail source

  4. Sorted input can be used for joiner

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

A master outer join in Joiner transformation keeps all rows from the MASTER source, not the detail source. This is the opposite of what option C states, making it the false statement that the question asks for. The other options are true: case-sensitive option exists for string comparisons, master outer join is generally faster than full/detail outer, and sorted input can improve joiner performance.

Multiple choice technology databases
  1. No more than 1 data type conversion is allowed per column during the Fastload

  2. If an AMP is down FL cannot be restarted untill that AMP is back online

  3. only load 1 empty table with one fast load job

  4. Fast load assembles data in 64K blocks and then loads it using mutltiple sessions

  5. Fast load supports triggers.

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

Fast Load has specific constraints: it permits at most one data type conversion per column for performance, requires all AMPs to be online for restartability, and loads exactly one empty target table per job. It does not support triggers during load operations.

Multiple choice technology databases
  1. Target table should not be created in the script

  2. target table should be created in the script

  3. Error tables should not be dropped in the script

  4. Checkpoint should be declared in the script

  5. Target table should not be dropped in the script

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

Fast Load restartability requires maintaining the state across runs. The target and error tables must exist before the script runs and persist after. Dropping them would lose restart information. Checkpoints provide recovery points so FL can resume from the last successful point rather than starting over.

Multiple choice technology databases
  1. It is possible to stipulate how many updates may occur per minute

  2. It is possible to have tpump running in the background all the time and just control its flow rate

  3. It can load upto 60 tables at a time if using a single source

  4. It can be stopped any time and all locks dropped or released with no ill consequences.

  5. it uses macro to run the SQL statements

  6. It has more error tollerance than FL and ML

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

Tpump offers flexible real-time loading: configurable update rates (A), continuous background operation with flow control (B), support for up to 60 target tables from one source (C), safe stoppability without lock issues (D), and efficient SQL execution via macros (E). It is not designed for the extensive error handling that Multi Load provides.

Multiple choice technology
  1. Only 1 is incorrect

  2. All are correct

  3. Except 1, all are incorrect

  4. Only 2 and 3 are incorrect

Reveal answer Fill a bubble to check yourself
C Correct answer
Multiple choice technology
  1. a and b only

  2. a,b and c

  3. a,c and d

  4. All the above

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

Source Analyzer in Informatica can import or create multiple source types: relational tables/views/synonyms (a), COBOL files (c), XML files and data models (d). However, fixed-width and delimited flat files containing binary data (b) are NOT supported through Source Analyzer - binary data requires different handling. Therefore the correct combination is a, c, and d.