What is MCP and how does it work?
Java
/** * Find the person with the minimum age in a room with the maximum number of people * At the end of the solution method, call writeSolution(user, room) */
How to solve the problem with NFT 50ms at current RT 150ms + 350ms? Suggest an architectural solution.
table student id PK name faculty_id table faculty id PK name SELECT f.name, count(*) FROM faculty f JOIN student s ON s.faculty_id = f.id GROUP BY f.id, f.name GROUP BY /*f.id,*/ f.name GROUP BY f.id/*, f.name*/
Have you worked with locks in databases? How did you acquire locks?
What are functional interfaces? Which ones do you know? What do they accept and what do they return?
What is the difference between map and flatMap in the Stream API?
Can any object be added to a TreeMap as a key?
What does the reduce method do?
[name] asked: what databases have you worked with? Postgres, Redis — that's clear, but what about non-relational ones like MongoDB or others?
Why did you use Spring Web for API Gateway instead of ready-made proxy solutions like Nginx, Envoy?
The database is large, indexes are built, the plan has been reviewed — what else can be done for optimization?
How do LinkedList and HashMap differ? How does LinkedHashMap differ from HashMap?
Have you ever explained to a client or analyst why a task takes 2 days instead of 10?
What approaches do you use for versioning REST API to ensure compatibility between different clients, and what difficulties have you faced?
```java import java.util.*; import java.lang.*; import java.io.*; class Codechef { public static void main (String[] args) throws java.lang.Exception { var autoNumbers = List.of(List.of("A123BC", "B421FT"), List.of("O543EC","B421FT", "I222OA")); autoNumbers.stream().flatMap(Collection::stream).flatEach(System.out/System.out.println()); Map<String, String> numberMap = autoNumbers.stream().flatMap(Collection::stream).collect(Collectors.toMap( n -> n, n -> n.replaceAll("[^0-9]", ""))); System.out.println(numberMap); } } ```
Tell about what you have translated from synchronous to asynchronous mode and why it was done.
@Data @Entity @Table(name = "_store") public static class Book { @Id private String id; private String title; private String author; private int price; @Transient private String tmp; @Enumerated(EnumType.STRING) private BookType type; } public enum BookType { COMMON, PREMIUM; }
```java // 2 public class Interfaces { public static void main(String[] args) { A a = new A() {}; B b = new B() {}; AB ab = new AB(); a.print(); b.print(); ab.print(); } public interface A { default void print() { System.out.println("interface A"); } } public interface B extends A { default void print() { System.out.println("interface B"); } } public static class AB implements A, B { } } ```
Tell about the hotspot problem in Cassandra and how you solved it.