Sobes.tech

Kotlin

// book(seat_id, user_id) PostgreSQL Begin Transaction(read_commited) seat = select * from seats where id = seat_id for update if(seat == null seat.status == "booked") rollback return error("Seat isnt available") insert into bookings (user_id, seat_id, status, created_at) values (used_id, ...) update seats set status = 'booked' where id = seat_id commit return success()

Senior
214

Tell me about database sharding.

Senior
214

Tell me about replication in PostgreSQL: master-slave, what happens when a replica fails?

Senior
208

Do you know what Service Mesh is in Kubernetes?

Senior
205

Why is the closing bracket the key in the Map, and the opening bracket the value? What will change if you do the opposite? What is the complexity of containsValue vs get by key?

Senior
194

How to control load on handles (rate limiting)?

Senior
168

Tell me about transaction isolation levels

Senior
167

What does VACUUM do in PostgreSQL and why do dead tuples appear?

Senior
167

How does the Dirty Checking mechanism work in Hibernate?

Senior
167

Have Kafka transactions (exactly-once semantics) been used?

Senior
163

Why can the Postgres query optimizer use Seq Scan in production but Index Scan in dev/ft with the same indexes?

Senior
160

Tell about partitioning in PostgreSQL.

Senior
158

Tell about optimistic and pessimistic locking, when to apply them?

Senior
158

Tell me about yourself and your work experience

Senior
156

/*Given a string, implement a function to check the correctness of bracket notation. Each opening bracket must have a corresponding closing bracket. Opening and closing brackets must be in the correct order. Types of brackets: "{", "}", "(", ")", "[", "]". Input: "([]){}[(()())()]" Result: true Input: "[(])" Result: false Because brackets 2 and 3 are incorrect, the closing ']' appears before the closing '('.*/ public boolean check(String s){ Deque<Character> stack = new ArrayDeque<>(); Map<Character, Character> map = Map.of( ')', '(', ']', '[', '}', '{' ); // ((( for( char c : s.toCharArray()){ if(map.containsValue(c)){ stack.push(c); } else if(map.containsKey(c)){ if( stack.isEmpty() || stack.pop() != map.get(c)){ return false; } } } return stack.isEmpty(); }

Senior
156

/* SELECT left.K, left.V1, right.V2 FROM left JOIN right ON left.K = right.K; */ public <K extends Comparable<K>, V1, V2> List<Triple<K, V1, V2>> join(List<Pair<K, V1>> left, List<Pair<K, V2>> right) { return null; } private static class Pair<A, B> { private A first; private B second; Pair(A first, B second) { this.first = first; this.second = second; } } private static class Triple<A, B, C> { private A first; private B second; private C third; Triple(A first, B second, C third) { this.first = first; this.second = second; this.third = third; } }

Senior
153

Tell about monitoring and metrics in the project (Prometheus, Grafana)

Senior
152

How to solve the problem of concurrent updates of one entity from two Kafka topics (one topic overwrites changes from the other)?

Senior
151

What was the load on the services? What optimizations were applied?

Senior
133
/7