Premium Employer

Infosys

3.7
based on 37k Reviews
Filter interviews by

30+ BigBasket Interview Questions and Answers

Updated 11 Nov 2024
Popular Designations

Q1. write a code to filter out loans with incomplete status using java 8 features.

Ans.

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

View 4 more answers

Q2. What is java and what is inheritance and what is oops concepts and what is method

Ans.

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

View 1 answer

Q3. What is polymorphism in both overloading and overriding way?

Ans.

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

View 1 answer

Q4. Is java object oriented language or not ?

Ans.

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.

View 2 more answers
Discover BigBasket interview dos and don'ts from real experiences

Q5. Actuator,what is dependency injection, how to change imbeded server in spring boot,W.A.P permutation of string

Ans.

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

Add your answer

Q6. What is java and what is oops concepts and what is inheritance and what is method

Ans.

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

Add your answer
Are these interview questions helpful?

Q7. What is java and what is method and what is oops concepts and what is method

Ans.

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

Add your answer

Q8. What is java and what is method and what is oops concepts

Ans.

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

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. What would you rate yourself in java on the scale of 1 to 10?

Ans.

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

Add your answer

Q10. Explain Final,Finally,Finalize() in Java?

Ans.

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.

Add your answer

Q11. What is the jQuery ajax GET request syntax?

Ans.

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

Add your answer

Q12. What is Functional Interface? What is Flat Map? What is Method Reference? What is stream API

Ans.

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

Add your answer

Q13. Prerequisites: Payment gateway If your order fails and payment has been deducted, how do you manage this situation.

Ans.

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

Add your answer

Q14. What are @annotations in springboot? explain about @springBootApplication

Ans.

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

Add your answer

Q15. WAJP to establish a JDBC connection and fetch results from a database and print those results.

Ans.

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

Add your answer

Q16. What is static variables?

Ans.

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.

View 1 answer

Q17. How can you write custom exception in Java?

Ans.

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.

Add your answer

Q18. What are functional Interfaces?

Ans.

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.

Add your answer

Q19. Write a program to find the missing element from the array.

Ans.

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

Add your answer

Q20. Print some thing java 8 lambda expression

Ans.

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!")

Add your answer

Q21. What are constructors and its types

Ans.

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

Add your answer

Q22. What is volatile?

Ans.

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;'

Add your answer

Q23. Q1)Strong OOPS concept.

Ans.

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

Add your answer

Q24. What is functional interface

Ans.

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.

Add your answer

Q25. what is daemon thread?

Ans.

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.

Add your answer

Q26. get 2nd highest salary using stream

Ans.

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

Add your answer

Q27. what is Flat Map

Ans.

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);

Add your answer

Q28. What is Stream API

Ans.

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();

Add your answer

Q29. Explain internal working of HashMap

Ans.

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

Add your answer

Q30. what is jre explain

Ans.

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

Add your answer

Q31. what is jdk explain

Ans.

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.

Add your answer

Q32. what is SDLC?

Ans.

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.

Add your answer

Q33. Advantages of Spring Boot

Ans.

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

Add your answer

Q34. Hashmap vs hashtable

Ans.

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.

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at BigBasket

based on 86 interviews in the last 1 year
3 Interview rounds
Technical Round 1
Technical Round 2
HR Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Java Developer Interview Questions from Similar Companies

3.9
 • 32 Interview Questions
3.5
 • 23 Interview Questions
3.6
 • 18 Interview Questions
3.3
 • 11 Interview Questions
3.6
 • 10 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