Capgemini Interview
Capgemini Interview
About Project
Project Overview
In my final year of IT engineering, I worked on a healthcare project focusing on PCOS and
breast cancer detection. Our team of four developed a website that utilized machine learning
algorithms to assist in early detection.
My Role
I was responsible for compiling the project, presenting it to our faculty, and writing the
project report. I also handled the technical explanation and demonstrated the functionality of
the website.
Technical Explanationsx6
PCOS Detection:
For the PCOS detection, we used the SVM (Support Vector Machine) algorithm. We input
various parameters like haemoglobin, blood pressure, and other clinical features. The system
compares this data with our trained dataset. If the data points match the patterns in the
dataset, the system shows the message ‘PCOS Detected,’ otherwise ‘No PCOS.’
Breast Cancer Detection:
For breast cancer detection, we used a Convolutional Neural Network (CNN) model. This
model was trained on medical images. The user uploads a breast scan image, and the system
predicts whether breast cancer is detected or not, showing a message ‘Breast Cancer
Detected’ or ‘Breast Cancer Not Detected.’
What is JAVA?
Java is a programming language that is primarily used for internet applications. It is one of
the most commonly used and is platform-independent, meaning you can develop it on one
machine and use it on another.
Can you explain what JVM is? Can you use this on any platform that you
choose?
JVM stands for Java Virtual Machine. You need the JVM to run any Java application.
Without it, the application fails and the user is unable to access it. This specification compiles
Java code to Bytecode, which is closer to the computer's code.
Can you explain the concept of AJAX and when it’s advantageous to use it
in your code?
AJAX (Asynchronous Javascript and XML) pulls data into a web page without needing to
refresh the entire page. AJAX is not a programming language. I typically use this when I
want to have an endlessly loading page for users.
Explain public static void main(String args[]) in Java.
Unlike any other programming language like C, C++, etc. In Java, we declared the main
function as a public static void main (String args[]). The meanings of the terms are mentioned
below:
1. public: the public is the access modifier responsible for mentioning who can access
the element or the method and what is the limit. It is responsible for making the main
function globally available. It is made public so that JVM can invoke it from outside
the class as it is not present in the current class.
2. static: static is a keyword used so that we can use the element without initiating the
class so to avoid the unnecessary allocation of the memory.
3. void: void is a keyword and is used to specify that a method doesn’t return anything.
As the main function doesn’t return anything we use void.
4. main: main represents that the function declared is the main function. It helps JVM to
identify that the declared function is the main function.
Non-Primitive Data Type: Reference Data types will contain a memory address of the
variable’s values because it is not able to directly store the values in the memory. Types of
Non-Primitive are mentioned below:
Strings
Array
Class
Object
Interface
7. Bitwise Operators
8. Shift Operators
9. instance of operator
What is an array in Java?
An array is a data structure that stores a collection of elements, typically of the same data
type, in a contiguous block of memory. Each element in an array can be accessed by its
index, starting from zero. Arrays are useful for storing multiple values under a single name
and can be used to organize data in a structured way.
An Array in Java is a data structure that is used to store a fixed-size sequence of elements of
the same type. Elements of an array can be accessed by their index, which starts from 0 and
goes up to a length of minus 1. Array declaration in Java is done with the help of square
brackets and size is also specified during the declaration.
Types of constructor
1) Default constructor
2) Parameterized constructor
3) Copy constructor
4) Private constructor
1. Constructors are only called when the object is created but other methods can be
called multiple times during the life of an object.
2. Constructors do not have a return type, whereas methods have a return type, which
can be void or any other type.
3. Constructors are used to setting up the initial state but methods are used to perform
specific actions.
Explain the difference between the static method and the instance method.
Instance method are methods which require an object of its class to be created before it can
be called. Static methods are the methods in Java that can be called without creating an object
of class. Static method is declared with static keyword.
A static method belongs to the class itself rather than to an instance (object) of the class. This
means it can be called without creating an instance of the class. An instance method belongs
to an object of the class. To call an instance method, you need to create an object of the class.
A static method can only access static variables (class variables) and other static methods. It
cannot directly access instance variables (object-specific variables) or instance methods
because it doesn’t belong to any instance. An instance method can access both instance
variables and static variables. It operates on the instance of the class it belongs to and can
modify both object-specific and class-level data.
How do you use the "this" keyword in Java?
The this keyword refers to the current object in a method or constructor. It is a reference
variable.
In java Extend keyword is used to perform inheritance. It provide code reusability. We can’t
access private member of class through inheritance.
Multiple Inheritance : Although Java does not support multiple inheritance through classes to
avoid ambiguity, it allows multiple inheritance using interfaces. A class can implement
multiple interfaces, thereby inheriting their behavior. (Java does not support multiple
inheritance (where a class can inherit from more than one class) to avoid ambiguity and
complexity. if two parent classes have a method with the same name, and a child class
inherits from both, Java wouldn’t know which method to call. This issue is often referred to
as the "Diamond Problem.)
1. Data Hiding: it is a way of restricting the access of our data members by hiding the
implementation details. Encapsulation also provides a way for data hiding. The user
will have no idea about the inner implementation of the class.
2. Increased Flexibility: We can make the variables of the class read-only or write-only
depending on our requirements.
3. Reusability: Encapsulation also improves the re-usability and is easy to change with
new requirements.
4. Testing code is easy: Code is made easy to test for unit testing.
What is Abstraction?
Abstraction is a process of hiding the complex implementation details from the user only the
highlighted set of services is provided to the user.
When two or multiple methods are in the same class with different parameters but the same
name.
Java: Slower due to running on the Java Virtual Machine (JVM), but still performs well
for most applications.
C++: Code needs to be recompiled for different platforms.
Java: Write once, run anywhere. Java code runs on any device with a JVM, making it
highly portable.
C++: More complex due to features like pointers and manual memory management.
Java: Strictly object-oriented and avoids multiple inheritance for cleaner code.
What is string?
A String is a sequence of characters (like letters, numbers, and symbols) used to represent
text.
Immutability:
Strings in Java are immutable, meaning once you create a String, you can’t change it. If you
modify a String, a new one is created instead.
What is Pointer?
A pointer in programming, especially in languages like C and C++, is a variable that stores
the memory address of another variable. It "points" to where a value is stored in memory,
rather than storing the value directly.
Structure: The for loop iterates over a sequence (like a list, string, range of numbers, etc.)
or runs for a fixed number of iterations.
Use: A while loop is generally used when the number of iterations isn’t known
beforehand. It continues to loop until a certain condition is false.
Structure: The while loop keeps executing the block of code as long as the condition is
True
What is Palindrome?
A palindrome is a word, number, phrase, or sequence that reads the same backward as
forward. Here's a simple example of checking if a string is a palindrome in Java:
SQL Commands
SQL commands are categorized into different types based on the tasks they perform. These
commands are broadly classified into the following categories:
DDL commands are used to define the structure of the database, including creating,
modifying, and deleting tables and other database objects.
DML commands are used to manipulate data in the database. These commands deal with
inserting, updating, deleting, and selecting data.
DCL commands are used to control access to data in a database. These commands help in
managing the security of the database.
GRANT, REVOKE.
SQL QUERIES