Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
This round had 2 coding questions where in I was first asked to explain my approach and then code the solution . After that , I was asked some more questions on OOPS and Java.



We cannot use the element at a given index twice.
Try to do this problem in O(N) time complexity.
Approach :
1) We can store the frequency of every element in the array in a hashmap.
2) We will loop over every index i, and check the frequency of (Target - ARR[i]) is the hashmap:
2.1) If (Target - ARR[i]) is equal to ARR[i], we will check if frequency of ARR[i] . If it is greater than 1 then we will decrease the frequency of ARR[i] by 2 and add a pair (ARR[i] , ARR[i]) to our answer.
2.2) Else, if the frequency of ARR[i] and Target - ARR[i] is greater than equal to 1 then we add pair (ARR[i], Target - ARR[i]) to our answer and decrease the frequency of both by 1.
3) If no valid pairs exist, we will return [[-1,-1]].
TC : O(N), where N = size of the array
SC : O(N)



1. The input string may contain the same characters, so there will also be the same permutations.
2. The order of permutation does not matter.
Approach :
We can find all the permutations by Backtracking.
1) Fix a character then swap all the rest of the remaining character with a fixed character.
2) Then find all permutations for all remaining characters by the recursive call.
3) The base case for the recursion will be when there is only one character left unprocessed.
TC : O(N*N!), where N = length of the String.
SC : O(N)
What do you know about JIT compiler?
JIT Compiler :
1) JIT stands for Just-In-Time and it is used for improving the performance during run time. It does the task of compiling parts of byte code having similar functionality at the same time thereby reducing the amount of compilation time for the code to run.
2) The compiler is nothing but a translator of source code to machine-executable code.
Working of JIT Compiler :
1) First, the Java source code (.java) conversion to byte code (.class) occurs with the help of the javac compiler.
2) Then, the .class files are loaded at run time by JVM and with the help of an interpreter, these are converted to machine understandable code.
3) JIT compiler is a part of JVM. When the JIT compiler is enabled, the JVM analyzes the method calls in the .class files and compiles them to get more efficient and native code. It also ensures that the prioritized method calls are optimized.
4) Once the above step is done, the JVM executes the optimized code directly instead of interpreting the code again. This increases the performance and speed of the execution.
Explain the use of final keyword in variable, method and class.
In Java, the final keyword is used as defining something as constant /final and represents the non-access modifier.
1) final variable :
1.1) When a variable is declared as final in Java, the value can’t be modified once it has been assigned.
1.2) If any value has not been assigned to that variable, then it can be assigned only by the constructor of the class.
2) final method :
2.1) A method declared as final cannot be overridden by its children's classes.
2.2) A constructor cannot be marked as final because whenever a class is inherited, the constructors are not inherited. Hence, marking it final doesn't make sense. Java throws compilation error saying - modifier final not allowed here
3) final class :
3.1) No classes can be inherited from the class declared as final. But that final class can extend other classes for its usage.
What do you mean by data encapsulation?
1) Data Encapsulation is an Object-Oriented Programming concept of hiding the data attributes and their behaviors in a single unit.
2) It helps developers to follow modularity while developing software by ensuring that each object is independent of other objects by having its own methods, attributes, and functionalities.
3) It is used for the security of the private properties of an object and hence serves the purpose of data hiding.
When can you use super keyword?
The super keyword is used to access hidden fields and overridden methods or attributes of the parent class.
Following are the cases when this keyword can be used :
1) Accessing data members of parent class when the member names of the class and its child subclasses are same.
2) To call the default and parameterized constructor of the parent class inside the child class.
3) Accessing the parent class methods when the child classes have overridden them.
In this round, the interviewer first started asking questions related to Java and Spring Boot and then he switched to Hibernate. The interview however ended with the interviewer asking me some basic queries related to SQL.
What is dependency Injection?
The process of injecting dependent bean objects into target bean objects is called dependency injection.
1) Setter Injection : The IOC container will inject the dependent bean object into the target bean object by calling the setter method.
2) Constructor Injection : The IOC container will inject the dependent bean object into the target bean object by calling the target bean constructor.
3) Field Injection : The IOC container will inject the dependent bean object into the target bean object by Reflection API.
What is the purpose of using @ComponentScan in the class files?
Spring Boot application scans all the beans and package declarations when the application initializes. You need to add the @ComponentScan annotation for your class file to scan your components added to your project.
What is the starter dependency of the Spring boot module?
Spring boot provides numbers of starter dependency, here are the most commonly used -
1) Data JPA starter.
2) Test Starter.
3) Security starter.
4) Web starter.
5) Mail starter.
6) Thymeleaf starter.
What are the concurrency strategies available in hibernate?
Concurrency strategies are the mediators responsible for storing and retrieving items from the cache. While enabling second-level cache, it is the responsibility of the developer to provide what strategy is to be implemented to decide for each persistent class and collection.
Following are the concurrency strategies that are used:
1) Transactional: This is used in cases of updating data that most likely causes stale data and this prevention is most critical to the application.
2) Read-Only: This is used when we don't want the data to be modified and can be used for reference data only.
3) Read-Write: Here, data is mostly read and is used when the prevention of stale data is of critical importance.
4) Non-strict-Read-Write: Using this strategy will ensure that there wouldn't be any consistency between the database and cache. This strategy can be used when the data can be modified and stale data is not of critical concern.
What is hibernate caching?
Hibernate caching is the strategy for improving the application performance by pooling objects in the cache so that the queries are executed faster. Hibernate caching is particularly useful when fetching the same data that is executed multiple times. Rather than hitting the database, we can just access the data from the cache. This results in reduced
throughput time of the application.
Types of Hibernate Caching
First Level Cache :
1) This level is enabled by default.
2) The first level cache resides in the hibernate session object.
3) Since it belongs to the session object, the scope of the data stored here will not be available to the entire application as an application can make use of multiple session objects.
Second Level Cache :
1) Second level cache resides in the SessionFactory object and due to this, the data is accessible by the entire application.
2) This is not available by default. It has to be enabled explicitly.
3) EH (Easy Hibernate) Cache, Swarm Cache, OS Cache, JBoss Cache are some example cache providers.
Given an Employee Table, find the Nth highest salary from it.
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
DECLARE M INT;
SET M=N-1;
RETURN (
SELECT DISTINCT Salary FROM Employee ORDER BY Salary DESC LIMIT M, 1
);
ENDWhat are different types of joins in SQL?
There are 4 types of SQL Joins :
1) Inner Join: This type of join is used to fetch the data among the tables which are common in both the tables.
2) Left Join: This returns all the rows from the table which is on the left side of the join but only the matching rows from the table which is on the right side of the join.
3) Right Join: This returns all the rows from the table which is on the right side of the join but only the matching rows from the table which is on the left side of the join.
4) Full Join: This returns the rows from all the tables on which the join condition has put and the rows which do not match hold null values.
This is a cultural fitment testing round. HR was very frank and asked standard questions. Then we discussed about my role.
Tell me something not there in your resume.
If you get this question, it's an opportunity to choose the most compelling information to share that is not obvious from your resume.
Example :
Strength -> I believe that my greatest strength is the ability to solve problems quickly and efficiently, which makes me unique from others.
Ability to handle Pressure -> I enjoy working under pressure because I believe it helps me grow and become more efficient.
Tip : Emphasize why you were inspired to apply for the job. You can also explain that you are willing to invest a great deal of energy if hired.
These are generally very open ended questions and are asked to test how quick wit a candidate is. So there is nothing to worry about if you have a good command over your communication skills and you are able to propagate your thoughts well to the interviewer.
Why should we hire you?
Tip 1 : The cross questioning can go intense some time, think before you speak.
Tip 2 : Be open minded and answer whatever you are thinking, in these rounds I feel it is important to have opinion.
Tip 3 : Context of questions can be switched, pay attention to the details. It is okay to ask questions in these round, like what are the projects currently the company is investing, which team you are mentoring. How all is the work environment etc.
Tip 4 : Since everybody in the interview panel is from a tech background, here too you can expect some technical questions. No coding in most of the cases but some discussions over the design can surely happen.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?