You are on page 1of 4

1.

@qualifier
2. Finally
3. global exception handling - @restcontrolleradvice, @exceptionhandler
4. flatmap – list of list to single list
5. throws and throw
6. put and patch

PUT
If I had to change my firstname then send PUT request for Update:

{ "first": "Nazmul", "last": "hasan" } So, here in order to update the first name we need to
send all the parameters of the data again.

PATCH:
Patch request says that we would only send the data that we need to modify without
modifying or effecting other parts of the data. Ex: if we need to update only the first name,
we pass only the first name.

1. PUT
 If the client sends data with an identifier, then we will check whether that identifier exists.
If the identifier exists, we will update the resource with the data, else we will create a
resource with the data and assign/generate a new identifier.
2. PATCH
 If the client sends data with an identifier, then we will check whether that identifier exists.
If the identifier exists, we will update the resource with the data, else we will throw an
exception.

7. employee list - remove duplicates


8. responseEntity
9. employee list - employee name list
10. final keyword
11. functional interface
12. Can a functional interface extend/inherit another interface
13. Abstract class and interface
14. predicate interface
15. peek method
16. What is the default method, and why is it required?
17. What are static methods in Interfaces?
18. What are some standard Java pre-defined functional interfaces? – comparator, comparable
19. Comparator – use to sort different objects in a user-defined order
20. Comparable - use to sort objects in the natural sort order
21. What is an Optional class?
22. What are the advantages of using the Optional class?
23. @restcontroller and @controller
24. What are Intermediate and Terminal operations?

Ans -

Intermediate Operations:

Process the stream elements.


Typically transforms a stream into another stream.
Are lazy, i.e., not executed till a terminal operation is invoked.
Does internal iteration of all source elements.
Any number of operations can be chained in the processing pipeline.
Operations are applied as per the defined order.
Intermediate operations are mostly lambda functions.
Terminal Operations:

Kick-starts the Stream pipeline.


used to collect the processed Stream data.
int count = Stream.of(1, 2, 3, 4, 5)
.filter(i -> i <4) // Intermediate Operation filter
.count();

25. what is frontcontroller? –DispatcherServlet


26. advice
27. AOP
28. Mockito and PowerMockito
29. What is the lambda expression in Java and How does a lambda expression relate to a functional
interface?
30. Transient
31. @setter and @getter
32. Dependency Injection
33. Hashmap
34. Soap vs rest
35. Rest calling another rest services – resttemplate and feign client
36. Microservices
37. Create custom exception
38. Collections Vs Collection
39. enableAutoConfiguration
40. Autowired
41. Linkedlist vs list
42. Set vs linkedset
43. Singleton class
44. Generic types
45. Primitive types
46. Loosely coupled and tightly coupled
47. Hash set vs hash map
48. Spring boot security
49. Serialize – object to byte code
50. Webservices – through network, calling from one application to another
51. Soap vs rest
52. Request param
53. Load balancing
54. Pom.xml
55. Application.properties
56. Jar and war
57. Sql queries
58. Use of jdk
59. How jre is working
60. Orm tools
61. Jvm is working
62. @autowired internal mechanism
63. Autowiring types
64. Equals and hashcode
65. String buffer and string builder
66. Spring boot actuator
67. Collection vs collections
68. Marshalling and unmarshalling
69. This() and super()
70. Autowiring types in spring boot
71. Hash set and hash map
72. Program to get the count of letter l from string hello world
73. Remove duplicates from employee list and get the count
74. Methods in interceptors
75. Left outer join
76. Parent and child entity class. Combine and get the value - @Query
77. How you are achieving spring security?
78. @CrossOrigin

import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.*;

public class Test{

public static void main(String []args){


List<Integer> arr = new ArrayList<Integer>();
arr.add(10);
arr.add(20);
arr.add(25);
arr.add(35);
System.out.println(arr.stream().map(val -> val % 10 == 0).collect(Collectors.toList()));
}
}

You might also like