0

programming languages Online Quiz - 80

Description: programming languages Online Quiz - 80
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

You specified segment space management as automatic for a tablespace what effect would this have on space management?

  1. Extents would be managed by freelists.

  2. Free space would be managed by data dictionary

  3. The segment would be managed by bitmaps.

  4. The segment would be managed by freelists.


Correct Option: C

Which two are valid locking levels that are used by transactions in oracle database? (Choose two)

  1. Object level.

  2. Row level.

  3. Block level.

  4. Schema level.

  5. Database level.


Correct Option: A,B

AI Explanation

To answer this question, you need to understand the concept of locking levels in Oracle database.

Locking levels determine the granularity at which transactions can lock resources (such as tables, rows, or objects) to ensure data consistency and concurrency control.

Let's go through each option to determine which ones are valid locking levels:

Option A) Object level - This option is correct. Object-level locking allows transactions to lock entire database objects, such as tables or views. Transactions can lock an entire object to ensure exclusive access and prevent other transactions from modifying the object.

Option B) Row level - This option is correct. Row-level locking allows transactions to lock individual rows within a table. This locking level provides more granular control and allows multiple transactions to access different rows concurrently.

Option C) Block level - This option is incorrect. Block-level locking is not a valid locking level in Oracle database. Oracle uses multi-versioning to manage concurrency control, which means that transactions can read consistent versions of data without blocking other transactions.

Option D) Schema level - This option is incorrect. Schema-level locking is not a valid locking level in Oracle database. Locking is typically done at a more granular level, such as object or row level, to minimize contention and allow better concurrency control.

Option E) Database level - This option is incorrect. Database-level locking is not a valid locking level in Oracle database. Locking is performed at a more granular level, such as object or row level, to allow concurrent access to different parts of the database.

The correct answers are Option A (Object level) and Option B (Row level). These locking levels are used by transactions in Oracle database to ensure data consistency and concurrency control.

Your database is having two control files; three redo log file groups with two members in each group. Failure of which file would cause a instance to shut down?

  1. Loss of the initialization parameter file.

  2. One of the redo log members.

  3. Any data file belonging to the default permanent tablespace

  4. Any archive log file.

  5. Any control file.


Correct Option: E
  1. It is possible to have tablespaces of different block sizes in a database.

  2. A data block is the smallest unit of I/O for data files.

  3. Multiple tablespaces can share single data file.

  4. Each data block in the database always corresponds to one OS block

  5. Each segment contains one or more extents.


Correct Option: A,B,E

Which three statements are true about the stages of database startup?

  1. Data files and redo log files can be renamed at the MOUNT stage

  2. Control files are required to bring the database to the NOMOUNT stage.

  3. Data files and online redo log files are checked for consistency while opening the database

  4. Data files and redo log files are made available to users at the OPEN stage.


Correct Option: A,C,D

What elements will the @a array consist of? $_ = ' a b c '; my @a = split();

  1. ', 'a', ' ', 'b', ' ', 'c', ' '

  2. ', 'a', 'b', 'c', ''

  3. undef, 'a', 'b', 'c', undef

  4. 'a', 'b', 'c'


Correct Option: D

package A; sub NEW { bless {}, shift } sub AUTOLOAD { print ref(shift) } package main; my $obj = NEW A; $obj->foo();

  1. A

  2. AA

  3. Can't locate object method "foo" via package "A"

  4. none of the above


Correct Option: B

In Perl, a/n ________ is a special character or a sequence that will define the number of times the previous character or sequence appears.

  1. character class

  2. metacharacter

  3. assertion

  4. quantifier


Correct Option: D

In Perl, 'stat' returns a thirteen element array with which of the following values?

  1. Last access

  2. Inode number

  3. Both of the above

  4. Perl Version ID


Correct Option: C

Which of the following is the correct way of sorting an array of integers in ascending order?

  1. sort @a

  2. sort {$1 <=> $2} @a

  3. sort {$a <=> $b} @a

  4. sort {$[0] <=> $[1]} @a


Correct Option: C

What gets printed? my @a = ([1, 2, 3, 4], [5, 6, 7, 8]); print join(' ', @{$a[1]}[1..3]);

  1. 1 2 3

  2. 2 3 4

  3. 5 6 7

  4. 6 7 8


Correct Option: D

AI Explanation

To answer this question, let's break down the given code:

my @a = ([1, 2, 3, 4], [5, 6, 7, 8]);
print join(' ', @{$a[1]}[1..3]);

In the first line, an array @a is declared and initialized with two array references: [1, 2, 3, 4] and [5, 6, 7, 8].

In the second line, the print statement is used to output the result. The join function is used to concatenate the elements of an array with a specified delimiter. In this case, the delimiter is a space ' '.

The expression @{$a[1]}[1..3] is used to access the elements from the second array reference ($a[1]) using array dereferencing (@{}) and array slicing ([1..3]). This means we are accessing elements 1, 2, and 3 from the second array.

Therefore, the output of the print statement will be 6 7 8, which corresponds to option D: "6 7 8".

All three ways of calling new() are equivalent in the code below package A; sub new { my ($class, $param) = @_; return bless {param => $param}, $class; } package main; my $a1 = A->new('foo'); my $a2 = new A('foo'); my $a3 = A::new('A', 'foo');

  1. True

  2. False


Correct Option: B

Which regular expression deletes all tags specified as text enclosed by "" from a document stored in a string, but deletes nothing else?

  1. $string =~ s///g;

  2. $string =~ s///g;

  3. $string =~ s///g;

  4. $string =~ s///g;


Correct Option: D

sorted map is

  1. interface

  2. class

  3. Object

  4. None of these


Correct Option: A
  1. set

  2. ConcurrentSkipListSet

  3. Hashmap

  4. Queue


Correct Option: B

RandomAccess interface is found in

  1. java.io

  2. java.util

  3. javax.xml.stream

  4. java.io.*


Correct Option: B

Compile time error can

  1. Handle with try catch block

  2. Handle with Throwable class

  3. Both of above true

  4. None of above


Correct Option: D
- Hide questions