Sobes.tech

Kotlin

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

Senior
204

Tell me about database sharding.

Senior
204

Do you know what Service Mesh is in Kubernetes?

Senior
201

// 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
200

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
190

Tell me about transaction isolation levels

Senior
163

How does the Dirty Checking mechanism work in Hibernate?

Senior
163

How to control load on handles (rate limiting)?

Senior
160

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

Senior
159

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

Senior
157

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

Senior
156

Tell about partitioning in PostgreSQL.

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

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

Senior
154

/* 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
151

Tell me about yourself and your work experience

Senior
150

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

Senior
150

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

Senior
147

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

Senior
131
/7