Java
What are the differences between stack and heap from the perspective of multithreading?
What is livelock?
What are the differences between Thread.sleep() and Thread.yield() methods?
Why should you use configuration through annotations instead of configuration through XML?
What are the minimum and maximum values of the integer data type in Java?
How can a class be implemented so that its state is immutable after creation?
What is a ThreadLocal variable?
What is better to use: ArrayList or LinkedList if I want to delete an element from the middle of the list?
How does the context work in Java?
What is the difference between JOIN and UNION?
What should be used to work with complex queries containing many parameters?
How to create a custom serialization protocol?
What is the purpose of CompletableFuture in Java?
What are optimistic and pessimistic locking?
How would you implement sending a message to a client considering the possibility of transaction cancellation?
What is an antipattern and which antipatterns are you familiar with?
What is the difference between the interrupted() and isInterrupted() methods in Java?
Calculate the difference between the largest and smallest DELIVERY orders for each currency. Return the result for each currency, sorted in ascending order of the difference. /** * Returns a map of {currency (sorted by difference) – difference between the largest and smallest DELIVERY order for that currency}. * If there is only one order for a currency, the difference is 0. * Example input: * [ * Order(DELIVERY, "EUR", 2000), * Order(DELIVERY, "USD", 15), * Order(DELIVERY, "RUB", 200), * Order (PICKUP, "RUB", 1250), * Order (DELIVERY, "USD", 35), * Order (PICKUP, "USD", 55), * Order (DELIVERY, "RUB", 100) * ] * * Expected output: * ["EUR" -> 0.0, "USD" -> 20.0, "RUB" -> 100.0] * */ Map<String, Double> getMaxMinusMinDeliveryMapByCurrency(List<OrderData> orderDataList) { }
What are non-blocking algorithms?
Can you explain the principle of Stream API and how it helps process data in Java?