Sobes.tech

What are the levels of transaction isolation in SQL and which one is set by default in PostgreSQL?

161

What is the main problem with this implementation? - Incorrect HTTP status codes with exception types - Incorrect Dependency Injection setup - Asynchronous listeners are not engaged - Non-standard exception handling in the handler - Incorrect bean configuration - @Autowired is not used for dependency injection

158

Tell about yourself, why are you currently looking, what are you looking for?

158

Inefficient use of a fixed thread pool Resource contention issues Incorrect locking can lead to deadlocks Incorrect synchronization level Lack of checks for all threads before result No explicit constructor

157

What is the main problem with this implementation? - Does not use a connection pool for Jedis - No Redis data backup - No internal check switch - No exception handling - Calibration element is updated incorrectly - zadd and zscore without error checks ```java import redis.clients.jedis.Jedis; import java.util.Set; public class WineCellar { private Jedis jedis; public WineCellar() { jedis = new Jedis("localhost", 6379); initializeWines(); } private void initializeWines() { jedis.zadd("wines", 1978, "Chateau Margaux"); jedis.zadd("wines", 1990, "Domaine de la Romanee-Conti"); jedis.zadd("wines", 2005, "Opus One"); } public void updateWineYear(String wine, double newYear) { double oldYear = jedis.zscore("wines", wine); if (oldYear != newYear) { jedis.zadd("wines", oldYear, wine); // Incorrect update } } public Set<String> getWinesByYear(double minYear, double maxYear) { return jedis.zrangeByScore("wines", minYear, maxYear); } public static void main(String[] args) { WineCellar cellar = new WineCellar(); cellar.updateWineYear("Chateau Margaux", 1982); System.out.println(cellar.getWinesByYear(1970, 2000)); } } ```

154

WardrobeManager should use @Autowired Missing class for managing binaries Missing transaction management ItemRepository is not annotated with @Repository Using constructor instead of Spring container for component creation WardrobeController constructor does not use @Autowired

153

What is the main problem of this implementation of a composite type based on the database TIMESTAMP without timezone Syntax error! NULL in code Lack of CTE readability Portability issues due to SERIAL "TICKET_TYPE" was not declared in the database Not the last value at the INTEGER level

151

How would you implement the propagation of business headers (x-session-id, x-client-id) across the microservices system via REST and Kafka?

150

What is the main problem of this implementation - Non-optimized tables show the size of the image - Docker image trimming in RUN can be problematic - Multiple CMDs, only the last one takes effect - The delete operation does not consider filtering by the "viewing" image

149

What is the main problem of the chosen solution structure - ArrayList without pre-allocated capacity leads to overheads - Risk of deadlock using methods - Inefficient locking structure causes unnecessary overheads. - ExecutorService cannot be handled correctly - Fixed scalability protection pool

149

What is the main problem with this implementation? - No specifications on scope and results - Lack of error handling in security sphere - Error in context setup — collections are not written properly. - Prototype component is not manually managed - No MVC recommendations for management courses

149

Incorrect implementation of error handling logic using onErrorResume No differentiation of error handling in handleEnrollmentError Lack of dependency injection in the controller The handleEnrollmentError method does not use parameters CourseController has not been registered for ten years

148

class AlternatingPrinter { public static void main(String[] args) { AlternatingPrinter printer = new AlternatingPrinter(); Thread numberThread = new Thread(printer::printNumbers); Thread letterThread = new Thread(printer::printLetters); numberThread.start(); letterThread.start(); } public void printNumbers() { for (int i = 1; i <= 26; i++) { System.out.print(i + " "); } } public void printLetters() { for (char c = 'A'; c <= 'Z'; c++) { System.out.print(c + " "); } } } Предположим, у вас есть два потока. Один из них выводит (1,2,3...), а другой — (A,B,C...). Как обеспечить их выполнение в чередующейся последовательности (1,A,2,B...)?

147

В чём основная проблема данной реализации WITH archived_charges AS ( SELECT id, charging_station_id, start_time, end_time FROM charge_sessions WHERE end_time < current_date - interval '30' day ) INSERT INTO charges_history SELECT * FROM archived_charges; DELETE FROM charge_sessions USING archived_charges WHERE charge_sessions.start_time < current_date - interval '15' day;

147

What would you lose and gain by explicit polling instead of @KafkaListener?

146

What is the main problem of this implementation - Connection to Redis is hardcoded - There is a connection pool for Redis - Unverified call to `jedis.get` may return null - Using the `KEYS` command causes server load - No Redis events

146
/5