Read the code and identify errors ```java @Component public class AuthorSearchService { @Autowired private AuthorRepository authorRepository; @Autowired private StatisticsRepository statisticsRepository; private AlertRestClient arc = new AlertRestClient(); // The query can contain either the full name or part of it, e.g., "Vadim Pavlo" or "pavlo" @Transactional public List<Author> search(String query) { List<Author> authors = authorRepository.findByNameContainingIgnoreCase(query); Statistics s = statisticsRepository.findById(query).orElse(null); if (s == null) s = new Statistics(query); s.setNumbers(s.getNumbers() + 1); statisticsRepository.save(s); if (s.getNumbers() > 1000 && authors.size() > 1000) { System.out.println("too popular search with too much data, sending an alert..."); arc.send(query, s.getNumbers(), authors.size()); } return authors; } } @Entity @Data public class Author { @Id @GeneratedValue private Long id; private String name; @OneToMany(mappedBy = "author") private List<Book> books; public Author(String name) { this.name = name; } } ```
Java
What is transactional load? What was the transactional load in your system?
Do you think story points are truly useful or just a formality for managers?
What is the problem with calling REST directly from a Kafka consumer?
What is the difference between the @Bean annotation and @Component?
Why is the Java Stream API designed to be lazy? Pros and cons of this approach.
What databases have you used in your career?
Describe a complex task from your recent experience: what was the difficulty and how was it solved?
How to construct dynamic queries when filter conditions are unknown in advance (e.g., 10 optional fields)?
What is the difference between orchestration and choreography?
Why are you looking for a new job?
-- There are tables with the structure Employee id (PK) name salary dep_id(FK department.id) Department id (PK) name -- write a query that returns a list of all department names with the maximum salary in each department select d.name, COALESCE(MAX(e.salary), 0) from Department d left join Employee e on e.dep_id = d.id group by d.name
Was the transition from Java 17 stack to 21 a one-time switch, or do different services run on different versions?
Code task: synchronized get/set and multithreading (screenshot with code)
How would you organize auditing of service calls, for example, Service A was called a million times, Service B — a hundred times in a day. How would you solve this task?
What Spring Cloud components have you used?
Situational question: the product team wants to implement integration via db-link with direct SELECTs instead of a normal adapter. What are your actions?
Do you see a weakness or a growth point for yourself?
What types of indexes were used? Were there any negative costs associated with the indexes?
What is the difference between HashMap and LinkedHashMap?