# Capgemini Technical Interview Questions for Freshers

## Capgemini Technical Interview Questions and Answers 2022 ## Top 20 Capgemini Technical Interview Questions

#### Question 1: What is Encapsulation?

Encapsulation is a property of an entity that contains all secret information. The members of that class can only see the details that are hidden. The levels are public, protected, and private.

#### Question 2:- What is the C++ programming language?

C was a procedural language, which meant it lacked the concept of classes and objects.

C++ features –

• Object-Oriented
• Procedural
• Case Sensitive
• Generic

#### Question 3: Define an operator.

Operators are the fundamental concept of any programming language, and they are used to lay the groundwork for new programmers. Operators are basic symbols that help us perform logical and mathematical operations. Operators are tools or symbols in C and C++ that are used to perform mathematical operations such as arithmetic, logical, conditional, and bitwise operations.

The various types of operators available in C++ are as follows:

• Assignment Operator
• Compound Assignment Operator
• Arithmetic Operator
• Increment Operator, and so on.

#### Questions 4: Is Java 100% object oriented?

No, because Java supports primitive data types that aren’t objects.

#### Question 5: Write a program to check a Fibonacci series.

```#include

int main()
{
int n = 10;
int a = 0, b = 1;

// printing the 0th and 1st term
printf("%d, %d",a,b);

int nextTerm;

// printing the rest of the terms here
for(int i = 2; i < n; i++){
nextTerm = a + b;
a = b;
b = nextTerm;

printf("%d, ",nextTerm);
}

return 0;
}
```
```#include
using namespace std;

int main()
{
int num = 15;
int a = 0, b = 1;

// Here we are printing 0th and 1st terms
cout << a << ", " << b << ", ";

int nextTerm;

// printing the rest of the terms here
for(int i = 2; i < num; i++){
nextTerm = a + b;
a = b;
b = nextTerm;

cout << nextTerm << ", ";
}

return 0;
}
```
```public class Main
{
public static void main (String[]args)
{

int num = 15;
int a = 0, b = 1;

// Here we are printing 0th and 1st terms
System.out.print (a + " , " + b + " , ");

int nextTerm;

// printing the rest of the terms here
for (int i = 2; i < num; i++)
{
nextTerm = a + b;
a = b;
b = nextTerm;
System.out.print (nextTerm + " , ");
}

}
}
```
```num = int(input("Enter the Number:"))
n1, n2 = 0, 1
print("Fibonacci Series:", n1, n2, end=" ")
for i in range(2, num):
n3 = n1 + n2
n1 = n2
n2 = n3
print(n3, end=" ")

print()
```

#### Question 6: What is normalization in a database?

The process of analyzing relation schemas based on their functional dependencies is referred to as “normalization.” Normalization is the process of dividing data into multiple tables in order to reduce redundancy.

#### Question 7: Define ++e and e++.

++e is known as a pre-increment. Pre-increment means that the value will be increased by one before being assigned to a variable.

e++ is known as post-increment. Post-increment means that the value is increased by one after it has been assigned to a variable.

#### Question 8: What is the software scope?

A software project’s scope is a clearly defined boundary that encompasses all of the tasks involved in developing and delivering a software product. The software scope thoroughly describes both the functionalities and the objects that will be provided as part of the program. The scope of the product defines what it can and cannot do, as well as what the final product will and will not contain.

#### Questions 9: What are the access specifiers in Java?

Access specifiers come in four varieties. They are the following:

• Public: When a class or method is declared public, it can be accessed by any other class or method.
• Protected: If a class is marked as protected, it can only be accessed by another class in the same package or by a subclass of this class.
• Private: If a class or method is marked as private, it can only be accessed from within that class.
• Default: It is only accessible within the package. This is your standard access specifier..

#### Question 10: What is a constraint?

Constraints are the limitations on a given table’s data type. When creating or modifying a table statement, a constraint can be specified.

• NOT NULL.
• CHECK.
• DEFAULT.
• UNIQUE.
• PRIMARY KEY.
• FOREIGN KEY.

#### Question 11: How is a linked list different from an array?

Arrays are index-based data structures in which each element has a unique index.The data and references to the previous and next elements are stored in each node of a linked list.
An array’s size is predetermined.A linked list’s size is variable.
The index is used to randomly access array elements.The elements of a Linked List are accessed in the order that they were added to the list.
In arrays, operations like inserting and deleting are challenging.In a linked list, insertion and deletion are simple.
There’s no need for additional memory.In a linked list, extra memory space is required for storing the address of the next node
The location of an element is determined during the compilation process.The location of elements in a linked list is determined at runtime.

#### Question 12: Write a python code for swapping two variables without third variable.

```a=int(input(“Enter value : “))
b=int(input(“Enter value : “))

print(“Before swapping a :”,a)
print(“Before swapping b :”,b)
#logic to swap without using third variable
a=a+b
b=a-b
a=a-b

print(“After swapping a becomes :”,a)
print(“After swapping b becomes :”,b)```

#### Question 13: Define Version Control System(VCS)?

A version control system is a tool that keeps track of all changes made to a project and helps us determine whether all members of a team are working on the same thing. It keeps track of all activities performed, giving a developer the confidence to fix a bug, make changes, or run tests knowing that if something goes wrong, previous work can be restored at any time.

#### Question 14: What are the different levels of abstraction in the DBMS?

In a database management system (DBMS), there are three different levels of data abstraction.

These are some of them:

• Physical Level: This is the most basic level of data abstraction, describing how data is stored in a database.
• Logical level: The logical level of data abstraction specifies the type of data and the relationship between the data stored in the database.
• View level: The highest level of data abstraction is the view level, which displays/states only a portion of the database.

#### Question 15: Write the types of recursion in the C programming language.

Types of recursion:

• Direct Recursion
• Indirect Recursion
• Tree Recursion
• Linear Recursion
• Tail Recursion

#### Question 16: Define a constructor.

A constructor is a method that is called when an object is created to initialize its state.

The following are the constructor’s rules:

• The name of the constructor should be the same as the name of the class.
• The return type of a constructor must be null.

#### Question 17: What is the ACID property in a database?

The ACID property is used to ensure that data transactions are processed reliably in a database system.

• Atomicity: Each transaction is either all or nothing. It states that if one part of the transaction fails and the database state remains unchanged, the entire transaction fails.
• Consistency: Consistency ensures that all validation rules are followed by the data. A transaction, according to this, never leaves your database without its state being completed.
• Isolation: Concurrency control is the primary goal of providing isolation. This property guarantees that the concurrent property of execution is not met.
• Durability: This property states that once a transaction is committed, it remains committed regardless of the circumstances, including power outages, crashes, or errors.

#### Question 18: What is a unique key?

Unique Key: Each record in the database was given a unique key constraint. This gives the column (or group of columns) its own identity. A unique key is a set of one or more fields/columns in a database table that uniquely identifies a record. It’s similar to a primary key in that it can only take one null value and no duplicates.

#### Question 19: Write code to calculate frequency of characters in a string in C and C++

```#include

int main()
{
//Initializing variables.
char str;
int i;
int freq = {0};

//Accepting inputs.
printf("Enter the string: ");
gets(str);

//Calculating frequency of each character.
for(i = 0; str[i] != '\0'; i++)
{
freq[str[i]]++;
}

//Printing frequency of each character.
for(i = 0; i < 256; i++)
{
if(freq[i] != 0)
{
printf("The frequency of %c is %d\n", i, freq[i]);
}
}
return 0;
}
```
```#include
using namespace std;

int main()
{
//Initializing variables.
char str;
int i;
int freq = {0};

//Accepting inputs.
cout<<"Enter the string: ";
gets(str);

//Calculating frequency of each character.
for(i = 0; str[i] != '\0'; i++)
{
freq[str[i]]++;
}

//Printing frequency of each character.
for(i = 0; i < 256; i++)
{
if(freq[i] != 0)
{
cout<<"The frequency of "<
```

#### Question 20: What is the difference between Dataset.clone() and Dataset.copy()?

DataSet. Clone() copies only the DataSet object’s schema and returns a DataSet object with the same structure as the existing dataset object, including all the relations, constraints, and schemas. The data from the old one will not be copied to the new one.

DataSet.Copy() copies the entire code and structure of an existing DataSet object.

## Top 100 Puzzles ## Interview Prep. 