Find Interview Questions for Top Companies
Ques:- There are n nuts and n bolts represented in two different arrays and a function is_fit(nut_i, bolt_j) which returns 0 if its perfectly fit, 1 if itÂ’s a tight fit and -1 if its loose fit. I was asked to arrange them so that every nut fits perfectly with the bolt in the same position (there is one nut for every bolt that fits perfectly). I suggested O(nlogn) solution
Ques:- Find the kth largest element in a BST. Well that was easy JWe discussed about projects and he asked reasons for leaving present company
Asked In :- Infovity,
Ques:- Basically it was from snakes and ladders game. There is n x n matrix and you are at starting position. What is the no. of ways to reach n-square position if your next move will be dependent on number on dice? You have been given information about ladders (there are no snakes J )
Asked In :- Techversant Infotech,
Ques:- Write an efficient program to count number tree structures that can be made using n number of nodes. Basically T(n)=summation (T(i) * T(n-i-1)). I used DP as there are a lot of sub-problems used again and again. O(n2)
Asked In :- Finacle Technologies,
Ques:- Implementation of Least Recently Used Cache. I started with O(n) solution using queue and ended up with O(1) solution using heap and doubly linked list
Ques:- There are billions and billions of stars and at any point of time you need to tell the closest million to earth. In what way I should take input for the stars and what all do I need to represent one. I used heap of a million size. Then he also asked about the different approach when I canÂ’t use so much of physical memory for heap
Asked In :- ATOS Syntel,
Ques:- There is a 12 km road and a contractor who is in-charge of repairing it. Contractor updates you about the work which is done in patches. Like “Road between 3.2 km to 7.9 km repaired ”, “Road between 1.21 km to 3.2 km repaired”. You have a manager who enquires about the longest continuous patch so far. It was a long discussion and I gave solution in O(nlogn) where n is the number of updates by the contractor
Ques:- Java (keywords explanation like static, final, finally),exception handling, inheritance
Asked In :-
Right Answer:
- **static**: A keyword used to indicate that a member (variable or method) belongs to the class rather than instances of the class. It can be accessed without creating an object of the class.

- **final**: A keyword used to declare constants, prevent method overriding, and prevent inheritance of classes. Once a variable is declared as final, its value cannot be changed.

- **finally**: A block used in exception handling that follows a try-catch block. It always executes regardless of whether an exception was thrown or caught, typically used for cleanup code.

- **Exception Handling**: A mechanism to handle runtime errors, allowing the program to continue execution. It uses try, catch, and finally blocks to manage exceptions.

- **Inheritance**: A fundamental OOP concept where a new class (subclass) inherits properties and behaviors (methods) from an existing class (superclass), promoting code reusability and establishing a hierarchical relationship.
Comments
DK BOSS Jul 21, 2021

Final is used to apply restrictions on class, method and variable. Final class can't be inherited, final method can't be overridden and final variable value can't be changed. Finally is used to place important code, it will be executed whether exception is handled or not.

Ques:- Hibernate 3.0 congiguration and mappring
Right Answer:
To configure Hibernate 3.0, you need to create a `hibernate.cfg.xml` file and define your database connection properties and mapping information. Here’s a basic example:

```xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/yourdb</property>
<property name="hibernate.connection.username">yourusername</property>
<property name="hibernate.connection.password">yourpassword</property>
<mapping resource="com/example/Your
Ques:- Spring MVC and framework 3.0
Asked In :- pragma edge inc, deltax,
Right Answer:
Spring MVC is a part of the Spring Framework that provides a model-view-controller architecture and ready components for developing flexible and loosely coupled web applications. Version 3.0 introduced features like annotations for configuration, improved REST support, and a more powerful expression language (SpEL).
Ques:- JSP, servlet, MVC Architecture
Right Answer:
JSP (JavaServer Pages) and Servlets are both Java technologies used for building web applications. Servlets are Java classes that handle requests and responses, while JSP allows for embedding Java code in HTML pages for dynamic content generation.

MVC (Model-View-Controller) is an architectural pattern that separates an application into three main components:

- **Model**: Represents the data and business logic.
- **View**: Represents the user interface and presentation layer.
- **Controller**: Handles user input and interacts with the model to update the view.

In a typical Java web application, Servlets often act as controllers, JSPs serve as views, and the model can be represented by JavaBeans or other data structures. This separation promotes organized code and easier maintenance.
Ques:- Spring Filter/Security
Right Answer:
In Spring, a filter is an object that performs filtering tasks on either the request to a resource, the response from a resource, or both. Filters can be used for tasks such as logging, authentication, and input validation. In the context of security, Spring Security provides filters that can intercept requests and apply security measures, such as authentication and authorization checks, before the request reaches the application. These filters are configured in the Spring Security filter chain.
Ques:- What the difference between Data Reader and Data sets ?
Right Answer:
A DataReader is a forward-only, read-only stream of data from a database, providing fast access to data but limited functionality. A DataSet, on the other hand, is an in-memory representation of data that can hold multiple tables and relationships, allowing for more complex data manipulation and navigation.
Comments
DK BOSS Jul 21, 2021

The DataSet class in ADO.Net operates in an entirely disconnected nature, while DataReader is a connection oriented service. DataSet is an in-memory representation of a collection of Database objects including related tables, constraints, and relationships among the tables. ... Dataset is used to hold tables with data.

Ques:- WHAT IS DIFFERENCE BETWEEN JAVA AND C++?
Right Answer:
Java is platform-independent and runs on the Java Virtual Machine (JVM), while C++ is platform-dependent and compiles directly to machine code. Java uses automatic garbage collection, whereas C++ requires manual memory management. Additionally, Java does not support multiple inheritance through classes (only through interfaces), while C++ does. Java is primarily used for web and mobile applications, while C++ is often used for system programming and applications requiring high performance.
Comments
DK BOSS Jul 14, 2021

Java is not supporting pointers but C++ have used pointers

Ques:- Struts, hibernate, java, java script, ajaz
Right Answer:
The question seems to be a list of technologies rather than a specific question. If you need to discuss or explain any of these technologies (Struts, Hibernate, Java, JavaScript, AJAX), please specify which one you would like to focus on.
Ques:- How do you determine the size of an object in Java?
Comments
DK BOSS Jul 21, 2021

One way to get an estimate of an object's size in Java is to use getObjectSize(Object) method of the Instrumentation interface introduced in Java 5. As we could see in Javadoc documentation, the method provides “implementation-specific approximation” of the specified object's size.

Ques:- Q: Why should developers use the Java Message Service?
Asked In :-


The Java skill section on takluu.com is designed for freshers, intermediate developers, and experienced professionals aiming to crack Java-based technical interviews with confidence. Java remains one of the most in-demand programming languages, and mastering it opens the door to countless opportunities in backend development, enterprise solutions, Android apps, and cloud-based platforms.

Our Java category covers everything from Core Java concepts like OOPs (Object-Oriented Programming), Data Types, Loops, and Exception Handling to Advanced Java topics including Collections Framework, Multithreading, JDBC, Servlets, JSP, Lambda Expressions, and Streams. We provide practical coding examples, real interview questions (with answers), and key concept explanations that interviewers commonly test.

Whether you’re applying for a role like Java Developer, Backend Engineer, or Full Stack Developer, this section ensures you understand the logic, syntax, and problem-solving approaches that matter in real-world interviews. You’ll also find scenario-based questions and discussions around design patterns, JVM internals, garbage collection, and performance tuning — areas often explored in senior-level interviews.

Each topic is structured to help you revise quickly and efficiently, with quizzes and mock interviews to assess your understanding. Our content is curated by experts who have worked with Java across different domains and keep the material aligned with current industry trends.

At Takluu, we believe in not just learning Java — but preparing to think in Java. Get ready to face interviews with clarity, confidence, and a deep understanding of what makes Java so powerful and reliable.

AmbitionBox Logo

What makes Takluu valuable for interview preparation?

1 Lakh+
Companies
6 Lakh+
Interview Questions
50K+
Job Profiles
20K+
Users