Sobes.tech

Implementations - Logic of connecting users and producers - Message keys can be duplicated - Error in aligning consumer offsets with messages - No mood for producer - No execution for multiple brokers - Consumer group is hardcoded

260

If I often read but rarely insert data, which Map is better to use?

193

What is the main problem with this implementation SELECT f.food_id FROM Foods f JOIN Expirations e ON f.id = e.food_id WHERE e.is_expired = 1; - Using `JOIN` instead of `WHERE EXISTS` to check for record existence. - No index on the e.is_expired field - JOIN keys are not indexed - The Expirations table is redundant - The query is not protected within a transaction.

189

What is the main problem of the chosen solution structure - No special exception handling during startup - Configuration class without @Configuration annotations - Incorrect dependency injection setup - Incorrect integration of custom configs changing property load order - @Autowired dependencies missing

189

Postgres processed the information, understood that the data exists. What does it send back? Immediately the data as a row map or something else?

188

What are the main locking strategies used by databases to handle concurrent access?

183

What is the main problem of this implementation - Inefficient use of a fixed thread pool - Issues with shared resource interaction - Incorrect inclusion of locking can lead to deadlock situations. - Incorrect level of synchronization - No checks of all threads before the result - No explicit constructor Code: import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; class RecyclingBinCounter { private int binCount; private final ReentrantLock lock = new ReentrantLock(); public void incrementBins() { lock.lock(); try { binCount++; } finally { } } public int getBinCount() { return binCount; } } class RecyclingManager { public static void main(String[] args) { RecyclingBinCounter counter = new RecyclingBinCounter(); ExecutorService service = Executors.newFixedThreadPool(3); for (int i = 0; i < 3; i++) { service.submit(() -> { for (int j = 0; j < 1000; j++) { counter.incrementBins(); } }); } service.shutdown(); while(!service.isTerminated()) {} System.out.println("Total bins collected: " + counter.getBinCount()); } }

179

Which of the recent tasks did you find interesting, challenging, and memorable?

172

Why did you choose wait/notify specifically, rather than ReentrantLock?

171

If there are multiple offers from several companies, what criteria will you use to make a choice? Name three.

169

What problems does Spring Kafka have with virtual streams? Or are there no problems at all?

168

Какой побочный эффект возникает при выполнении кода BEGIN; SET TRANSACTION ISOLATION LEVEL READ COMMITTED; START TRANSACTION; SELECT progress INTO @current_progress FROM courses WHERE course_id = 101; SET @current_progress = @current_progress + 60; UPDATE courses SET progress = @current_progress WHERE course_id = 101; COMMIT; END; BEGIN; SET TRANSACTION ISOLATION LEVEL READ COMMITTED; START TRANSACTION; SELECT progress INTO @current_progress FROM courses WHERE course_id = 101; SET @current_progress = @current_progress + 40; UPDATE courses SET progress = @current_progress WHERE course_id = 101; COMMIT; END;

162

What is the main problem with the chosen solution structure? The Property class does not support polymorphism. Class fields may be uninitialized. Method of transferring total cost calculation to the 'Order' class. Does not use transactional mechanisms. No exceptions are thrown for an empty list.

162

Would you hook into the Kafka Listener lifecycle via KafkaListenerEndpointRegistry or explicit polling through KafkaConsumer?

162

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

156
/5