Add office photos
Employer?
Claim Account for FREE

Volkswagen

4.2
based on 785 Reviews
Filter interviews by

Physicswallah Interview Questions and Answers

Updated 15 Jun 2024

Q1. Coding question find the first non repeting char in the string using java 8.

Ans.

Using Java 8, find the first non-repeating character in a string.

  • Use Java 8 streams to convert the string to a character array.

  • Use Collectors.groupingBy to group characters by count.

  • Filter out characters with count > 1 and find the first character with count 1.

Add your answer

Q2. Find the sum of all even numbers without using inbuild methods using stream api.

Ans.

Sum of all even numbers without using inbuild methods using stream api

  • Create an array of numbers

  • Use stream to filter out even numbers

  • Use stream to sum up the filtered even numbers

Add your answer

Q3. Intermediate and terminal operators in Java?

Ans.

Intermediate and terminal operators are used in Java streams to perform intermediate and terminal operations on elements.

  • Intermediate operators are used to transform, filter, or manipulate elements in a stream before passing them to the next operation. Examples include map(), filter(), and sorted().

  • Terminal operators are used to trigger the processing of elements in a stream and produce a result. Examples include forEach(), collect(), and reduce().

Add your answer

Q4. Exception handling in the spiring Boot?

Ans.

Exception handling in Spring Boot allows developers to gracefully handle errors and provide meaningful responses to users.

  • Use @ControllerAdvice to handle exceptions globally

  • Use @ExceptionHandler to handle specific exceptions

  • Return custom error messages or responses to users

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

Q5. Various methods in the RestApi?

Ans.

Various methods in RestApi include GET, POST, PUT, DELETE.

  • GET - Used to retrieve data from the server. Example: GET /users

  • POST - Used to send data to the server to create a new resource. Example: POST /users

  • PUT - Used to update an existing resource on the server. Example: PUT /users/1

  • DELETE - Used to delete a resource on the server. Example: DELETE /users/1

Add your answer

Q6. Difference between IOC and DI?

Ans.

IOC is a design pattern where control is inverted, while DI is a technique to achieve IOC by injecting dependencies into a class.

  • IOC stands for Inversion of Control, where the control of flow is inverted from the traditional top-down approach.

  • DI stands for Dependency Injection, a technique used to implement IOC by injecting dependencies into a class from an external source.

  • IOC is a design principle, while DI is a technique to achieve IOC.

  • Example: In IOC, a framework controls ...read more

Add your answer

Q7. @RequestBody annotation?

Ans.

Annotation used in Spring framework to bind the HTTP request body to a method parameter.

  • Used in Spring MVC to indicate that a method parameter should be bound to the body of the web request.

  • Can be used with various data types like JSON, XML, etc.

  • Helps in simplifying the process of handling request data in Spring applications.

Add your answer

Q8. type casting in the Java?

Ans.

Type casting in Java is the process of converting one data type into another.

  • Type casting can be done implicitly or explicitly in Java.

  • Implicit type casting is done when a smaller data type is converted to a larger data type, while explicit type casting is done when a larger data type is converted to a smaller data type.

  • Example of implicit type casting: int num = 10; double result = num;

  • Example of explicit type casting: double num = 10.5; int result = (int) num;

Add your answer

Q9. Functional interface in java?

Ans.

Functional interface in Java is an interface with only one abstract method. It can have multiple default or static methods.

  • Functional interfaces can be annotated with @FunctionalInterface to ensure they have only one abstract method.

  • Examples of functional interfaces in Java include Runnable, Callable, and ActionListener.

  • Lambda expressions can be used to implement functional interfaces concisely.

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

Interview Process at Physicswallah

based on 1 interviews
Interview experience
4.0
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Engineer Interview Questions from Similar Companies

3.9
 • 26 Interview Questions
3.4
 • 25 Interview Questions
4.1
 • 16 Interview Questions
3.8
 • 15 Interview Questions
3.3
 • 10 Interview Questions
3.5
 • 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

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