Infosys
30+ BigBasket Interview Questions and Answers
Q1. write a code to filter out loans with incomplete status using java 8 features.
Code to filter out loans with incomplete status using Java 8 features.
Use stream() method to convert the list of loans into a stream
Use filter() method to filter out loans with incomplete status
Use collect() method to collect the filtered loans into a new list
Q2. What is java and what is inheritance and what is oops concepts and what is method
Java is an object-oriented programming language. Inheritance is a mechanism to create new classes based on existing ones. OOPs is a programming paradigm. Method is a block of code that performs a specific task.
Java is a high-level, class-based, and object-oriented programming language.
Inheritance is a mechanism in which one class acquires the properties and behaviors of another class.
OOPs is a programming paradigm that focuses on objects and their interactions.
Method is a blo...read more
Q3. What is polymorphism in both overloading and overriding way?
Polymorphism is the ability of an object to take on multiple forms. It can be achieved through method overloading and overriding.
Method overloading is when multiple methods have the same name but different parameters. The compiler decides which method to call based on the arguments passed.
Method overriding is when a subclass provides its own implementation of a method that is already present in its parent class. The method signature remains the same.
Polymorphism allows for co...read more
Q4. Is java object oriented language or not ?
Yes, Java is an object-oriented language.
Java supports all the features of object-oriented programming such as encapsulation, inheritance, and polymorphism.
All code in Java is written inside classes, which are objects.
Java also has interfaces, which allow for multiple inheritance.
Example: Java's String class is an object that has methods and properties.
Example: Inheritance in Java allows a subclass to inherit properties and methods from a superclass.
Q5. Actuator,what is dependency injection, how to change imbeded server in spring boot,W.A.P permutation of string
Answering questions related to Actuator, Dependency Injection, changing embedded server in Spring Boot, and permutation of string.
Actuator is a Spring Boot feature that provides endpoints for monitoring and managing the application.
Dependency Injection is a design pattern that allows objects to be created with their dependencies injected from outside.
To change the embedded server in Spring Boot, you can exclude the default server dependency and add a new one.
Permutation of st...read more
Q6. What is java and what is oops concepts and what is inheritance and what is method
Java is an object-oriented programming language. OOPs concepts include inheritance, encapsulation, polymorphism, and abstraction.
Java is a high-level programming language that is platform-independent.
OOPs concepts are the foundation of Java programming.
Inheritance is a mechanism in which one class acquires the properties and behaviors of another class.
A method is a collection of statements that perform a specific task.
Examples of OOPs concepts in Java include encapsulation, p...read more
Q7. What is java and what is method and what is oops concepts and what is method
Java is an object-oriented programming language. Method is a block of code that performs a specific task. OOPs concepts are principles of object-oriented programming.
Java is a high-level programming language that is platform-independent.
Method is a block of code that performs a specific task and can be called multiple times.
OOPs concepts include inheritance, encapsulation, polymorphism, and abstraction.
Inheritance allows a class to inherit properties and methods from another ...read more
Q8. What is java and what is method and what is oops concepts
Java is a programming language. Method is a block of code that performs a specific task. OOPs is a programming paradigm.
Java is an object-oriented programming language used to develop applications and software.
A method is a block of code that performs a specific task and can be called by other parts of the program.
OOPs is a programming paradigm that focuses on objects and their interactions to solve problems.
OOPs concepts include encapsulation, inheritance, polymorphism, and ...read more
Q9. What would you rate yourself in java on the scale of 1 to 10?
I would rate myself as an 8 in Java.
I have extensive experience in Java programming and have successfully completed multiple projects using Java.
I am familiar with various Java frameworks and libraries.
I have a strong understanding of object-oriented programming principles in Java.
I am comfortable working with Java's core features and APIs.
I continuously strive to improve my Java skills through self-learning and staying updated with the latest developments in the Java ecosyst...read more
Q10. Explain Final,Finally,Finalize() in Java?
Final, Finally, Finalize() are keywords in Java used for different purposes.
Final is used to declare a variable as constant.
Finally is used to execute a block of code after try-catch block.
Finalize() is a method used for garbage collection.
Final can be used with classes, methods, and variables.
Finally block is always executed whether an exception is thrown or not.
Q11. What is the jQuery ajax GET request syntax?
The jQuery ajax GET request syntax is used to send an HTTP GET request to a server and retrieve data.
Use the $.ajax() method with the 'type' parameter set to 'GET'
Specify the URL of the server endpoint as the 'url' parameter
Handle the response using the 'success' callback function
Optionally, pass data to the server using the 'data' parameter
Q12. What is Functional Interface? What is Flat Map? What is Method Reference? What is stream API
Functional Interface is an interface with only one abstract method. Flat Map is used to flatten nested collections. Method Reference is a shorthand notation for lambda expressions. Stream API is used to process collections of objects.
Functional Interface is an interface with a single abstract method, such as Runnable or Comparator.
Flat Map is a method in Java that is used to flatten nested collections, like List
- > to List
. Method Reference is a shorthand notation for lambda exp...read more
Q13. Prerequisites: Payment gateway If your order fails and payment has been deducted, how do you manage this situation.
In case of order failure with payment deducted, refund the payment and investigate the issue.
Initiate refund process for the deducted payment
Investigate the reason for the order failure
Communicate with the customer about the issue and resolution
Ensure the payment gateway is functioning correctly to prevent future occurrences
Q14. What are @annotations in springboot? explain about @springBootApplication
Annotations in Spring Boot are used to provide metadata about the code. @SpringBootApplication is a meta-annotation that combines @Configuration, @EnableAutoConfiguration, and @ComponentScan.
Annotations in Spring Boot are used to simplify configuration and reduce boilerplate code.
@SpringBootApplication is a meta-annotation that enables the auto-configuration feature in Spring Boot.
It combines @Configuration, @EnableAutoConfiguration, and @ComponentScan annotations.
Example: @S...read more
Q15. WAJP to establish a JDBC connection and fetch results from a database and print those results.
Establish a JDBC connection and fetch results from a database using Java.
Import the necessary JDBC packages
Load and register the JDBC driver
Establish a connection to the database
Create a statement object
Execute a query to fetch results
Iterate over the result set and print the results
Close the result set, statement, and connection
Q16. What is static variables?
Static variables are variables that belong to the class itself, rather than an instance of the class.
Static variables are declared using the 'static' keyword.
They are shared among all instances of the class.
They can be accessed without creating an object of the class.
Static variables are initialized only once, at the start of the program.
They are useful for storing data that is common to all instances of a class.
Q17. How can you write custom exception in Java?
To write a custom exception in Java, create a new class that extends Exception or a subclass of Exception.
Create a new class that extends Exception or a subclass of Exception.
Add a constructor to the custom exception class to pass a message to the superclass constructor.
Throw the custom exception using the 'throw' keyword in your code.
Handle the custom exception using try-catch blocks or propagate it up the call stack.
Q18. What are functional Interfaces?
Functional interfaces are interfaces with only one abstract method, used for functional programming in Java.
Functional interfaces can have multiple default or static methods, but only one abstract method.
They are used in lambda expressions and method references for functional programming.
Examples include java.lang.Runnable, java.util.Comparator, and java.util.function.Function.
Q19. Write a program to find the missing element from the array.
Program to find missing element from array of strings
Iterate through the array and store elements in a HashSet
Iterate through another array and check if each element is present in the HashSet
Return the element that is not present in the HashSet
Q20. Print some thing java 8 lambda expression
Using lambda expressions in Java 8 to print a message
Use the lambda syntax (parameters) -> { body } to define the behavior
Example: () -> System.out.println("Hello, World!")
Q21. What are constructors and its types
Constructors are special methods used to initialize objects in Java.
Constructors have the same name as the class and do not have a return type.
Types of constructors include default constructor, parameterized constructor, and copy constructor.
Default constructor is provided by Java if no constructor is defined.
Parameterized constructor takes parameters to initialize an object with specific values.
Copy constructor creates a new object by copying the values of an existing object...read more
Q22. What is volatile?
Volatile keyword in Java is used to indicate that a variable's value will be modified by different threads.
Volatile keyword ensures visibility of changes made by one thread to other threads.
It prevents compiler optimizations that could reorder code and cause unexpected behavior in a multi-threaded environment.
Volatile variables are not cached in thread's local memory, but always read from main memory.
Example: 'volatile boolean flag = true;'
Q23. Q1)Strong OOPS concept.
Strong OOPS concept is essential for Java developers to write efficient and maintainable code.
Understanding of classes, objects, inheritance, polymorphism, and encapsulation
Ability to design and implement complex systems using OOPS principles
Experience with design patterns and SOLID principles
Knowledge of interfaces, abstract classes, and access modifiers
Familiarity with UML diagrams for modeling software systems
Q24. What is functional interface
A functional interface is an interface that contains only one abstract method and can be used as a lambda expression.
Functional interfaces can have multiple default or static methods, but only one abstract method.
Examples of functional interfaces in Java include Runnable, Callable, and ActionListener.
Functional interfaces are often used with lambda expressions to provide a concise way of implementing single abstract method interfaces.
Q25. what is daemon thread?
A daemon thread is a low priority thread that runs in the background and does not prevent the JVM from exiting when all user threads have finished.
Daemon threads are used for tasks that need to run continuously in the background, such as garbage collection.
They are automatically terminated by the JVM when all user threads have finished execution.
To create a daemon thread in Java, you can call the setDaemon(true) method on a Thread object before starting it.
Q26. get 2nd highest salary using stream
Use stream to get 2nd highest salary in Java
Sort the salaries in descending order using stream
Skip the first salary to get the second highest salary
Q27. what is Flat Map
FlatMap is a method in Java that transforms each element of a stream into a new stream and then concatenates all the streams into a single stream.
FlatMap is used to flatten nested collections or maps into a single collection.
It is commonly used in Java streams to process and transform data efficiently.
Example: List
- > nestedList = Arrays.asList(Arrays.asList(1, 2), Arrays.asList(3, 4)); nestedList.stream().flatMap(List::stream).forEach(System.out::println);
Q28. What is Stream API
Stream API is a feature in Java that allows processing collections of objects in a functional style.
Stream API provides a way to perform operations on collections like filter, map, reduce, etc.
It supports functional programming paradigms like lambda expressions and method references.
Example: List
names = Arrays.asList("Alice", "Bob", "Charlie"); Stream stream = names.stream();
Q29. Explain internal working of HashMap
HashMap is a data structure that stores key-value pairs and uses hashing to efficiently retrieve values.
HashMap internally uses an array of linked lists to store key-value pairs.
When a key-value pair is added, the key is hashed to find the index in the array where it will be stored.
If multiple keys hash to the same index, a linked list is used to handle collisions.
To retrieve a value, the key is hashed again to find the index and then the linked list is traversed to find the ...read more
Q30. what is jre explain
JRE stands for Java Runtime Environment, it is a software package that provides the necessary tools to run Java applications.
JRE includes Java Virtual Machine (JVM), class libraries, and other necessary files to run Java applications.
It does not contain development tools like compiler or debugger, which are included in JDK (Java Development Kit).
JRE is required to run Java applications on a computer, as it provides the environment for executing Java code.
Examples of JRE imple...read more
Q31. what is jdk explain
JDK stands for Java Development Kit, it is a software development kit used for developing Java applications.
JDK includes tools for developing, debugging, and monitoring Java applications.
It contains JRE (Java Runtime Environment) which is necessary for running Java programs.
JDK also includes a compiler, debugger, and other tools needed for Java development.
Examples of JDK versions include JDK 8, JDK 11, and JDK 15.
Q32. what is SDLC?
SDLC stands for Software Development Life Cycle, a process used to design, develop, and test software applications.
SDLC is a structured process that includes planning, designing, coding, testing, and deployment of software.
Common SDLC models include Waterfall, Agile, and DevOps.
Each phase of SDLC has specific goals and deliverables to ensure the quality and success of the software project.
Q33. Advantages of Spring Boot
Spring Boot simplifies the development of Java applications by providing a set of tools and conventions.
1. Rapid development: Spring Boot reduces the amount of boilerplate code needed, allowing developers to quickly build and deploy applications.
2. Opinionated defaults: Spring Boot provides sensible defaults for configuration, reducing the need for manual setup.
3. Embedded servers: Spring Boot includes embedded servers like Tomcat, Jetty, or Undertow, making it easy to run ap...read more
Q34. Hashmap vs hashtable
Hashtable is synchronized and does not allow null keys or values, while HashMap is not synchronized and allows null keys and values.
Hashtable is synchronized, while HashMap is not.
Hashtable does not allow null keys or values, while HashMap allows them.
Hashtable is thread-safe, while HashMap is not.
Top HR Questions asked in BigBasket
Interview Process at BigBasket
Top Java Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month