Hey guys, we hope you are doing well with your preprations. Here we have come up with some important interview questions to help you in your interview prepration. So, read this post till the end.
Previous Years Interview Questions Capgemini Freshers 2020
So guys, here below are the important questions. Go through well to get a clear understanding about the level of interview.
Question 1. Define Class in Java.
Answer. In Java, a class is a template used to create objects and define the data type. It acts as a building block for Java language-oriented systems.
Question 2. Explain JDK, JRE and JVM?
It stands for Java Development Kit.
It stands for Java Runtime Environment.
It stands for Java Virtual Machine.
It is the tool necessary to compile, document and package Java programs.
JRE refers to a runtime environment in which Java bytecode can be executed.
It is an abstract machine. It is a specification that provides a run-time environment in which Java bytecode can be executed.
It contains JRE + development tools.
It’s an implementation of the JVM which physically exists.
JVM follows three notations: Specification, Implementation, and Runtime Instance.
Question 3. What is a lambda expression in Python?
Answer. With the help of lambda expression, you can create an anonymous function. Unlike conventional functions, lambda functions occupy a single line of code. The basic syntax of a lambda function is –
lambda arguments: expression
An example of lambda function in Python data science is –
x = lambda a : a * 5
We obtain the output of 25.
Question 4. Name some of the latest Computer Processors
Answer. Intel Pentium Quad Core, Intel I3, I5 and I7 processor are some of the latest Computer Processor.
Question 5. What Is Multi-Threading?
Answer. Multi-threading is a programming concept used to run multiple tasks in a concurrent manner within a single program.
Question 6. Why Java is platform independent?
Answer. Java is called platform independent because of its byte codes which can run on any system irrespective of its underlying operating system.
Question 7. How will you create an identity matrix using numpy?
Answer. In order to create the identity matrix with numpy, we will use the identity() function. Numpy is imported as np
We will obtain the output as –
array([[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.]])
Question 8. How will you cope up with a customer, who complains about a brand new printer and system, and yet failing to get a proper print copy?
Answer. The first thing I will ask the customer, whether the system is properly connected with the printer. The next thing would be to check the Device Driver. Many times it happens that if you install an incorrect Device Driver, the print copy would not be clear.
Question 9. What Do JDK, JRE, and JVM Stand for?
Answer. JVM stands for Java Virtual Machine
- JRE stands for Java Runtime Environment
- JDK stands for Java Development Kit
Question 10. What are wrapper classes in Java?
Answer. Wrapper classes convert the Java primitives into the reference types (objects). Every primitive data type has a class dedicated to it. These are known as wrapper classes because they “wrap” the primitive data type into an object of that class. Refer to the below image which displays different primitive type, wrapper class and constructor argument.
Question 11. How do you create a 1-D array in numpy?
Answer. You can create a 1-D array in numpy as follows:
x = np.array([1,2,3,4])
Where numpy is imported as np
Question 12. What are the tools that will be helpful to you in identifying the problems and solving them?
Answer. Manuals, Knowledge, team-members and experience are the tools that will be helpful to trouble shoot the problem and solving them.
Question 13. How Do You Connect to a Database in Java?
Answer. The steps to connect to a database in Java are:
- Registering the driver class
- Creating connection
- Creating statement
- Executing queries
- Closing connection
Question 14. What is singleton class in Java and how can we make a class singleton?
Answer. Singleton class is a class whose only one instance can be created at any given time, in one JVM. A class can be made singleton by making its constructor private.
Question 15. Given two lists [1,2,3,4,5] and [6,7,8], you have to merge the list into a single dimension. How will you achieve this?
Answer. In order to merge the two lists into a single list, we will concatenate the two lists as follows –
list1 + list2
We will obtain the output as – [1, 2, 3, 4, 5, 6, 7, 8]
Question 16. What Are the Functions of JVM and JRE?
Answer. JVM provides a runtime environment for Java Byte Codes to be executed. JRE includes sets of files required by JVM during runtime.
Question 17. What is the difference between equals() and == in Java?
Answer. Equals() method is defined in Object class in Java and used for checking equality of two objects defined by business logic.
“==” or equality operator in Java is a binary operator provided by Java programming language and used to compare primitives and objects. public boolean equals(Object o) is the method provided by the Object class. The default implementation uses == operator to compare two objects. For example: method can be overridden like String class. equals() method is used to compare the values of two objects.
Question 18. What Is the Default Size of the Load Factor in Hashing a Based Collection?
Answer. The default size is 0.75, and the default capacity is computed as:
Initial capacity * Load factor
Question 19. Why pointers are not used in Java?
Answer. Java doesn’t use pointers because they are unsafe and increases the complexity of the program. Since, Java is known for its simplicity of code, adding the concept of pointers will be contradicting. Moreover, since JVM is responsible for implicit memory allocation, thus in order to avoid direct access to memory by the user, pointers are discouraged in Java.
Question 20. Consider a (5,6,7) shape array, what is the index (x,y,z) of the 50th element?
We have given some very important interview questions above. If you have still any queries then you can comment below or you can contact us. We here at Alpingi are always happy to help you.