Sobes.tech

Why do errors not return in the Process method? Need to fix and send fully working code.

Senior
208

What is the difference between relational databases and NoSQL?

Middle
207

Why are you entering the market now?

Middle+
207

What are channels in Go and the select operator?

Middle
205

How does binary search work in a sorted list?

Middle
205

Besides B-tree, what other structures are used for indexes in databases?

Middle
205

What direction or project have you been assigned to in your current organization?

Junior — Middle
204

Can you use context to pass data between components or functions?

Junior — Middle
202

What is a pointer and how much does it weigh?

Middle
202

What is a race condition and what are ways to protect against it?

Middle
202

Documents are received by the service message Document { string Url = 1; // Document URL, its unique identifier uint64 PubDate = 2; // Document publication time uint64 FetchTime = 3; // Time of receiving this document update, can be considered as version ID. Pair (Url, FetchTime) is unique. string Text = 4; // Document text uint64 FirstFetchTime = 5; // Initially absent, needs to be filled } Documents can arrive in any order (not in the order they were updated), and duplicates of individual messages are also possible. It is necessary to form the same messages at the output, but with corrected individual fields according to the following rules (for a group of documents with the same Url field): Text and FetchTime fields should be the latest received at the moment (the one with the highest FetchTime) PubDate should be the one from the message with the smallest FetchTime FirstFetchTime should be the minimum FetchTime value In other words, at each moment, we take PubDate and FirstFetchTime from the earliest version (sorted by FetchTime), and Text from the latest. The interface in code can be implemented as follows: type Processor interface { Process(doc *Document) (*Document, error) } This code will work in a service reading input messages from a message queue (Kafka or similar), and writing the result back to the queue. If Process returns Null - nothing is written to the queue.

Senior
202

What is the difference between a goroutine and an operating system thread?

Middle
202

What is the difference between a process and a thread?

Middle
202

What are probes in Kubernetes, how to configure them, and what types are there?

Senior
201

How to use select to work with multiple channels simultaneously?

Middle
201

What else besides mutex can be used to protect against race conditions?

Middle
200

What is a channel in Go and what are its main areas of application?

Middle
200

/ * Given a string containing characters (){}. Determine whether the input string is balanced in terms of brackets. * / func isBalanced(s string) bool { // TODO: implement this return false } fmt.Println(isBalanced("()")) // -> true fmt.Println(isBalanced("({()})")) // -> true fmt.Println(isBalanced("(()")) // -> false fmt.Println(isBalanced("(()))")) // -> false fmt.Println(isBalanced("({})")) // -> false

Middle
199

What is iteration over a string using for range in Go? What are the variables i and v inside the loop, and what are their data types?

Middle
199

What is virtual memory (swap), when is it needed, and when should it be disabled?

Senior
199
/12