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 1 simple coding question related to Arrays which was followed by some more questions from Java.



a) Duplicate elements may be present.
b) If no such element is present return -1.
Input: Given a sequence of five numbers 2, 4, 5, 6, 8.
Output: 6
Explanation:
In the given sequence of numbers, number 8 is the largest element, followed by number 6 which is the second-largest element. Hence we return number 6 which is the second-largest element in the sequence.
Approach :
1) Initialize the first as 0(i.e, index of arr[0] element
2) Start traversing the array from array[1],
a) If the current element in array say arr[i] is greater
than first. Then update first and second as,
second = first
first = arr[i]
b) If the current element is in between first and second,
then update second to store the value of current variable as
second = arr[i]
3) Return the value stored in second.
TC : O(N)
SC : O(1)
What is Garbage collector in JAVA?
1) Garbage Collection in Java is a process by which the programs perform memory management automatically.
2) The Garbage Collector(GC) finds the unused objects and deletes them to reclaim the memory. I
3) In Java, dynamic memory allocation of objects is achieved using the new operator that uses some memory and the
memory remains allocated until there are references for the use of the object.
4) When there are no references to an object, it is assumed to be no longer needed, and the memory, occupied by
the object can be reclaimed.
5) There is no explicit need to destroy an object as Java handles the de-allocation automatically.
The technique that accomplishes this is known as Garbage Collection. Programs that do not de-allocate memory can
eventually crash when there is no memory left in the system to allocate. These programs are said to have memory
leaks.
Garbage collection in Java happens automatically during the lifetime of the program, eliminating the need to de-
allocate memory and thereby avoiding memory leaks.
In C language, it is the programmer’s responsibility to de-allocate memory allocated dynamically using free() function.
This is where Java memory management leads.
Why Java is platform independent and JVM platform dependent?
JVM is platform dependent because it takes java byte code and generates byte code for the current operating
system. So Java software is platform dependent but Java language is platform independent because different
operating system have different JVMs.
What do you understand by marker interfaces in Java?
Marker interfaces, also known as tagging interfaces are those interfaces that have no methods and constants defined
in them. They are there for helping the compiler and JVM to get run time-related information regarding the objects.
How would you differentiate between a String, StringBuffer, and a StringBuilder?
1) Storage area : In string, the String pool serves as the storage area. For StringBuilder and StringBuffer, heap
memory is the storage area.
2) Mutability : A String is immutable, whereas both the StringBuilder and StringBuffer are mutable.
3) Efficiency : It is quite slow to work with a String. However, StringBuilder is the fastest in performing operations. The
speed of a StringBuffer is more than a String and less than a StringBuilder. (For example appending a character is
fastest in StringBuilder and very slow in String because a new memory is required for the new String with appended
character.)
4) Thread-safe : In the case of a threaded environment, StringBuilder and StringBuffer are used whereas a String is
not used. However, StringBuilder is suitable for an environment with a single thread, and a StringBuffer is suitable for
multiple threads.
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 :
i) When a variable is declared as final in Java, the value can’t be modified once it has been assigned.
ii) 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 :
i) A method declared as final cannot be overridden by its children's classes.
ii) 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 :
i) No classes can be inherited from the class declared as final. But that final class can extend other classes for its
usage.
What are the advantages of Packages in Java?
There are various advantages of defining packages in Java.
i) Packages avoid the name clashes.
ii) The Package provides easier access control.
iii) We can also have the hidden classes that are not visible outside and used by the package.
iv) It is easier to locate the related classes.
Which among String or String Buffer should be preferred when there are lot of updates required to be done in the
data?
StringBuffer is mutable and dynamic in nature whereas String is immutable. Every updation / modification of String
creates a new String thereby overloading the string pool with unnecessary objects. Hence, in the cases of a lot of
updates, it is always preferred to use StringBuffer as it will reduce the overhead of the creation of multiple String
objects in the string pool.
This round was preety much mixed and had questions from DBMS, OOPS and MVC.
Explain the concept of ACID properties in DBMS?
ACID properties is the combination of Atomicity, Consistency, Isolation, and Durability properties. These properties
are very helpful in allowing a safe and secure way of sharing the data among multiple users.
1) Atomicity: This is based on the concept of “either all or nothing” which basically means that if any update occurs
inside the database then that update should either be available to all the others beyond user and application program
or it should not be available to anyone beyond the user and application program.
2) Consistency: This ensures that the consistency is maintained in the database before or after any transaction that
takes place inside the database.
3) Isolation: As the name itself suggests, this property states that each transaction that occurs is in isolation with
others i.e. a transaction which has started but not yet completed should be in isolation with others so that the other
transaction does not get impacted with this transaction.
4) Durability: This property states that the data should always be in a durable state i.e. any data which is in the
committed state should be available in the same state even if any failure or restart occurs in the system.
Explain different levels of data abstraction in a DBMS.
The process of hiding irrelevant details from users is known as data abstraction. Data abstraction can be divided into
3 levels :
1) Physical Level: it is the lowest level and is managed by DBMS. This level consists of data storage descriptions and
the details of this level are typically hidden from system admins, developers, and users.
2) Conceptual or Logical level: it is the level on which developers and system admins work and it determines what
data is stored in the database and what is the relationship between the data points.
3) External or View level: it is the level that describes only part of the database and hides the details of the table
schema and its physical storage from the users. The result of a query is an example of View level data abstraction. A
view is a virtual table created by selecting fields from one or more tables present in the database.
Explain the difference between the DELETE and TRUNCATE command in a DBMS.
DELETE command : This command is needed to delete rows from a table based on the condition provided by the
WHERE clause.
1) It deletes only the rows which are specified by the WHERE clause.
2) It can be rolled back if required.
3) It maintains a log to lock the row of the table before deleting it and hence it’s slow.
TRUNCATE command : this command is needed to remove complete data from a table in a database. It is like a
DELETE command which has no WHERE clause.
1) It removes complete data from a table in a database.
2) It can be rolled back even if required. ( truncate can be rolled back in some databases depending on their version
but it can be tricky and can lead to data loss).
3) It doesn’t maintain a log and deletes the whole table at once and hence it’s fast.
What are Constraints in SQL?
Constraints are used to specify the rules concerning data in the table. It can be applied for single or multiple fields in
an SQL table during the creation of the table or after creating using the ALTER TABLE command. The constraints are :
1) NOT NULL - Restricts NULL value from being inserted into a column.
2) CHECK - Verifies that all values in a field satisfy a condition.
3) DEFAULT - Automatically assigns a default value if no value has been specified for the field.
4) UNIQUE - Ensures unique values to be inserted into the field.
5) INDEX - Indexes a field providing faster retrieval of records.
6) PRIMARY KEY - Uniquely identifies each record in a table.
7) FOREIGN KEY - Ensures referential integrity for a record in another table.
What is the difference between Clustered and Non-clustered index?
1) Clustered index modifies the way records are stored in a database based on the indexed column. A non-clustered
index creates a separate entity within the table which references the original table.
2) Clustered index is used for easy and speedy retrieval of data from the database, whereas, fetching records from
the non-clustered index is relatively slower.
3) In SQL, a table can have a single clustered index whereas it can have multiple non-clustered indexes.
How many types of inheritance are present?
Various types of inheritance are listed below:
1) Single Inheritance : Single child class inherits characteristics of the single-parent class.
2) Multiple Inheritance : One class inherits features of more than one base class and is not supported in Java, but the class can implement more than one interface.
3) Multilevel Inheritance : A class can inherit from a derived class making it a base class for a new class, for example, a Child inherits behavior from his father, and the father has inherited characteristics from his father.
4) Hierarchical Inheritance : One class is inherited by multiple subclasses.
5) Hybrid Inheritance : This is a combination of single and multiple inheritances.
What is the difference between extends and implements?
Both extends and implements keyword are used for inheritance but in different ways.
The differences between Extends and Implements keywords in Java are explained below :
Extends :
1) A class can extend another class (child extending parent by inheriting his characteristics). Interface as well inherit (using keyword extends) another interface.
2) Sub class extending super class may not override all of the super class methods.
3) Class can only extend a single super class.
4) Interface can extend more than one interfaces.
5) Syntax : class Child extends class Parent
Implements :
1) A class can implement an interface.
2) Class implementing interface has to implement all the methods of the interface.
3) Class can implement any number of interfaces.
4) Interface cannot implement any other interface.
5) Syntax: class Hybrid implements Rose
When do you use the super keyword?
Super is a Java keyword used to identify or refer parent (base) class.
1) We can use super to access super class constructor and call methods of the super class.
2) When method names are the same in super class and sub class, to refer super class, the super keyword is used.
3) To access the same name data members of parent class when they are present in parent and child class.
4) Super can be used to make an explicit call to no-arg and parameterized constructors of the parent class.
5) Parent class method access can be done using super, when child class has method overridden.
Define the concept of Filters in MVC?
There are situations where I want to implement some logic either prior to the execution of the action method or right
after it. In that scenario, the Action Filters are used. Filters are used to determine the logic needed for executing
before or after the action method gets executed. Action methods make use of the action filters as an attribute.
Different types of MVC action filter are :
1) Action filter (that implements the IActionFilter)
2) Exception filter (that implements the IExceptionFilter attribute)
3) Authorization filter (that implements the IAuthorizationFilter)
4) Result filter (that implements the IResultFilter)
What is Spring MVC?
1) The Spring MVC or Spring Web MVC can be defined as a framework that provides a “Model View Controller”
(MVC) architecture in the application as well as ready-components implemented for developing adjustable and
adaptable web applications.
2) It is actually a Java-based framework intended to build web applications. It works on the Model-View-Controller
design approach.
3) This framework also makes use of all the elementary traits of a core Spring Framework such as dependency
injection, light-weight, integration with other frameworks, inversion of control, etc. Spring MVC has a dignified
resolution for implementing MVC in Spring Framework with the use of DispatcherServlet.
Explain in brief the role of different MVC components?
The different MVC components have the following roles -
1) Presentation: This component takes care of the visual representation of a particular abstraction in the application.
2) Control: This component takes care of the consistency and uniformity between the abstraction within the system
along with their presentation to the user. It is also responsible for communicating with all other controls within the
MVC system.
3) Abstraction: This component deals with the functionality of the business domain within the application.
How routing is done in the MVC pattern?
There is a group of routes called the RouteCollection, which consists of registered routes in the application. The
RegisterRoutes method records the routes in this collection. A route defines a URL pattern and a handler to use if the
request matches the pattern.
The first parameter to the MapRoute method is the name of the route. The second parameter will be the pattern to
which the URL matches. The third parameter might be the default values for the placeholders if they are not
determined.
This was a Technical Cum HR round where I was first asked some basic Java related concepts and then we discussed
about my expectations from the company , learnings and growth in the forthcomig years. I would suggest be honest and
try to communicate your thoughts properly in these type of rounds to maximise your chances of getting selected.
Why should we hire you ?
What are your expectations from the company?
How was your overall interview experience?
What are your strengths and weakness according to you?
Where do you see yourself in the next 5 years?
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.

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