Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

51.

What Do You Mean By Pure Virtual Functions In C++? Give An Example?

Answer»

Pure VIRTUAL function is a function which doesn't have an implementation and the same NEEDS to be implemented by the the NEXT immediate non-abstract class. (A class will BECOME an abstract class if there is at-least a single pure virtual function and thus pure virtual functions are used to create interfaces in c++).

Pure virtual function is a function which doesn't have an implementation and the same needs to be implemented by the the next immediate non-abstract class. (A class will become an abstract class if there is at-least a single pure virtual function and thus pure virtual functions are used to create interfaces in c++).

52.

How To Create A Pure Virtual Function?

Answer»

A function is MADE as pure virtual function by the USING a specific signature, " = 0" appended to the function declaration as given below,
CLASS SymmetricShape {
public:
// DRAW() is a pure virtual function.
virtual void draw() = 0;
};

A function is made as pure virtual function by the using a specific signature, " = 0" appended to the function declaration as given below,
class SymmetricShape {
public:
// draw() is a pure virtual function.
virtual void draw() = 0;
};

53.

Why Pure Virtual Functions Are Used If They Don't Have Implementation / When Does A Pure Virtual Function Become Useful?

Answer»

Pure virtual functions are used when it doesn't make sense to provide definition of a virtual function in the BASE CLASS or a proper definition does not exists in the context of base class. Consider the above example, class SymmetricShape is used as base class for shapes with symmetric structure(CIRCLE, SQUARE, equilateral triangle etc). In this case, there exists no proper definition for function draw() in the base class SymmetricShape instead the CHILD classes of SymmetricShape (Cirlce, Square etc) can implement this method and draw proper shape.

Pure virtual functions are used when it doesn't make sense to provide definition of a virtual function in the base class or a proper definition does not exists in the context of base class. Consider the above example, class SymmetricShape is used as base class for shapes with symmetric structure(Circle, square, equilateral triangle etc). In this case, there exists no proper definition for function draw() in the base class SymmetricShape instead the child classes of SymmetricShape (Cirlce, Square etc) can implement this method and draw proper shape.

54.

What Is Virtual Destructor? Why They Are Used?

Answer»

Virtual destructors are USED for the same purpose as virtual functions. When you remove an object of subclass, which is REFERENCED by a parent CLASS pointer, only destructor of base class will get executed. But if the destructor is DEFINED USING virtual keyword, both the destructors [ of parent and sub class ] will get invoked.

Virtual destructors are used for the same purpose as virtual functions. When you remove an object of subclass, which is referenced by a parent class pointer, only destructor of base class will get executed. But if the destructor is defined using virtual keyword, both the destructors [ of parent and sub class ] will get invoked.

55.

What You Mean By Early Binding And Late Binding? How It Is Related To Dynamic Binding?

Answer»

Binding is the process of linking ACTUAL address of functions or identifiers to their reference. This happens mainly two times.
During compilation : This is called early binding
 For all the direct FUNCTION REFERENCES compiler will replace the reference with actual address of the method.
At runtime : This is called late binding.
In case of VIRTUAL function calls using a Base reference, compiler does not know which method will get called at run time. In this case compiler will replace the reference with code to get the address of function at runtime.
Dynamic binding is another name for late binding.

Binding is the process of linking actual address of functions or identifiers to their reference. This happens mainly two times.
During compilation : This is called early binding
 For all the direct function references compiler will replace the reference with actual address of the method.
At runtime : This is called late binding.
In case of virtual function calls using a Base reference, compiler does not know which method will get called at run time. In this case compiler will replace the reference with code to get the address of function at runtime.
Dynamic binding is another name for late binding.

56.

How To Create A Reference Variable In C++?

Answer»

APPENDING an ampersand (&) to the end of datatype MAKES a variable ELIGIBLE to use as reference variable.
int a = 20;
int& b = a;
The first statement initializes a an integer variable a. Second statement creates an integer reference initialized to variable a TAKE a look at the below example to see how reference variables work.
int main ()
{
int a;
int& b = a;
a = 10;
cout << "Value of a : " << a << endl;
cout << "Value of a reference (b) : " << b << endl;
b = 20;
cout << "Value of a : " << a << endl;
cout << "Value of a reference (b) : " << b << endl;
return 0;
}
Above code creates following output.
Value of a : 10
Value of a reference (b) : 10
Value of a : 20
Value of a reference (b) : 20

Appending an ampersand (&) to the end of datatype makes a variable eligible to use as reference variable.
int a = 20;
int& b = a;
The first statement initializes a an integer variable a. Second statement creates an integer reference initialized to variable a Take a look at the below example to see how reference variables work.
int main ()
{
int a;
int& b = a;
a = 10;
cout << "Value of a : " << a << endl;
cout << "Value of a reference (b) : " << b << endl;
b = 20;
cout << "Value of a : " << a << endl;
cout << "Value of a reference (b) : " << b << endl;
return 0;
}
Above code creates following output.
Value of a : 10
Value of a reference (b) : 10
Value of a : 20
Value of a reference (b) : 20

57.

What Is Meant By Reference Variable In C++?

Answer»

In C++, reference variable allows you create an alias (SECOND name) for an already existing variable. A reference variable can be used to access (read/write) the original data. That MEANS, both the variable and reference variable are attached to same memory location. In effect, if you CHANGE the value of a variable USING reference variable, both will get changed (because both are attached to same memory location).

In C++, reference variable allows you create an alias (second name) for an already existing variable. A reference variable can be used to access (read/write) the original data. That means, both the variable and reference variable are attached to same memory location. In effect, if you change the value of a variable using reference variable, both will get changed (because both are attached to same memory location).

58.

What Are The Difference Between Reference Variables And Pointers In C++?

Answer»

Pointers:

  • Pointers can be assigned to NULL
  • Pointers can be (re)pointed to any OBJECT, at any TIME, any number of times during the execution.
  • Pointer has own memory address and location on stack

Reference Variables:

  • References cannot be assigned NULL. It should ALWAYS be associated with actual memory, not NULL.
  • Reference variables should be initialized with an object when they are CREATED and they cannot be reinitialized to REFER to another object
  • Reference variables has location on stack, but shares the same memory location with the object it refer to.

Pointers:

Reference Variables:

59.

What Do You Mean By Storage Classes?

Answer»

Storage class are used to specify the visibility/scope and LIFE time of symbols(FUNCTIONS and variables). That means, storage classes specify where all a variable or function can be ACCESSED and till what time those variables will be available during the execution of PROGRAM.

Storage class are used to specify the visibility/scope and life time of symbols(functions and variables). That means, storage classes specify where all a variable or function can be accessed and till what time those variables will be available during the execution of program.

60.

What Do You Mean By Internal Linking And External Linking In C++?

Answer»

A symbol is said to be LINKED internally when it can be ACCESSED only from with-in the scope of a single translation unit. By external linking a symbol can be accessed from other translation UNITS as well. This linkage can be controlled by using static and extern keywords.

A symbol is said to be linked internally when it can be accessed only from with-in the scope of a single translation unit. By external linking a symbol can be accessed from other translation units as well. This linkage can be controlled by using static and extern keywords.

61.

What Do You Mean By Translation Unit In C++?

Answer»

We organize our C++ PROGRAMS into different source files (.cpp, .cxx etc). When you consider a source file, at the preprocessing stage, some extra content may get added to the source code ( for example, the contents of HEADER files included) and some content may get removed ( for example, the part of the code in the #ifdef of #ifndef block which resolve to false/0 based on the symbols defined). This effective content is called a translation unit. In other words, a translation unit consists of Contents of source file Plus contents of files included DIRECTLY or indirectly Minus source code lines ignored by any CONDITIONAL pre processing DIRECTIVES ( the lines ignored by #ifdef,#ifndef etc)

We organize our C++ programs into different source files (.cpp, .cxx etc). When you consider a source file, at the preprocessing stage, some extra content may get added to the source code ( for example, the contents of header files included) and some content may get removed ( for example, the part of the code in the #ifdef of #ifndef block which resolve to false/0 based on the symbols defined). This effective content is called a translation unit. In other words, a translation unit consists of Contents of source file Plus contents of files included directly or indirectly Minus source code lines ignored by any conditional pre processing directives ( the lines ignored by #ifdef,#ifndef etc)

62.

What Are C++ Inline Functions?

Answer»

C++ inline functions are special functions, for which the compiler replaces the function call with body/definition of function. Inline functions makes the PROGRAM execute faster than the normal functions, since the overhead involved in saving current state to stack on the function call is avoided. By giving developer the control of making a function as inline, he can further optimize the CODE based on application logic. But actually, it's the compiler that decides whether to MAKE a function inline or not regardless of it's declaration. Compiler may choose to make a non inline function inline and vice versa. Declaring a function as inline is in effect a request to the compiler to make it inline, which compiler may ignore. So, please note this point for the interview that, it is UPTO the compiler to make a function inline or not.
inline int min(int a, int b)
{
return (a < b)? a : b;
}
int main( )
{
cout << "min (20,10): " << min(20,10) << endl;
cout << "min (0,200): " << min(0,200) << endl;
cout << "min (100,1010): " << min(100,1010) << endl;
return 0;
}
If the complier decides to make the function min as inline, then the above code will internally look as if it was written like
int main( )
{
cout << "min (20,10): " << ((20 < 10)? 20 : 10) << endl;
cout << "min (0,200): " << ((0 < 200)? 0 : 200) << endl;
cout << "min (100,1010): " << ((100 < 1010)? 100 : 1010) << endl;
 return 0;
}

C++ inline functions are special functions, for which the compiler replaces the function call with body/definition of function. Inline functions makes the program execute faster than the normal functions, since the overhead involved in saving current state to stack on the function call is avoided. By giving developer the control of making a function as inline, he can further optimize the code based on application logic. But actually, it's the compiler that decides whether to make a function inline or not regardless of it's declaration. Compiler may choose to make a non inline function inline and vice versa. Declaring a function as inline is in effect a request to the compiler to make it inline, which compiler may ignore. So, please note this point for the interview that, it is upto the compiler to make a function inline or not.
inline int min(int a, int b)
{
return (a < b)? a : b;
}
int main( )
{
cout << "min (20,10): " << min(20,10) << endl;
cout << "min (0,200): " << min(0,200) << endl;
cout << "min (100,1010): " << min(100,1010) << endl;
return 0;
}
If the complier decides to make the function min as inline, then the above code will internally look as if it was written like
int main( )
{
cout << "min (20,10): " << ((20 < 10)? 20 : 10) << endl;
cout << "min (0,200): " << ((0 < 200)? 0 : 200) << endl;
cout << "min (100,1010): " << ((100 < 1010)? 100 : 1010) << endl;
 return 0;
}

63.

What Is Implicit Conversion/coercion In C++?

Answer»

Implicit conversions are performed when a type (say T) is used in a CONTEXT where a COMPATIBLE type (Say F) is expected so that the type T will be promoted to type F.
short a = 2000 + 20;
In the above example, variable a will get AUTOMATICALLY promoted from short to INT. This is called implicit conversion/coercion in c++.

Implicit conversions are performed when a type (say T) is used in a context where a compatible type (Say F) is expected so that the type T will be promoted to type F.
short a = 2000 + 20;
In the above example, variable a will get automatically promoted from short to int. This is called implicit conversion/coercion in c++.

64.

In How Many Ways We Can Initialize An Int Variable In C++?

Answer»

In c++, variables can be INITIALIZED in TWO ways, the traditional C++ INITIALIZATION using "=" OPERATOR and second using the constructor notation.
Traditional C++ initilization
int i = 10;
variable i will get initialized to 10.
Using C++ constructor notation
int i(10);

In c++, variables can be initialized in two ways, the traditional C++ initialization using "=" operator and second using the constructor notation.
Traditional C++ initilization
int i = 10;
variable i will get initialized to 10.
Using C++ constructor notation
int i(10);

65.

What Is The Use Of Volatile Keyword In C++? Give An Example ?

Answer»

Most of the times compilers will do optimization to the code to speed up the PROGRAM. For example in the below code,
int a = 10;
while( a == 10){
// Do something
}
compiler may THINK that value of 'a' is not getting changed from the program and replace it with 'while(true)', which will result in an infinite loop. In actual scenario the value of 'a' may be getting updated from outside of the program.
Volatile keyword is used to tell compiler that the variable declared using volatile may be used from outside the CURRENT scope so that compiler wont apply any optimization. This matters only in CASE of multi-threaded applications.
In the above example if variable 'a' was declared using volatile, compiler will not optimize it. In shot, value of the volatile variables will be read from the memory location directly.

Most of the times compilers will do optimization to the code to speed up the program. For example in the below code,
int a = 10;
while( a == 10){
// Do something
}
compiler may think that value of 'a' is not getting changed from the program and replace it with 'while(true)', which will result in an infinite loop. In actual scenario the value of 'a' may be getting updated from outside of the program.
Volatile keyword is used to tell compiler that the variable declared using volatile may be used from outside the current scope so that compiler wont apply any optimization. This matters only in case of multi-threaded applications.
In the above example if variable 'a' was declared using volatile, compiler will not optimize it. In shot, value of the volatile variables will be read from the memory location directly.

66.

What Are The Basics Concepts Of Oop?

Answer»

Encapsulation : Encapsulation is the mechanism by which data and associated operations/methods are BOUND together and thus hide the data from outside world. It's also called data hiding. In c++, encapsulation achieved using the access specifiers (private, PUBLIC and protected). Data members will be declared as private (thus protecting from direct access from outside) and public methods will be provided to access these data. Consider the below class
class Person
{
private:
int age;
public:
int getAge(){
return age;
}
int setAge(int value){
if(value > 0){
age = value;
}
}
};

In the class Person, access to the data field age is protected by declaring it as private and providing public access methods. What would have happened if there was no access methods and the field age was public? Anybody who has a Person object can set an invalid value (negative or very large value) for the age field. So by encapsulation we can preventing direct access from outside, and thus have complete control, protection and integrity of the data.
Data abstraction : Data abstraction refers to hiding the internal implementations and show only the necessary DETAILS to the outside world. In C++ data abstraction is implemented using interfaces and abstract classes.
class Stack
{
public:
virtual void push(int)=0; 
virtual int pop()=0;
};
class MyStack : public Stack
{
private:
int arrayToHoldData[]; //Holds the data from stack
public:
void push(int) {
// implement push operation using array
}
int pop(){
// implement pop operation using array
}
};
In the above example, the outside world only need to KNOW about the Stack class and its push, pop operations. Internally stack can be implemented using arrays or linked lists or queues or anything that you can think of. This means, as long as the push and pop method performs the operations work as expected, you have the freedom to change the internal implementation with out affecting other applications that use your Stack class.
Inheritance : Inheritance allows one class to inherit PROPERTIES of another class. In other words, inheritance allows one class to be defined in terms of another class.
class SymmetricShape
{
public:
int getSize()
{
return size;
}
void setSize(int w)
{
size = w;
}
protected:
int size;
};
// Derived class
class Square: public SymmetricShape
{
public:
int getArea()

return (size * size); 
}
};

In the above example, class Square inherits the properties and methods of class SymmetricShape. Inheritance is the one of the very important concepts in C++/OOP. It helps to modularise the code, improve reusability and reduces tight coupling between components of the system.

Encapsulation : Encapsulation is the mechanism by which data and associated operations/methods are bound together and thus hide the data from outside world. It's also called data hiding. In c++, encapsulation achieved using the access specifiers (private, public and protected). Data members will be declared as private (thus protecting from direct access from outside) and public methods will be provided to access these data. Consider the below class
class Person
{
private:
int age;
public:
int getAge(){
return age;
}
int setAge(int value){
if(value > 0){
age = value;
}
}
};

In the class Person, access to the data field age is protected by declaring it as private and providing public access methods. What would have happened if there was no access methods and the field age was public? Anybody who has a Person object can set an invalid value (negative or very large value) for the age field. So by encapsulation we can preventing direct access from outside, and thus have complete control, protection and integrity of the data.
Data abstraction : Data abstraction refers to hiding the internal implementations and show only the necessary details to the outside world. In C++ data abstraction is implemented using interfaces and abstract classes.
class Stack
{
public:
virtual void push(int)=0; 
virtual int pop()=0;
};
class MyStack : public Stack
{
private:
int arrayToHoldData[]; //Holds the data from stack
public:
void push(int) {
// implement push operation using array
}
int pop(){
// implement pop operation using array
}
};
In the above example, the outside world only need to know about the Stack class and its push, pop operations. Internally stack can be implemented using arrays or linked lists or queues or anything that you can think of. This means, as long as the push and pop method performs the operations work as expected, you have the freedom to change the internal implementation with out affecting other applications that use your Stack class.
Inheritance : Inheritance allows one class to inherit properties of another class. In other words, inheritance allows one class to be defined in terms of another class.
class SymmetricShape
{
public:
int getSize()
{
return size;
}
void setSize(int w)
{
size = w;
}
protected:
int size;
};
// Derived class
class Square: public SymmetricShape
{
public:
int getArea()

return (size * size); 
}
};

In the above example, class Square inherits the properties and methods of class SymmetricShape. Inheritance is the one of the very important concepts in C++/OOP. It helps to modularise the code, improve reusability and reduces tight coupling between components of the system.

67.

What Do You Mean By C++ Access Specifiers?

Answer»

Access specifiers are used to define how the members (FUNCTIONS and variables) can be ACCESSED outside the class. There are THREE access specifiers defined which are public, private, and protected
private : Members declared as private are accessible only with in the same class and they cannot be accessed outside the class they are declared.
public : Members declared as public are accessible from any where.
protected : Members declared as protected can not be accessed from outside the class except a child class. This access specifier has significance in the context of INHERITANCE.

Access specifiers are used to define how the members (functions and variables) can be accessed outside the class. There are three access specifiers defined which are public, private, and protected
private : Members declared as private are accessible only with in the same class and they cannot be accessed outside the class they are declared.
public : Members declared as public are accessible from any where.
protected : Members declared as protected can not be accessed from outside the class except a child class. This access specifier has significance in the context of inheritance.

68.

What Is An Object/instance?

Answer»

Object is the instance of a class, which is concrete. From the above example, we can create instance of class Vehicle as given below Vehicle vehicleObject;
We can have DIFFERENT objects of the class Vehicle, for example we can have Vehicle objects with 2 TYRES, 4tyres ETC. Similarly different engine capacities as WELL.

Object is the instance of a class, which is concrete. From the above example, we can create instance of class Vehicle as given below Vehicle vehicleObject;
We can have different objects of the class Vehicle, for example we can have Vehicle objects with 2 tyres, 4tyres etc. Similarly different engine capacities as well.

69.

What Is A Class?

Answer»

Class defines a datatype, it's type definition of category of thing(s). But a class actually does not define the data, it just specifies the structure of data. To use them you need to create objects out of the class. Class can be CONSIDERED as a blueprint of a building, you can not stay INSIDE blueprint of building, you need to construct building(s) out of that plan. You can create any number of BUILDINGS from the blueprint, similarly you can create any number of objects from a class.
class VEHICLE
{
public:
int numberOfTyres;
double engineCapacity;
void DRIVE(){
// code to drive the car
}
};

Class defines a datatype, it's type definition of category of thing(s). But a class actually does not define the data, it just specifies the structure of data. To use them you need to create objects out of the class. Class can be considered as a blueprint of a building, you can not stay inside blueprint of building, you need to construct building(s) out of that plan. You can create any number of buildings from the blueprint, similarly you can create any number of objects from a class.
class Vehicle
{
public:
int numberOfTyres;
double engineCapacity;
void drive(){
// code to drive the car
}
};

70.

What Is Difference Between C And C++?

Answer»

C++ is Multi-Paradigm ( not pure OOP, supports both procedural and OBJECT oriented) while C follows procedural style programming.
In C data security is less, but in C++ you can use modifiers for your class members to make it inaccessible from outside.
C follows top-down approach ( solution is created in STEP by step manner, like each step is processed into details as we proceed ) but C++ follows a bottom-up approach ( where base elements are established first and are linked to make complex solutions ).
C++ supports function overloading while C does not support it.
C++ allows use of functions in structures, but C does not permit that.
C++ supports reference variables ( two variables can POINT to same MEMORY location ). C does not support this.
C does not have a BUILT in exception handling framework, though we can emulate it with other mechanism. C++ directly supports exception handling, which makes life of developer easy.

C++ is Multi-Paradigm ( not pure OOP, supports both procedural and object oriented) while C follows procedural style programming.
In C data security is less, but in C++ you can use modifiers for your class members to make it inaccessible from outside.
C follows top-down approach ( solution is created in step by step manner, like each step is processed into details as we proceed ) but C++ follows a bottom-up approach ( where base elements are established first and are linked to make complex solutions ).
C++ supports function overloading while C does not support it.
C++ allows use of functions in structures, but C does not permit that.
C++ supports reference variables ( two variables can point to same memory location ). C does not support this.
C does not have a built in exception handling framework, though we can emulate it with other mechanism. C++ directly supports exception handling, which makes life of developer easy.

71.

What Are The Data Structures Does Sga Contains?

Answer»

The SGA contains the following data structures:

The SGA contains the following data structures:

72.

What Are Database Buffers?

Answer»

It is the portion of the System GLOBAL AREA that holds copies of data blocks read from datafiles. All user PROCESSES are connected to the instance CONCURRENTLY and share access to the DATABASE buffer cache.

It is the portion of the System Global Area that holds copies of data blocks read from datafiles. All user processes are connected to the instance concurrently and share access to the database buffer cache.

73.

What Is Redo Log Buffer?

Answer»

The Redo Log Buffer is a circular buffer in the System GLOBAL Area that HOLDS information about changes made to the database. Redo entries CONTAIN the information to reconstruct, or redo, changes made to the database by INSERT, UPDATE, DELETE, CREATE, ALTER, or DROP operations. Redo entries are used for database recovery, if necessary.

The Redo Log Buffer is a circular buffer in the System Global Area that holds information about changes made to the database. Redo entries contain the information to reconstruct, or redo, changes made to the database by INSERT, UPDATE, DELETE, CREATE, ALTER, or DROP operations. Redo entries are used for database recovery, if necessary.

74.

What Is Shared Pool?

Answer»

The Shared Pool part of the System Global AREA contains the library cache, the dictionary cache, BUFFERS for parallel execution MESSAGES, and control structures.

The Shared Pool part of the System Global Area contains the library cache, the dictionary cache, buffers for parallel execution messages, and control structures.

75.

What Is Pga?

Answer»

A PGA i.e Program Global Area is a memory region that contains data and CONTROL information for a server process.It is a memory created by ORACLE when a server process is started and it is non shared. Access to it is exclusive to that server process and is READ and written by Oracle code.
The total PGA memory allocated by each server process associated to an Oracle instance is also known as AGGREGATED PGA memory allocated by the instance.

A PGA i.e Program Global Area is a memory region that contains data and control information for a server process.It is a memory created by Oracle when a server process is started and it is non shared. Access to it is exclusive to that server process and is read and written by Oracle code.
The total PGA memory allocated by each server process associated to an Oracle instance is also known as aggregated PGA memory allocated by the instance.

76.

What Are The Contents Of Pga?

Answer»
  • Content of the Program Global Area : The content of the Program Global Area memory varies, depending on whether the INSTANCE is running the shared server option. But in general, the PGA memory can be classified in the following manner.
  • Private SQL Area : A private SQL area contains information such as bind information and runtime memory structures. 
  • CURSORS and SQL AREAS : Session memory is the memory assigned to hold a session's variables (logon information) and other session information. The session memory is shared and not private for a shared server.
  • SQL WORK Areas: For complex queries such as decision-support queries, a big portion of the runtime area is dedicated to work areas allocated by memory- intensive operators.

77.

What Are Dedicated And Shared Server Process?

Answer»

Server Configurations:

  • Dedicated server PROCESS
  • Shared server process

The server process created on BEHALF of each USER process is CALLED a dedicated server process (or shadow process).Shared server architecture removes the need for a dedicated server process for each connection.
A dispatcher routes multiple incoming network session requests to a pool of shared server processes. 
An idle shared server process from a pool of shared server processes picks up a request from a common queue, which does mean a small number of shared servers can do the same AMOUNT of processing as many dedicated servers.

Server Configurations:

The server process created on behalf of each user process is called a dedicated server process (or shadow process).Shared server architecture removes the need for a dedicated server process for each connection.
A dispatcher routes multiple incoming network session requests to a pool of shared server processes. 
An idle shared server process from a pool of shared server processes picks up a request from a common queue, which does mean a small number of shared servers can do the same amount of processing as many dedicated servers.

78.

What Are Server Processes In Oracle?

Answer»

Oracle creates server PROCESSES to serve user processes requests, connected to the instance. In some situations, when the application and Oracle are on the same system, it is POSSIBLE to combine the user process and corresponding server process into one process for reducing system overhead. HOWEVER, when the application and Oracle operate on different COMPUTERS, a user process ALWAYS talks to Oracle through a separate server process.

Oracle creates server processes to serve user processes requests, connected to the instance. In some situations, when the application and Oracle are on the same system, it is possible to combine the user process and corresponding server process into one process for reducing system overhead. However, when the application and Oracle operate on different computers, a user process always talks to Oracle through a separate server process.

79.

What Server Processes Can Perform Created On Behalf Of Each User’s Application?

Answer»

Server processes can perform one or more of the FOLLOWING:

  • Parses and EXECUTES SQL statements fired through the application.
  • Reads data blocks from datafiles on DISK into the shared database buffers of the System GLOBAL Area, if the blocks are not already present in the System Global Area.
  • Return results in such a way that the application can process the INFORMATION.

Server processes can perform one or more of the following:

80.

What Are Background Processes In Oracle?

Answer»

In order to ENHANCE performance and accommodate MANY USERS, a multi-process Oracle SYSTEM USES some additional Oracle processes called background processes.

In order to enhance performance and accommodate many users, a multi-process Oracle system uses some additional Oracle processes called background processes.

81.

What Are The Processes Does Background Processes In An Oracle Includes?

Answer»

The background PROCESSES in an Oracle instance can include the following:

  • DATABASE Writer PROCESS (DBWn)
  • LOG Writer Process (LGWR)
  • Checkpoint Process (CKPT)
  • SYSTEM Monitor Process (SMON)
  • Process Monitor Process (PMON)
  • Recoverer Process (RECO)
  • Job Queue Processes
  • Achiever Processes (ARCn)
  • Queue Monitor Processes (QMNn)

The background processes in an Oracle instance can include the following:

82.

What Is Database Writer Process?

Answer»

It writes the contents of buffers to DATA files.The DBWn processes are responsible for WRITING MODIFIED buffers in the database buffer cache to disk.
However one database writer process (DBW0) is ENOUGH for most systems, you can configure other processes (DBW1 through DBW9 and DBWa through DBWj) to improve write performance if your system MANIPULATES data very much. These additional DBWn processes are not useful on uniprocessor systems.

It writes the contents of buffers to data files.The DBWn processes are responsible for writing modified buffers in the database buffer cache to disk.
However one database writer process (DBW0) is enough for most systems, you can configure other processes (DBW1 through DBW9 and DBWa through DBWj) to improve write performance if your system manipulates data very much. These additional DBWn processes are not useful on uniprocessor systems.

83.

What Is Log Writer Process?

Answer»

It is responsible for writing the redo log BUFFER to a redo log file on disk. Log Writer writes all redo entries which is copied into the buffer since the last time it wrote.
When a USER issues a commit statement, Log Writer issues a commit record in the redo log buffer and writes it to disk immediately, along with the TRANSACTION’s redo entries. The corresponding changes to data blocks are delayed until it is more EFFICIENT to write them. This is CALLED a fast commit mechanism.

It is responsible for writing the redo log buffer to a redo log file on disk. Log Writer writes all redo entries which is copied into the buffer since the last time it wrote.
When a user issues a commit statement, Log Writer issues a commit record in the redo log buffer and writes it to disk immediately, along with the transaction’s redo entries. The corresponding changes to data blocks are delayed until it is more efficient to write them. This is called a fast commit mechanism.

84.

What Is System Monitor Process?

Answer»

It performs RECOVERY, if necessary, at instance startup.
If any terminated transactions were skipped during instance recovery due to file-read or offline errors, System MONITOR Process recovers them when the tablespace or file is brought back online.
With Application CLUSTERS, the System Monitor process of ONE instance can perform instance recovery for a failed CPU or instance.

It performs recovery, if necessary, at instance startup.
If any terminated transactions were skipped during instance recovery due to file-read or offline errors, System Monitor Process recovers them when the tablespace or file is brought back online.
With Application Clusters, the System Monitor process of one instance can perform instance recovery for a failed CPU or instance.

85.

What Is Process Monitor Process?

Answer»

It performs PROCESS recovery when a user process fails. Process Monitor is responsible for CLEANING up the database BUFFER cache and reclaiming resources that the user process was USING. Process Monitor ALSO registers information about the instance and dispatcher processes with the network listener.

It performs process recovery when a user process fails. Process Monitor is responsible for cleaning up the database buffer cache and reclaiming resources that the user process was using. Process Monitor also registers information about the instance and dispatcher processes with the network listener.

86.

What Is Recoverer Process?

Answer»

The re-coverer PROCESS (RECO) is a background process used with the distributed database configuration that automatically RESOLVES failures. The RECO process of a node automatically connects to other databases INVOLVED in an in- doubt distributed TRANSACTION.

The re-coverer process (RECO) is a background process used with the distributed database configuration that automatically resolves failures. The RECO process of a node automatically connects to other databases involved in an in- doubt distributed transaction.

87.

What Are Job Queue Processes?

Answer»

Job queue processes are USED for PROCESSING BATCH. They RUN user jobs. They can be viewed as a scheduler service that can be used to schedule jobs LIKE PL/SQL statements or procedures on an Oracle instance.

Job queue processes are used for processing batch. They run user jobs. They can be viewed as a scheduler service that can be used to schedule jobs like PL/SQL statements or procedures on an Oracle instance.

88.

What Are Archiver Processes?

Answer»

It copies redo LOG FILES to a designated storage device after a log switch has occurred. ARCHIVER processes are there only when the database is in ARCHIVELOG mode, and automatic archiving is enabled. An Oracle instance can have up to 10 Archiver processes (ARC0 to ARC9). The LGWR process starts a new ARCn process whenever the current NUMBER of Archiver processes is INSUFFICIENT to handle the workload.

It copies redo log files to a designated storage device after a log switch has occurred. Archiver processes are there only when the database is in ARCHIVELOG mode, and automatic archiving is enabled. An Oracle instance can have up to 10 Archiver processes (ARC0 to ARC9). The LGWR process starts a new ARCn process whenever the current number of Archiver processes is insufficient to handle the workload.

89.

Explain Briefly Shared Server Architecture?

Answer»

This architecture removes the need for a dedicated server process for each connection. A dispatcher routes various incoming NETWORK session requests to a shared server processes pool. An idle shared server process from a shared pool of server processes CHOOSES a request from a common queue, which means a small number of shared servers can do the same amount of processing as many dedicated servers.
It is because of the amount of MEMORY required for each user is comparatively small, less memory and process management are required, and more users can be SUPPORTED.

This architecture removes the need for a dedicated server process for each connection. A dispatcher routes various incoming network session requests to a shared server processes pool. An idle shared server process from a shared pool of server processes chooses a request from a common queue, which means a small number of shared servers can do the same amount of processing as many dedicated servers.
It is because of the amount of memory required for each user is comparatively small, less memory and process management are required, and more users can be supported.

90.

What Is Concurrency In Oracle?

Answer»

The multiuser database management system's concern is how to control concurrency, which is the concurrent ACCESS of the same data by multiple USERS. Without SUFFICIENT concurrency controls, data could be updated or changed improperly, trading off with data integrity. To manage data concurrency is to make each user wait for a turn.
The goal of a database management system is to decrease the waiting time so it is either nonexistent or negligible to each user. The data manipulation language statements should proceed with as little intervention as possible, and destructive interactions among concurrent transactions should be prevented.
Destructive interaction is any interaction that updates data or alters UNDERLYING data structures INCORRECTLY. Neither performance nor data integrity can be sacrificed. Oracle solves such problems by using various types of locks and a multi-version consistency model.

The multiuser database management system's concern is how to control concurrency, which is the concurrent access of the same data by multiple users. Without sufficient concurrency controls, data could be updated or changed improperly, trading off with data integrity. To manage data concurrency is to make each user wait for a turn.
The goal of a database management system is to decrease the waiting time so it is either nonexistent or negligible to each user. The data manipulation language statements should proceed with as little intervention as possible, and destructive interactions among concurrent transactions should be prevented.
Destructive interaction is any interaction that updates data or alters underlying data structures incorrectly. Neither performance nor data integrity can be sacrificed. Oracle solves such problems by using various types of locks and a multi-version consistency model.

91.

Give An Example Of Synonyms?

Answer»

CREATE PUBLIC SYNONYM SALES FOR jward.sales_data;
After the public synonym is created, you can QUERY the table SALES_DATA with a SIMPLE SQL statement:
SELECT * FROM sales;

CREATE PUBLIC SYNONYM sales FOR jward.sales_data;
After the public synonym is created, you can query the table SALES_DATA with a simple SQL statement:
SELECT * FROM sales;

92.

What Is A Synonyms?

Answer»

A synonym is an alias for database OBJECTS such as table, view, materialized view, sequence, PROCEDURE, function, package. Because a synonym is simply an alias, it does not REQUIRE storage other than its DATA dictionary definition.

A synonym is an alias for database objects such as table, view, materialized view, sequence, procedure, function, package. Because a synonym is simply an alias, it does not require storage other than its data dictionary definition.

93.

List Out Indexing Scheme That Oracle Provides?

Answer»

ORACLE PROVIDES several indexing SCHEMES:

  • B-tree indexes
  • B-tree cluster indexes
  • HASH cluster indexes
  • Reverse key indexes
  • BITMAP indexes
  • Bitmap join indexes

Oracle provides several indexing schemes:

94.

What Is An Index?

Answer»

INDEXES are structures ASSOCIATED with tables and clusters. You can create indexes on one or more columns of a table to enhance the speed of SQL statement execution on that table. Just as the index in Oracle manual helps you to locate information faster than if there were no indexes. An Oracle index provides a faster access PATH to table data.

Indexes are structures associated with tables and clusters. You can create indexes on one or more columns of a table to enhance the speed of SQL statement execution on that table. Just as the index in Oracle manual helps you to locate information faster than if there were no indexes. An Oracle index provides a faster access path to table data.

95.

Explain Sequence Generator In Oracle?

Answer»

The SEQUENCE generator gives a sequential series of numbers.The sequence generator is especially useful for generating unique sequential numbers. Sequence numbers are Oracle integers of up to 38 digits defined in the database. A sequence definition provides information, such as:

  • The sequence NAME
  • ascending or DESCENDING sequence
  • The interval between numbers
  • Whether Oracle should cache sequence numbers in memory

Sequence numbers are generated independent of any tables. The same sequence generator can be used for many tables. Sequence number GENERATION can be used to produce primary keys for your data automatically. Oracle stores the definitions of all sequences for a particular database as rows in data dictionary table in the SYSTEM table- space.

The sequence generator gives a sequential series of numbers.The sequence generator is especially useful for generating unique sequential numbers. Sequence numbers are Oracle integers of up to 38 digits defined in the database. A sequence definition provides information, such as:

Sequence numbers are generated independent of any tables. The same sequence generator can be used for many tables. Sequence number generation can be used to produce primary keys for your data automatically. Oracle stores the definitions of all sequences for a particular database as rows in data dictionary table in the SYSTEM table- space.

96.

What Is A Dimension?

Answer»

A dimension is hierarchical relationships between pairs of columns or COLUMN SETS. Each value at the CHILD level is tied with ONE value at the PARENT level. A dimension is a container of logical relationships between columns and it does not contain any data.

A dimension is hierarchical relationships between pairs of columns or column sets. Each value at the child level is tied with one value at the parent level. A dimension is a container of logical relationships between columns and it does not contain any data.

97.

What Are Materialized Views?

Answer»

These are schema objects that are used to summarize, compute, replicate, and distribute data. They can be used in various environments for computation such as data WAREHOUSING, decision support, and distributed or mobile computing and it ALSO provides local access to data RATHER than ACCESSING from remote sites. In data WAREHOUSES, MVs are used to compute and store aggregated data.

These are schema objects that are used to summarize, compute, replicate, and distribute data. They can be used in various environments for computation such as data warehousing, decision support, and distributed or mobile computing and it also provides local access to data rather than accessing from remote sites. In data warehouses, MVs are used to compute and store aggregated data.

98.

How Views Are Used?

Answer»

It provides security by restricting access to a predetermined set of rows or columns of a table. It HIDES data complexity. It SIMPLIFIES statements for the user.
An example WOULD be the views, which allow users to select data from multiple tables without actually KNOWING how to perform a join.
It presents the data in a different PERSPECTIVE from that of the base table. It isolate applications from changes in definitions of base tables. It saves complex queries.

It provides security by restricting access to a predetermined set of rows or columns of a table. It hides data complexity. It simplifies statements for the user.
An example would be the views, which allow users to select data from multiple tables without actually knowing how to perform a join.
It presents the data in a different perspective from that of the base table. It isolate applications from changes in definitions of base tables. It saves complex queries.

99.

What Is A View?

Answer»

A view is a TAILORED PRESENTATION of the data contained in one or more TABLES or other views. A view is OUTPUT of a query and treats it as a table. Therefore, a view can be thought of as a stored query or a virtual table. A view is not ASSIGNED any storage space, nor does a view actually contain data.

A view is a tailored presentation of the data contained in one or more tables or other views. A view is output of a query and treats it as a table. Therefore, a view can be thought of as a stored query or a virtual table. A view is not assigned any storage space, nor does a view actually contain data.

100.

When And How Oracle Database Creates A Schema?

Answer»

Oracle DATABASE AUTOMATICALLY creates a SCHEMA when you CREATE a user.

Oracle Database automatically creates a schema when you create a user.