200+ Java Fullstack developer questions

  1. Write Fibonacci series programming and explain logic
  2. how auto wiring works in spring
  3. write a program for dependency injection
  4. how security is implemented in your project.
  5. difference between filter and map in java streams.
  6. Explain about your current project.
  7. How to read the file and display total count of each word.
  8. How angular Makes calls to spring boot
  9. What is spring profile
  10. There is a list with emp objects with duplicate name, age attributes. How to retrieve uniques names.
  11. What Technologies used in last project.
  12. Abstract class and encapsulation.
  13. What is HashMap? how it works.
  14. what is inter thread communication
  15. what ArrayList ? extends object and ArrayList? super object means
  16. what is splice and slice
  17. difference between == and ===
  18. Write a Java 8 program to get the sum of all numbers present in a list?
  19. what FlatMap?
  20. write a prog ..how to sort emp obj in java8
  21. Given the list of employees, find the employee with name “R”.
  22. Angular Routing process
  23. Difference Between constructor vs ngOnInit in Angular
  24. how to find which datatype is created in JavaScript
  25. what is id in CSS
  26. how to create a singleton object
  27. what is static method, static block and static class
  28. what will happen if we add final to a method
  29. what is @path and path param, path variable
  30. what is multi catch block
  31. what is subquery and when we use it
  32. how to use service in angular
  33. difference between @Input and @Output in angular
  34. what is event emitter
  35. what is @beanpropertyrowmapper
  36. Handle cross horizon resource sharing-angular, how can u candle hash code, equal
  37. sql query, highest salary- department wise
  38. Routing in Angular
  39. import and export in ngModule
  40. what is ngModule
  41. directives and use of them in angular
  42. routes in angular
  43. what is children attribute in routes in angular
  44. Hibernate OneToMany and ManyToOneMapping example
  45. How to return a single user if userId passed or list of users if userId not passed in JPA
  46. Micro services communication
  47. Autorization and authentication process in current project
  48. String reverse program
  49. Spring JPA Example
  50. Factory design pattern
  51. Singleton Design pattern and real time usage and implementation
  52. How to prevent singleton object from clone?
  53. Synchronous and asynchronous requests, how to consume angular http request and services
  54. Springcloud config
  55. publishing a service in spring cloud
  56. diff b\w rest and soap
  57. what is the new in the current java version compared with previous versions?
  58. What is the lambda expression?
  59. What is a functional interface and it’s example?
  60. How many ways to create a thread and it’s life cycle?
  61. What are streams in java?
  62. What is the difference between a hashset and concurrenthashset?
  63. Difference between hashmap and concurrenthashmap
  64. What is LinkedHashMap
  65. What is a static method in java?
  66. How the static class locking works?
  67. what is a singleton design pattern and how do you create it?
  68. What are directives in angular?
  69. What are pipes in angular?
  70. How do components communicate with each other and data transfer among them?
  71. What is DDL and DML??
  72. What is the difference between Truncate and Delete?
  73. What is the difference between function and procedure?
  74. What is immutable class
  75. Method to find missing number in a Array list with value from 0-100. (number 7 and are missing)
  76. find the number of integer appear in a array list having duplicates
  77. Explain Quick sort
  78. Serialization
  79. what is executer framework and cachethreadpool
  80. How hashMap works internally
  81. Spring & Microservice
  82. What is microservice and its architecture
  83. How to handle situation if one of microservice fails
  84. What is API gateway
  85. What is client side load balancing
  86. Spring life cycle
  87. What is dependency Injection
  88. Annotation used in circuit breaker implementation
  89. Microservice design patterns
  90. fast iterate and safe iterate
  91. How you read file from angular
  92. difference between get and load in hibernate
  93. Spring JPA CRUD Repository
  94. jdbcTemplate methods
  95. difference between Observer and subscribe in angular
  96. Spring boot and hibernate integration steps
  97. How you read properties file from springboot
  98. sql query for one to many mapping.
  99. Functional interface.
  100. Design patterns used Realtime in your application.
  101. Java Multithreading – wait & notify, Obtaining lock.
  102. Static and Dynamic Overloading.
  103. Spring security its annotations.
  104. Java 1.8 features.
  105. Angular Observable subscribe and unsubscribe.
  106. what happens when we call a void method in a system.out.println()?
  107. What is Resource(Request) and Response in Restful services?
  108. how can I return custom data instead of JSON or XML content for a Rest response?
  109. what are stream(s) in java and few operations on them like comparison
  110. difference between comparable and comparator
  111. why Clonable is not implemented by Collection interface, reason?
  112. Components in angular
  113. What is the life cycle of components in angular
  114. Sharing data between components in Angular
  115. Type Script compilation process
  116. Angular life cycle
  117. what are gate in angular
  118. in how many ways I can sort my employee object with the given set of columns, explain?
  119. How to create schedulers in java
  120. How we implement batch import and export functionality in spring.
  121. How to maintain session in server side.
  122. Lifecycle process of angular
  123. How to reload header and footer menu based on particular left menu routing
  124. Box model in CSS
  125. Pseudo selector in CSS
  126. Difference between display block & display inline-block
  127. Difference between position absolute and position relative
  128. What is the internal implementation of HashMap?
  129. What is the algorithm/datastructure used to get an emlement from HashMap?
  130. How to make HashMap synchronized
  131. Difference between HashMap & concurrent hash map
  132. Authenticate client side in angular
  133. Time difference calculation in angular
  134. How to create Generic class in angular
  135. Difference between Post and PUT
  136. Stored Procedures
  137. Monolithic architecture and Microservice Architecture
  138. java 8 new features
  139. List of collections used
  140. How exceptions are handled
  141. Throw and Throws
  142. Final, Finally, Finalize
  143. Spring IOC
  144. Spring boot advantages
  145. JPA repository
  146. First level second level cache in hibernate
  147. Union vs Union all
  148. Spring security
  149. Spring transactions
  150. Custom directives
  151. Get and post in angular
  152. employee has id, name, salary. Find the list of employees where the employee name starts with “n” using java8?
  153. can you the same in ArrayList and array?
  154. Vulnerability checking process in the front end
  155. Have you worked on Cross Site Scripting?
  156. What are the challenged faced in Cross Site Scripting?
  157. Have you worked in Custom annotation creation in Java?
  158. if yes? Could you explain the implementation of custom annotation?
  159. Where thread class variables will get store in Memory?
  160. What are the different databases you worked?
  161. Did you face any query performance issues? how did you increase the performance of the query?
  162. What is index and query of it?
  163. What is the data structure used to create an index?
  164. How can you handle the errors in Spring Boot?
  165. Can you explain what are the dependencies required to create REST application in Spring Boot? what other classes needs to be created to perform CURD operations and it’s flow?
  166. How you worked on application security?
  167. angular life cycle hooks
  168. Explain insertion sort logic
  169. Write query to get 3rd highest salary of employee
  170. How to get the average value of integers using streams
  171. What are method references
  172. What are for lambda expressions introduced and what is the advantage
  173. explain proxy pattern
  174. how to find duplicate user object user {name, age}
  175. What is observable
  176. What is cluster index
  177. What is the deployment procedure of Micro services
  178. Explain service discovery pattern
  179. What is containerization
  180. how to import module and service in Angular
  181. Difference between monolithic and microservices architecture.
  182. Difference between Spring and Spring boot
  183. Explain about Spring boot starter
  184. Spring security
  185. @Springboot application
  186. Gates in angular
  187. Life cycle of angular hooks
  188. How to pass the data between components.
  189. Structural and behavioral directives
  190. Multi threading concepts
  191. Architecture of the current project where you are working
  192. Architecture of angular application
  193. Difference between soap and Rest
  194. Questions on GIT code checkout process
  195. Questions on Front end security concepts
  196. Code deployment procedure
  197. Load balancing concepts related to services
  198. REST and SOAP justification for usage
  199. Questions based on resume and projects explanation Why ? What ?
  200. How we used if we mention any technology
Advertisement

Java : Lambda Expression

What is Lambda expression?

As per Wikipedia, lambda expression also called as anonymous function. It’s a function without name and does not belong to any class. Lambda expression is introduced as part of Java 8 features.

A traditional method or function in java has these main parts.

  • Name
  • Parameter list
  • Body
  • Return type

A lambda expression in java has these main parts.

  • No Name: as this is anonymous function there is no name needed
  • Parameter list
  • Body: this is the main part of the function
  • No return type: you don’t need to mention the return type in lambda’s expression. The java 8+ compiler is able to infer the return type by checking the code.

Program of using lambda expression without any parameters:

@FunctionalInterface
interface NoParamInterface{
    String printHelloWorld();
}

public class NoParamLambdaTest{
    public static void main(String[] args) {
        NoParamInterface noParamInterface= () -> "Hello World";
        System.out.println(noParamInterface.printHelloWorld());
    }
}

Program of using Lambda expression with single parameter:

@FunctionalInterface
interface SingleParam{
    int incrementBy10(int x);
}

public class SingleParamLambdaTest {
    public static void main(String[] args) {
        SingleParam singleParam = (x) -> x+10;
        System.out.println(singleParam.incrementBy10(5));
    }
}

Program of using Lambda expression with multiple parameters:

@FunctionalInterface
interface MultiParam{
    String concat(String x, String y);
}

public class MultiParamLambdaTest {
    public static void main(String[] args) {
        MultiParam multiParam = (x, y) -> x+" "+y;
        System.out.println(multiParam.concat("Hello", "World"));
    }
}

Program of using Lambda expression with Runnable interface:

public class RunnableExample {

    public static void main(String[] args) {
        //Traditional way of implementation
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                int sum=0;
                for(int i=0;i<10;i++)
                    sum +=i;
                System.out.println("Traditional : "+sum);
            }
        };
        new Thread(runnable).start();

        //Implementing using lambda
        Runnable runnable1 = () -> {
            int sum=0;
            for(int i=0;i<10;i++)
                sum +=i;
            System.out.println("Lambda : "+sum);
        };
        new Thread(runnable1).start();

        //Implementing Thread with Lambda
        new Thread(()->{
            int sum=0;
            for(int i=0;i<10;i++)
                sum +=i;
            System.out.println("Thread with Lambda : "+sum);
        }).start();
    }
}

Program of using Lambda expression with Callable interface:

import java.util.Arrays;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.IntStream;

public class CallableExample {
    public static int[] array = IntStream.range(0,5000).toArray();
    public static int count = IntStream.range(0,5000).sum();

    public static void main(String[] args) throws InterruptedException, ExecutionException {
        Callable<Integer> callable1 = () -> {
            int sumOfEven=0;
            for(int i=0;i<array.length;i++){
                if(i%2 == 0)
                    sumOfEven = sumOfEven + i;
            }
            return sumOfEven;
        };

        Callable<Integer> callable2 = () -> {
            int sumOfOdd=0;
            for(int i=0;i<array.length;i++){
                if(i%2 == 1)
                    sumOfOdd = sumOfOdd + i;
            }
            return sumOfOdd;
        };

        ExecutorService executorService = Executors.newFixedThreadPool(2);
        System.out.println("Sum of Even of given range: "+executorService.invokeAny(Arrays.asList(callable1)));
        System.out.println("Sum of Odd of given range: "+executorService.invokeAny(Arrays.asList(callable2)));
        executorService.shutdown();

        System.out.println("Count of the given range is : "+count);
        System.out.println("Sum of Odd and Even is equals to count");
    }
}

VirtualBox cannot run when Hyper-V is installed

Objective of this article to share how to solve the problem of VirtualBox can not run when Hyper-V is installed in windows machines. This problem might occur when we try to run VirtualBox where already docker was installed. Because docker internally enables Hyper-V configuration in windows which will be the problem to run VirtualBox.

VirtualBox can not run when Hyper-V is installed

There are total 3 steps which we must follow to enable/disable Hyper-V in Windows 10.

  1. Search for Apps & Features in Windows Search option
  2. Search for Turn Windows features on or off
  3. Select/deselect the Hyper-V option from the popup opened to enable/disable accordingly.

For more detailed explanation continue with further article.

  • Search for Apps & Features in Windows Search option: Look at the below image for more easiness to find Apps & Features option.
Windows Apps & Features
  • Search for Turn Windows features on or off
Turn Windows feature on or of
  • Select/Deselect the Hyper-V option from the popup opened: Deselect Hyper-V option and click on OK button to disable Hyper-V in your system. Since Hyper-V is OS level configuration, it will ask to restart the computer to make changes are affected.
Hyper-V enable/disable

We should restart the system to make affect of Hyper-V configuration changes. Afterwards, try to run the virtual box again. Hope it will run successfully without any failure.