What is the main difference between using the map and flatMap methods in the Stream API when processing data streams?
Java
Unfortunately, do you have practical experience in creating and maintaining microservices architectures?
Tell me about SQL query optimization by 40-50%.
//Given an array of numbers where all numbers except one have a pair, //find the number that appears only once // <= [1, 0, 3, -2, 9, 9, 1, -2, 0] // => 3 int find(int[] arr){ //TODO }
Where can request scope be useful?
What are the idempotency rules for HTTP methods? How to solve the problem of duplicate POST requests?
How to implement the open-closed principle in object-oriented programming?
Can a singleton service (single instance) be high-load?
Why is the finalize() method needed?
Tell me about the memory structure in JVM — what are the segments, how does it work?
The database is large, indexes are built, the plan has been reviewed — what else can be done for optimization?
Tell about streams in Java: what groups do methods fall into and what is the difference?
What events does ApplicationContext in Spring know?
How can changes made be saved before switching to another branch in version control systems?
Algorithmic problem: given an integer array, move all zeros to the end, preserving the order of other elements (e.g., [1,0,3,0,1] → [1,3,1,0,0])
How many civilian airliners were over the Moscow region yesterday? (Fermi estimation question)
How to solve the consistency problem when using Kafka transactions between two services?
What HTTP methods were used in designing REST API? What is the difference between PATCH and POST?
Tell about the Outbox pattern for guaranteed message delivery.
How have you implemented log collection and monitoring in a microservices architecture?