Sobes.tech

What are the advantages and disadvantages of using indexes for individual columns in a database?

Junior — Middle
268

Have you used the SELECT statement in data update operations (UPDATE)?

Junior — Middle
266

What types of indexes exist in SQL database management systems?

Junior — Middle
264

What can lead to a decrease in function execution performance?

Junior — Middle
263

Can cyclic dependencies lead to memory leaks in a program?

Junior — Middle
259

What steps will you take to identify the causes of regular service restarts related to the OutOfMemoryError error?

Junior — Middle
259

Read the code and highlight errors. /** * A client with a purchased ticket can choose a specific seat for an additional fee. * The base price of seats is determined by tariffs (external service). * For clients with certain tariffs (PREMIUM, ULTRA), a discount is applied at payment. * When booking, an invoice is issued to the client for payment. Payment management is handled by a third-party service. */ @Service public class SeatBookingService { @Autowired private SeatBookingRepository seatBookingRepository; @Autowired private TicketRepository ticketRepository; @Autowired private TariffClient tariffClient; @Autowired private CustomerClient customerClient; @Autowired private PaymentClient paymentClient; /** * Booking. * @param seatCode seat code (e.g., 19A) * @param ticketId ticket ID */ @Transactional public void bookSeat(String seatCode, UUID ticketId) { var ticket = ticketRepository.findById(ticketId); //book var seatBooking = new SeatBooking(seatCode, ticket.get().getFlightId(), ticketId, BookingStatus.BOOKED); seatBookingRepository.save(seatBooking); //find base tariff for the selected seat on the plane var basePrice = tariffClient.getBasePrice(ticket.get().getPlaneModel(), seatCode); //find customer data Long userId = (Long) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); var userData = customerClient.getCustomer(userId); System.out.println("User found " + userData.getFio() + " document number " + userData.getDocument()); var price = basePrice; if (userData.getTariff() == "PREMIUM") { //50% discount price = basePrice * 0.5d; } if (userData.getTariff() == "ULTRA") { //20% discount price = basePrice * 0.8d; } var invoice = new Invoice(price, ticketId, userId); //issue invoice paymentClient.sendInvoice(invoice); System.out.println("Invoice issued"); } @Data @Table("seat_booking") public class SeatBooking { @Column private String seatCode; @Column private UUID flightId; @Column private UUID ticketId; @Column private BookingStatus status; } public enum BookingStatus { BOOKED, PAID; }

256

Have you had experience interacting with data or resource providers?

Junior — Middle
252

The mechanism of the SELECT FOR UPDATE operator in databases and its role in managing concurrent access.

Junior — Middle
249

Why does a ConcurrentModificationException occur when modifying an ArrayList simultaneously during iteration?

Junior — Middle
244

What actions will you take if the delays in database query execution become significant under increased system load?

244

What methods can be used to increase the speed of table search?

Junior — Middle
242

Can you explain how the exception inheritance structure is organized in a programming language?

Junior — Middle
240

Is the related record automatically deleted from the child table when the related key is deleted from the parent table?

Junior — Middle
239

What distinguishes an optimistic approach to locking from a pessimistic one in the context of concurrency control in databases?

Junior — Middle
239

What ways can you improve the speed of executing this method?

Junior — Middle
238

Explain the concept of type erasure and its main purpose in programming.

Junior — Middle
237
/15