Sobes.tech

How to kill a process in Linux? What to do if 'kill pid' doesn't help?

187

Write an SQL query to list authors who have more than 10 books (tables: authors, books, many-to-many relationship).

187

What are EXPLAIN and EXPLAIN ANALYZE in PostgreSQL, and what is the difference?

184

How is a slice in Go structured internally? How does the append function work?

184

There are 3 entities - user, chat, message • The user has a name and registration date • The chat has a name and creation date • The message has text, an author, and a creation date • A user can be part of multiple chats simultaneously • A message must belong to a chat, and a message cannot belong to more than 1 chat at the same time • The domain should be described in the form of tables

183

Tell about an interesting/complex technical problem you solved.

179

We have a database with user passwords, passwords are hashed (hashPassword function), and a set of characters that can be used in passwords (variable alphabet). Our task is to implement the RecoverPassword function so that it recovers the password by the known hash and TestRecoverPassword completes successfully. Basic requirements: Solve as you wish package main import ( "crypto/md5" "fmt" ) var alphabet = []rune{'a', 'b', 'c', 'd', '1', '2', '3'} func RecoverPassword(h []byte) string { return "" } func hashPassword(in string) []byte { h := md5.Sum([]byte(in)) return h[:] } func main() {

175

package main import ( "crypto/md5" "fmt" ) var alphabet = []rune{'a', 'b', 'c', 'd', '1', '2', '3'} func RecoverPassword(h []byte) string { return "" } func hashPassword(in string) []byte { h := md5.Sum([]byte(in)) return h[:] } func main() { tests := []string{"a", "12", "abc333d"} ok := true for _, exp := range tests { h := hashPassword(exp) act := RecoverPassword(h) if act != exp { fmt.Printf("Error: expected %q, got %q\n", exp, act) ok = false } } if ok { fmt.Println("All tests passed successfully") } }

172

Code review: cache in Go with mutex. Find issues and suggest improvements. Condition: read/write load 80/20.

170

Describe the structure of an HTTP request and response. How are response codes classified?

166

package main import ( "crypto/md5" "fmt" ) var alphabet = []rune{'a', 'b', 'c', 'd', '1', '2', '3'} func RecoverPassword(h []byte) string { return "" } func hashPassword(in string) []byte { h := md5.Sum([]byte(in)) return h[:] } func main() { tests := []string{"a", "12", "abc333d"} ok := true for _, exp := range tests { h := hashPassword(exp) act := RecoverPassword(h) if act != exp { fmt.Printf("Error: expected %q, got %q\n", exp, act) ok = false } } if ok { fmt.Println("All tests passed successfully") } } To run the code correctly: entry point -- main function in main package Task: Implement the RecoverPassword function, which restores the original password from an MD5 hash, consisting of characters from a given alphabet.

165

Why are you considering new offers? Active or passive search?

163

How to implement a graceful shutdown of a Go service in Kubernetes when deploying a new version?

163

What tables and fields are needed in a PostgreSQL database for this messenger?

160

What was the most difficult and most interesting part of migrating from monolith to microservices?

158
/4