Biz4Solutions
10+ Nexa Interview Questions and Answers
Q1. If you have fix some production issue (bug) then you are deploying the code into various environment but how you will insure that the bug you have fix (remove or adding new code) not breaking your existing func...
read moreTo ensure that the bug fix does not break existing functionality, thorough testing and quality assurance processes should be followed.
Perform unit testing to verify that the bug fix works as expected and does not introduce new issues.
Conduct integration testing to ensure that the bug fix does not cause any conflicts or compatibility issues with other components.
Execute regression testing to validate that the bug fix does not impact previously working features.
Implement automa...read more
Q2. Write a Java function to accept a integer as a number and if this number is divisible by 3 then print 3 if this number is divisible by 5 then print 5 and if the number is divisible by 15 print 15. Input - Outpu...
read moreA Java function to determine if a given number is divisible by 3, 5, or 15.
Use the modulo operator (%) to check if the number is divisible by 3, 5, or 15.
If the number is divisible by 3, print 3.
If the number is divisible by 5, print 5.
If the number is divisible by 15, print 15.
If none of the above conditions are met, do not print anything.
Q3. You want some validation on server side without using a any third party library with only core java how you will do? (without if else loop)
Server-side validation without third-party library using core Java
Use regular expressions for pattern matching
Implement custom validation logic using core Java classes
Leverage Java's built-in exception handling for error handling
Q4. What query you should fired for getting only names from table?
To retrieve only names from a table, you can use a SELECT query with the appropriate column name.
Use the SELECT statement to specify the column(s) you want to retrieve.
Specify the name column in the SELECT clause to retrieve only names.
Use the FROM clause to specify the table from which you want to retrieve the names.
Q5. What Java and Spring Boot version you use in your project?
We use Java 11 and Spring Boot 2.4.2 in our project.
Java 11 is the latest LTS version of Java, providing improved performance and security.
Spring Boot 2.4.2 is a stable release with bug fixes and new features.
Using the latest versions ensures compatibility with the latest libraries and frameworks.
Java 11 example: java -version
Spring Boot 2.4.2 example: spring --version
Q6. String s1 = "hello"; String s2 = new String(s1); Where the s1 and s2 store (address location) What is Heap Stack memory?
s1 stores the string 'hello' in the stack memory, while s2 stores a new string object with the same value in the heap memory.
s1 is a reference variable that stores the memory address of the string 'hello' in the stack memory.
s2 is a reference variable that stores the memory address of a new string object created in the heap memory.
The string 'hello' is stored in the heap memory because it was created using the 'new' keyword.
Q7. Write a Java 8 Program - Assume you have 1 to 100 numbers and you want to filter out prime numbers from this print Composite numbers.
Java program to filter out prime numbers and print composite numbers from 1 to 100.
Iterate through numbers 1 to 100
Check if each number is prime or composite
Print the composite numbers
Q8. Tell the difference between @Component vs @Service in Spring Boot?
The @Component and @Service annotations in Spring Boot are used to define beans, but @Service is a specialization of @Component.
Both @Component and @Service annotations are used to define beans in Spring Boot.
@Service is a specialization of @Component and is used to indicate that a class is a service component.
The @Service annotation is typically used for classes that perform business logic or provide services.
The @Component annotation is a more generic annotation that can be...read more
Q9. Which java version you have use and same with SpringBoot?
I have used Java version 8 and SpringBoot version 2.4.2.
I have experience working with Java 8 and SpringBoot 2.4.2.
I am familiar with the features and functionalities of Java 8 and SpringBoot 2.4.2.
I have developed applications using Java 8 and SpringBoot 2.4.2.
I have utilized the latest enhancements and improvements provided by Java 8 and SpringBoot 2.4.2.
Q10. Write a java 8 program for make a flatten list from nested list. List.of(List.of(1,2,3), List.of(3,4,5) => List.of(1,2,3,3,4,5)
Java 8 program to flatten a nested list into a single list.
Use flatMap() method to flatten the nested list.
Convert the nested list to a stream and use flatMap() to flatten it.
Collect the flattened stream into a list using the Collectors.toList() method.
Q11. Which functional interface use mostly in java 8?
The functional interface mostly used in Java 8 is the java.util.function package.
The most commonly used functional interfaces in Java 8 are Predicate, Consumer, Function, and Supplier.
Predicate is used for boolean-valued functions of one argument.
Consumer is used for operations that take in one argument and return no result.
Function is used for functions that accept one argument and produce a result.
Supplier is used for functions that have no arguments but produce a result.
Ex...read more
Q12. Write a java 8 code for sort list of string base on second character in it.
Sorts a list of strings based on the second character in each string.
Use the `Comparator.comparing` method to specify the key for sorting.
Access the second character of a string using the `charAt` method.
Use the `Collections.sort` method to sort the list.
Q13. Write a Java 8 Stream for get average, minimum, maximum, from List of BigDecimal or Integer.
Java 8 Stream to get average, minimum, maximum from List of BigDecimal or Integer.
Use the stream() method on the List to create a Stream
Use the mapToDouble() method to convert the elements to double values
Use the average(), min(), and max() methods to get the desired values
Use the getAsDouble() method to retrieve the result as a double value
Q14. What is string constant pool in java?
The string constant pool is a special memory area in Java where string literals are stored.
String constant pool is a part of the heap memory.
It is used to optimize memory usage by reusing string literals.
String objects created using the same literal share the same memory location.
String constant pool can be accessed using the intern() method.
Example: String str1 = "Hello"; String str2 = "Hello"; str1 and str2 point to the same memory location.
Q15. How you rate yourself at java? 0 to 10
I would rate myself at java as an 8 out of 10.
I have extensive experience in Java programming.
I have successfully completed multiple Java projects.
I am familiar with various Java frameworks and libraries.
I continuously update my knowledge and skills in Java.
I am confident in my ability to solve complex problems using Java.
Q16. What is RestController in Spring Boot?
RestController is a class in Spring Boot that combines @Controller and @ResponseBody annotations to simplify RESTful web service development.
RestController is used to create RESTful web services in Spring Boot.
It is a specialized version of the @Controller annotation.
It combines the @Controller and @ResponseBody annotations.
The @ResponseBody annotation is used to bind the method return value to the web response body.
It eliminates the need for explicit JSON/XML serialization a...read more
Q17. Write a Consumer function for String using java 8
A Consumer function for String in Java 8.
Use the Consumer functional interface from the java.util.function package.
Implement the accept() method to perform the desired operation on the input string.
Example: Consumer
consumer = (str) -> System.out.println(str.toUpperCase());
Q18. What is Bean in Spring?
A bean in Spring is a Java object that is instantiated, assembled, and managed by the Spring IoC container.
Beans are the basic building blocks of a Spring application.
They are defined in the Spring configuration file or using annotations.
Beans are managed by the Spring IoC container, which handles their lifecycle and dependencies.
Beans can be singleton, prototype, or scoped.
Dependency injection is used to wire beans together.
Example: @Component annotation is used to define a ...read more
Q19. Flow of Spring Boot API
The flow of a Spring Boot API involves handling HTTP requests, routing them to appropriate controllers, processing the requests, and returning responses.
Spring Boot API receives HTTP requests from clients
The requests are routed to appropriate controllers based on the defined endpoints
Controllers process the requests by invoking appropriate services or repositories
Services handle the business logic and interact with repositories for data access
Repositories interact with the da...read more
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month