Premium Employer

Xebia

3.4
based on 730 Reviews
Filter interviews by

Impact Guru Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. What are the classes needed to create a GET REST API?

Ans.

Classes needed to create a GET REST API

  • Controller class to handle the request

  • Service class to perform business logic

  • Repository class to interact with database

  • Model class to define data structure

  • RequestMapping annotation to map the URL

Add your answer

Q2. What is an Interface? What is default method in Interface?

Ans.

An interface is a blueprint of a class. Default method is a method in an interface with a default implementation.

  • An interface defines a set of methods that a class must implement

  • Default method provides a default implementation for a method in an interface

  • Default methods were introduced in Java 8

  • Default methods can be overridden by implementing classes

Add your answer

Q3. What is HashMap? Difference between List and HashMap?

Ans.

HashMap is a data structure that stores key-value pairs. List is a collection of ordered elements.

  • HashMap allows fast retrieval of values based on keys.

  • List maintains the order of elements and allows duplicates.

  • HashMap uses hashing to store and retrieve elements.

  • List uses indexing to access elements.

  • HashMap is not thread-safe while List is thread-safe.

  • Example: HashMap map = new HashMap<>(); map.put("apple", 1);

  • Example: List list = new ArrayList<>(); list.add("apple"); list.ad...read more

Add your answer

Q4. What class is used to connect with the Database?

Ans.

The class used to connect with the Database depends on the programming language and framework being used.

  • In Java, the class used is usually DriverManager or DataSource.

  • In Python, the class used is usually psycopg2 or mysql-connector.

  • In PHP, the class used is usually PDO or mysqli.

  • The specific class used may also depend on the type of database being used, such as MySQL, PostgreSQL, or MongoDB.

Add your answer
Discover Impact Guru interview dos and don'ts from real experiences

Q5. Create a new Thread and explain the ways to create Threads in Java

Ans.

Creating Threads in Java

  • Extending the Thread class and overriding the run() method

  • Implementing the Runnable interface and passing it to a Thread constructor

  • Using Executor framework to create and manage threads

  • Using Callable and Future interfaces to create threads that return values

Add your answer

Q6. How is an interface used?

Ans.

An interface is used to define a contract between two components in a system.

  • An interface defines a set of methods that a class must implement.

  • Interfaces are used to achieve abstraction and loose coupling.

  • Interfaces are used to create reusable code.

  • Interfaces are used to enable polymorphism.

  • Interfaces are used in many programming languages, including Java, C#, and TypeScript.

Add your answer

Q7. Explain MVC Lifecycle.

Ans.

MVC Lifecycle is the sequence of events that occur in the Model-View-Controller architectural pattern.

  • MVC stands for Model-View-Controller.

  • The lifecycle starts with a user request.

  • The controller receives the request and processes it.

  • The controller updates the model with the necessary data.

  • The view is then updated with the updated model data.

  • The updated view is sent back to the user as a response.

View 1 answer

Q8. Difference between HashMap and HashTree

Ans.

HashMap is a non-synchronized implementation of Map interface while HashTree is a synchronized implementation of Map interface.

  • HashMap is faster than HashTree as it is non-synchronized.

  • HashTree is thread-safe while HashMap is not.

  • HashMap allows one null key and multiple null values while HashTree does not allow null keys or values.

  • HashTree maintains the order of elements while HashMap does not.

  • HashMap is generally used in single-threaded applications while HashTree is used in...read more

Add your answer

Q9. Explain polymorphism in Java

Ans.

Polymorphism is the ability of an object to take on many forms.

  • Polymorphism allows objects of different classes to be treated as if they are objects of the same class.

  • It can be achieved through method overloading and method overriding.

  • Example: A parent class Animal can have multiple child classes like Dog, Cat, and Cow. All these child classes can have their own implementation of the method 'makeSound', which can be called using the parent class reference variable.

  • Polymorphis...read more

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Full Stack Developer Interview Questions from Similar Companies

3.3
 • 31 Interview Questions
3.7
 • 22 Interview Questions
4.0
 • 20 Interview Questions
4.1
 • 19 Interview Questions
3.5
 • 17 Interview Questions
4.3
 • 13 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter