CAPGEMINI INTERVIEW QUESTION

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

CAPGEMINI INTERVIEW QUESTION

OOPs (Object Oriented Programming System)


Object means a real word entity such as pen, chair, table etc. Object-Oriented
Programming is a methodology or paradigm to design a program using classes and
objects. It simplifies the software development and maintenance by providing some
concepts:

o Object
o Class
o Inheritance
o Polymorphism
o Abstraction
o Encapsulation

Object
Any entity that has state and behavior is known as an object. For example: chair, pen,
table, keyboard, bike etc. It can be physical and logical.

Class
Collection of objects is called class. It is a logical entity.

Inheritance
When one object acquires all the properties and behaviours of parent object i.e.
known as inheritance. It provides code reusability. It is used to achieve runtime
polymorphism.

Polymorphism- Polymorphism is a technique in oops When one task is


performed by different ways i.e. known as polymorphism.Example - A person at
the same time can have different characteristic. Like a man at the same
time is a father, a husband, an employee. So the same person posses
different behaviour in different situations. This is called polymorphism..

Abstraction – Abstraction is a technique in oops which is use to Hiding internal


details and showing functionality is known as abstraction. For example: phone call,
we don't know the internal processing. In C++, we use abstract class and interface to
achieve abstraction.
(Abstraction means displaying only essential information and hiding the
details. Data abstraction refers to providing only essential information
about the data to the outside world, hiding the background details or
implementation.
Consider a real-life example of a man driving a car. The man only
knows that pressing the accelerators will increase the speed of the car
or applying brakes will stop the car but he does not know about how on
pressing accelerator the speed is actually increasing, he does not know
about the inner mechanism of the car or the implementation of
accelerator, brakes etc in the car. This is what abstraction is.

Encapsulation – Encapsulation is a technique in oops which is use to


Binding (or wrapping) code and data together into a single unit is known as
encapsulation. For example: capsule, it is wrapped with different medicines.

Advantage of OOPs over Procedure-oriented


programming language
1. OOPs makes development and maintenance easier where as in Procedure-
oriented programming language it is not easy to manage if code grows as project
size grows.
2. OOPs provide data hiding whereas in Procedure-oriented programming language
a global data can be accessed from anywhere.
3. OOPs provide ability to simulate real-world event much more effectively. We can
provide the solution of real word problem if we are using the Object-Oriented
Programming language.

1) What is SQL?
SQL stands for the Structured Query Language. It is the standard language used to
maintain the relational database and perform many different data manipulation
operations on the data. SQL was initially invented in 1970. It is a database language
used for database creation, deletion, fetching and modifying rows, etc. sometimes, it
is pronounced as 'sequel.' We can also use it to handle organized data comprised of
entities (variables) and relations between different entities of the data.
2) When SQL appeared?
SQL first appeared in 1974. It is one of the most used languages for maintaining the
relational database. In 1986, SQL became the standard of the American National
Standards Institute (ANSI) and ISO (International Organization for Standardization) in
1987.

3) What are the usages of SQL?


SQL is responsible for maintaining the relational data and the data structures present
in the database.

To execute queries against a database

To retrieve data from a database

o To inserts records in a database


o To updates records in a database
o To delete records from a database
o To create new databases
o To create new tables in a database
o To create views in a database
o To perform complex operations on the database.

What are the subsets of SQL?


The following are the four significant subsets of the SQL:

o Data definition language (DDL): It defines the data structure that consists of
commands like CREATE, ALTER, DROP, etc.
o Data manipulation language (DML): It is used to manipulate existing data in the
database. The commands in this category are SELECT, UPDATE, INSERT, etc.
o Data control language (DCL): It controls access to the data stored in the database.
The commands in this category include GRANT and REVOKE.
o Transaction Control Language (TCL): It is used to deal with the transaction
operations in the database. The commands in this category are COMMIT, ROLLBACK,
SET TRANSACTION, SAVEPOINT

13) What is the difference between a primary key and a


unique key?
The primary key and unique key both are essential constraints of the SQL. The main
difference among them is that the primary key identifies each record in the table. In
contrast, the unique key prevents duplicate entries in a column except for a NULL
value. The following comparison chart explains it more clearly:

Primary Key Unique Key

The primary key act as a unique identifier for each The unique key is also a unique identifier for records when the prim
record in the table. is not present in the table.

We cannot store NULL values in the primary key We can store NULL value in the unique key column, but only one N
column. allowed.

We cannot change or delete the primary key column We can modify the unique key column values.
values.

What is a Database?
A database is an organized collection of data that is structured into tables, rows,
columns, and indexes. It helps the user to find the relevant information frequently. It is
an electronic system that makes data access, data manipulation, data retrieval, data
storing, and data management very easy. Almost every organization uses the database
for storing the data due to its easily accessible and high operational ease. The database
provides perfect access to data and lets us perform required tasks.

The following are the common features of a database:

o Manages large amounts of data


o Accurate
o Easy to update
o Security
o Data integrity
o Easy to research data

15) What is meant by DBMS?


DBMS stands for Database Management System. It is a software program that
primarily functions as an interface between the database and the end-user. It provides
us the power such as managing the data, the database engine, and the database
schema to facilitate the organization and manipulation of data using a simple query in
almost no time. It is like a File Manager that manages data in a database rather than
saving it in file systems. Without the database management system, it would be far
more difficult for the user to access the database's data.

The following are the components of a DBMS:

o Software
o Data
o Procedures
o Database Languages
o Query Processor
o Database Manager
o Database Engine
o Reporting

16) What are the different types of database management


systems?
The database management systems can be categorized into several types. Some of the
important lists are given below:

o Hierarchical databases (DBMS)


o Network databases (IDMS)
o Relational databases (RDBMS
o Object-oriented databases
o Document databases (Document DB)
o Graph databases
o ER model databases
o NoSQL databases

17) What is RDBMS?


RDBMS stands for Relational Database Management System. It is a database
management system based on a relational model. It facilitates you to manipulate the
data stored in the tables by using relational operators. RDBMS stores the data into the
collection of tables and links those tables using the relational operators easily
whenever required. Examples of relational database management systems are
Microsoft Access, MySQL, SQL Server, Oracle database, etc.

18) What is Normalization in a Database?


Normalization is used to minimize redundancy and dependency by organizing fields
and table of a database.

There are some rules of database normalization, which is commonly known as Normal
From, and they are:

o First normal form(1NF)


o Second normal form(2NF)
o Third normal form(3NF)
o Boyce-Codd normal form(BCNF)

Using these steps, the redundancy, anomalies, inconsistency of the data in the
database can be removed.

What are the different types of SQL operators?


Operators are the special keywords or special characters reserved for performing
particular operations. They are also used in SQL queries. We can primarily use these
operators within the WHERE clause of SQL commands. It's a part of the command to
filters data based on the specified condition. The SQL operators can be categorized
into the following types:
o Arithmetic operators: These operators are used to perform mathematical operations
on numerical data. The categories of this operators are addition (+), subtraction (-),
multiplication (*), division (/), remainder/modulus (%), etc.
o Logical operators: These operators evaluate the expressions and return their results
in True or False. This operator includes ALL, AND, ANY, ISNULL, EXISTS, BETWEEN, IN,
LIKE, NOT, OR, UNIQUE.
o Comparison operators: These operators are used to perform comparisons of two
values and check whether they are the same or not. It includes equal to (=), not equal
to (!= or <>), less than (<), greater than (>), less than or equal to (<=), greater than or
equal to (>=), not less than (!<), not greater than (!>), etc.
o Bitwise operators: It is used to do bit manipulations between two expressions of
integer type. It first performs conversion of integers into binary bits and then applied
operators such as AND (& symbol), OR (|, ^), NOT (~), etc.
o Compound operators: These operators perform operations on a variable before
setting the variable's result to the operation's result. It includes Add equals (+=),
subtract equals (-=), multiply equals (*=), divide equals (/=), modulo equals (%=), etc.
o String operators: These operators are primarily used to perform concatenation and
pattern matching of strings. It includes + (String concatenation), += (String
concatenation assignment), % (Wildcard), [] (Character(s) matches), [^] (Character(s)
not to match), _ (Wildcard match one character), etc.

DATA STRUCTURE

What is Data Structure?


The data structure is a way that specifies how to organize and manipulate the data. It
also defines the relationship between them. Some examples of Data Structures are
arrays, Linked List, Stack, Queue, etc. Data Structures are the central part of many
computer science algorithms as they enable the programmers to handle the data in
an efficient way.

Types of Data Structures


There are two types of data structures:

o Primitive data structure


o Non-primitive data structure

Primitive Data structure

The primitive data structures are primitive data types. The int, char, float, double, and
pointer are the primitive data structures that can hold a single value.

Non-Primitive Data structure

The non-primitive data structure is divided into two types:

o Linear data structure- A data structure is called linear if all of its elements are arranged
in the sequential order. In linear data structures, the elements are stored in a non-
hierarchical way where each item has the successors and predecessors except the first
and last element.
o Non-linear data structure- The Non-linear data structure does not form a sequence i.e.
each item or element is connected with two or more other items in a non-linear
arrangement. The data elements are not arranged in the sequential structure.

Data structures can also be classified as:

o Static data structure: It is a type of data structure where the size is allocated at the
compile time. Therefore, the maximum size is fixed.
o Dynamic data structure: It is a type of data structure where the size is allocated at the
run time. Therefore, the maximum size is flexible.

Major Operations
The major or the common operations that can be performed on the data structures
are:

o Searching: We can search for any element in a data structure.


o Sorting: We can sort the elements of a data structure either in an ascending or
descending order.
o Insertion: We can also insert the new element in a data structure.
o Updation: We can also update the element, i.e., we can replace the element with
another element.
o Deletion: We can also perform the delete operation to remove the element from the

.
Advantages of Data structures
The following are the advantages of a data structure:

o Efficiency: If the choice of a data structure for implementing a particular ADT is proper,
it makes the program very efficient in terms of time and space.
o Reusability: The data structure provides reusability means that multiple client
programs can use the data structure.
o Abstraction: The data structure specified by an ADT also provides the level of
abstraction. The client cannot see the internal working of the data structure, so it does
not have to worry about the implementation part. The client can only see the interface.

Array- Arrays are defined as the collection of similar types of


data items stored at contiguous memory locations. It is the
simplest data structure in which each data element can be
randomly accessed by using its index number.

Properties of the Array


1. Each element is of same data type and carries a same size i.e. int = 4 bytes.
2. Elements of the array are stored at contiguous memory locations where the first
element is stored at the smallest memory location.
3. Elements of the array can be randomly accessed since we can calculate the
address of each element of the array with the given base address and the size
of data element.

Advantages of Array
o Array provides the single name for the group of variables of the same type
therefore, it is easy to remember the name of all the elements of an array.
o Traversing an array is a very simple process, we just need to increment the base
address of the array in order to visit each element one by one.
o Any element in the array can be directly accessed by using the index.
Which data structure is used to perform recursion?
Stack data structure is used in recursion due to its last in first out nature. Operating
system maintains the stack in order to save the iteration variables at each function call

What is a Stack?
Stack is an ordered list in which, insertion and deletion can be performed only at one
end that is called the top. It is a recursive data structure having pointer to its top
element. The stack is sometimes called as Last-In-First-Out (LIFO) list i.e. the element
which is inserted first in the stack will be deleted last from the stack

Write the stack overflow condition.


=Overflow occurs when top = Maxsize -1

Write the postfix form of the expression: (A + B) * (C - D)


=AB+CD-*

Define Linked List Data structure.


Linked List is the collection of randomly stored data objects called nodes. In Linked
List, each node is linked to its adjacent node through a pointer. A node contains two
fields, i.e. Data Field and Link Field.

What is doubly linked list?


The doubly linked list is a complex type of linked list in which a node contains a pointer
to the previous as well as the next node in the sequence. In a doubly linked list, a node
consists of three parts:

o node data
o pointer to the next node in sequence (next pointer)
o pointer to the previous node (previous pointer).
Define the queue data structure.
A queue can be defined as an ordered list which enables insert operations to be
performed at one end called REAR and delete operations to be performed at another
end called FRONT.

Q1. What is SDLC and what is it used for?


Answer:

SDLC (Software Development Life Cycle) is the process of design and

development of a product or service to be delivered to the customer that is

being followed for the software or systems projects in the Information

Technology or Hardware Organizations. SDLC framework is useful in

delivering the products or customers which ensures high quality and

efficient.

Q2. What are the different types of SDLC


methodologies?
Answer:

This is the basic SDLC Interview Questions asked in an interview. The

different models of SDLC are –

• Waterfall model

• Agile model
• Iterative or incremental model

• Spiral model

• RAD – Rapid Application Development model

• V-Shaped model

• Evolutionary prototype model

Q3. What are the different phases of the Waterfall


model?
Answer:

The different phases or steps involved in the waterfall model are

Requirements, Design, Execution, Testing, and Release. This model is of

sequential form and moves downward without any deviations. Every

phase will start only after the completion of the previous one. This process

was being followed for a long time and a traditional approach and has

been the best one since agile is adopted recently. This type of model does

not involve any kind of frequent requirement changes and needs follows

clear documentation from the beginning to the end. The phases and

activities are well planned.


Q4. What is CMM Maturity Level and what is its
importance?
Answer:

The CMM (Capability Maturity Model) is a standard or benchmark which is

used in the process of the development model in an organization to study

or know the maturity of the processes being followed in an organization.

The CMMI level is used to determine the quality or maturity of a software

development process in an organization i.e. either software or hardware. It

will be used to assess the organization on a scale of five different levels

and the processes being followed in the organization. The five different

levels are Initial, Repeatable, Defined, Capable (Managed) and Efficient

(Optimizing).

Q5. What are the drawbacks of Waterfall model?


Answer:

The drawbacks of the waterfall model are – It will not be ideal for larger

and complex projects when the requirements are not clearly documented

and not clear. It is not easier and also not possible to go back to any stage

or phase during the Software Development Process. No software product

or service will be delivered until the last stages or phases of the Software
Development Life Cycle which will be a form of risk. The process of

testing can also be completed only after the completion of the

Development phase and also cannot be carried out in parallel.

PALINDROME - A palindrome number is a number that is same after reverse. For example
121, 34543, 343, 131, 48984 are the palindrome numbers.

Difference Between Exception and Error

Basis of Exception Error


Comparison

Recoverable/ Exception can be recovered by using the try-catch block.


Irrecoverable An error cannot be recovered.

Type It can be classified into two categories i.e. checked and All errors in Java are unchecked.
unchecked.

Occurrence It occurs at compile time or run time. It occurs at run time.

Package It belongs to java.lang.Exception package. It belongs to java.lang.Error package.

Known or Only checked exceptions are known to the compiler. Errors will not be known to the
unknown compiler.

Causes It is mainly caused by the application itself. It is mostly caused by the environment
in which the application is running.

Example Checked Exceptions: SQLException, IOException Java.lang.StackOverFlow,


Unchecked java.lang.OutOfMemoryError
Exceptions: ArrayIndexOutOfBoundException,
NullPointerException, ArithmaticException
WHAT IS GARBAGE COLLECTION ?

Garbage collection is a form of automatic memory management. The garbage collector


attempts to reclaim garbage, or memory used by objects that will never be accessed or
mutated again by the application. ... Some garbage collection methods result in better locality
of reference than others

what is multithreaded programming ?

Multithreaded programming a process in which two or more parts of the same process
run simultaneously. ... Explanation: There are two types of multitasking: Process based
multitasking and Thread based multitasking.

What is JDBC explain?


Java Database Connectivity (JDBC) is an application programming interface (API)
for the programming language Java, which defines how a client may access a
database. ... It provides methods to query and update data in a database, and is
oriented toward relational databases.

EXPLAIN PROCESS OF JDBC?

Multithreaded programming a process in which two or more parts of the same process
run simultaneously. ... Explanation: There are two types of multitasking: Process based
multitasking and Thread based multitasking.

How many steps are there in JDBC?


There are 5 steps to connect any java application with the database using JDBC.
These steps are as follows: Register the Driver class. Create connection.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy