Sobes.tech

Tell about your mentoring experience with juniors — what was the essence and what were the difficulties?

Senior
175

How would you rate yourself now: middle, senior, or on a 10-point scale?

Senior
175

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; } } ```

175

What is transactional load? What was the transactional load in your system?

Senior
175

Do you think story points are truly useful or just a formality for managers?

Senior
175

@Service @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) class MyService { public String getMessage() { return "Hello from MyService! Instance: " + this.hashCode(); } } @RestController public class MyRestController { @Autowired private MyService myService; @GetMapping("/api/hello") public String hello() { return myService.getMessage(); } } curl [link] Hello from MyService! Instance: 56149 curl [link] Hello from MyService! Instance: ???????

Senior
175

What are schedulers in Reactor?

Senior
175

class Task { private static int counter = 0; public static void main(String[] args) throws Exception { var thread1 = new Thread(() -> increase()); var thread2 = new Thread(() -> increase()); thread1.start(); thread2.start(); thread1.join(); thread2.join(); System.out.println(counter); } private static void increase() { for (int i = 0; i < 5000; i++) { counter++; } } }

175

How to construct dynamic queries when filter conditions are unknown in advance (e.g., 10 optional fields)?

175

Why are you looking for a new job?

175

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?

175

What other collections do you know besides HashMap that can be used?

175

What is the Strategy pattern, how is it used, and how does it compare to switch-case?

Senior
175

What are transactions? Explain the reasons for use and the properties of ACID.

Senior
175

// 3 public class Variables { public static void main(String[] args) { A a = new A(); a.val = 1; inc(a); System.out.println(a.val); set(a); System.out.println(a.val); } public static class A { public int val; } public static void inc(A a) { a.val++; } public static void set(A a) { a = new A(); a.val = 10; } }

Senior
175
/743