Top React Redux Interview Questions

1. What are the advantages of using Redux with React? It offers predictable state management, centralized store, and better debug-ability in large-scale apps. const store = createStore(rootReducer); 2. What is the role of the Provider component in Redux? It wraps your main component to pass the Redux store to all nested components. 3. How does […]

Top Java8 Stream Grouping by Interview Questions with examples

1. How do you group strings by their length? Map<Integer, List<String>> grouped = list.stream()   .collect(Collectors.groupingBy(String::length)); 2. How do you group numbers by even and odd? Map<String, List<Integer>> grouped = numbers.stream()   .collect(Collectors.groupingBy(n -> n % 2 == 0 ? “Even” : “Odd”)); 3. How do you group employees by department? Map<String, List<Employee>> grouped = employees.stream()   .collect(Collectors.groupingBy(Employee::getDepartment)); […]

Top Java8 Streams Interview Questions

1. How do you filter strings that start with a specific letter? List<String> names = Arrays.asList(“Alice”, “Bob”, “Amanda”, “Brian”); List<String> filtered = names.stream()   .filter(name -> name.startsWith(“A”))   .collect(Collectors.toList()); 2. How do you convert a list of strings to a map with string length as key? List<String> words = Arrays.asList(“Java”, “Stream”, “Lambda”); Map<Integer, String> map = words.stream() […]