Pros and cons of monolithic and microservices architecture.
C#
How to solve the cache degradation problem (Redis responds in 1 second, DB in 10ms)?
Can you explain the concept of Boxing in the context of programming languages?
Explain the difference between reference and value types.
Implement a method that fills the user's full name from storage (IDbRepository or ICacheRepository) and propagates an enriched event further (IEventSaver). Maximize performance. 99.9% of data in cache is current. The initial order of events during saving can be disrupted.
Монолиттік қосымшаларды әзірлеу немесе қолдау тәжірибеңіз бар ма?
Can you explain what is meant by indexes in the context of SQL databases?
If a pod in Kubernetes crashes after successfully booking a hotel but before saving the booking ID, how to restore consistency?
What is the reason for using different memory segments to store objects instead of combining them into one area?
Can we use await inside a lock block?
Tell about yourself, your interesting and significant tasks, something complex in your career, what you are proud of.
Can you explain what the Dispose pattern means in programming?
How many generations does a heap data structure have?
Can stacks always be used to store value types?
public bool BookTour(string userId, DateTime start, DateTime end, int hotelId, string roomType, string flightClass, int airCompanyId, int flightnumber) { try { //flightClass also not desired to parse enum var flightInfo = new FlightInfo(Enum.Parse<FlightClass>(flightClass), airCompanyId, flightnumber); var resultBookFlight = _airWaysService.Book(GetUser(userId), flightInfo); //roomType also not desired to parse enum var rentInfo = new RentInfo(start, end, hotelId, Enum.Parse<RoomType>(roomType)); //GetUserId in a separate variable var resultBookHotel = _hotelService.Book(GetUser(userId), rentInfo); //Exceptions will go to inner, not caught Task.WhenAll(resultBookFlight, resultBookHotel); //Why static reservationIdAir = resultBookFlight.Result; _reservationIdHotel = resultBookHotel.Result; } catch (BookFlightException) { _hotelService.CancelBook(_reservationIdAir); return false; } catch (BookHotelException) { _airWaysService.CancelBook(_reservationIdHotel); return false; } catch (Exception ex) { throw new ApplicationException(ex.Message); } finally { //fields are 100% uninitialized //Why do we try to save something after exception //GetUser already extracted unitOfWork.Execute(async () => { await _tourRepository.Save(_reservationIdAir, _reservationIdHotel, GetUser(userId)); }).RunSynchronously(); //Interlock.Increment() _countBooked++; } return true; }
There is a static dictionary, and we want to write to it from different threads. How is it best to do this?
What is object-oriented programming?
Name the synchronization primitives and briefly describe how they work.