Sobes.tech

What happens to the size of the table after inserting a thousand rows and then deleting everything?

Middle+
143

Why can't port 80 be occupied without permissions? What is the group of such ports called?

Middle+
142

How does data transfer physically occur through an unbuffered channel?

Senior
142

What list of commands do you use daily?

Middle+
141

Why is the copy operation needed for slices? Why can't you just assign one slice to another?

Senior
137

How to see what the program does when it starts? How to diagnose the cause of a crash?

Middle+
136

At what level was idempotency implemented and what was the idempotent key?

Middle+
133

How to run something with administrator rights in Linux?

Middle+
131

Share interesting cases from working with PostgreSQL

Middle+
130

Does the virtualization use the host OS kernel?

Middle+
129

Which command shows disk space?

Middle+
128

What is ACID and through which mechanisms is each letter implemented in PostgreSQL?

Middle+
127

// isPalindrome checks if a string is a palindrome. // Only letters and digits are considered (alphanumeric characters), case-insensitive comparison. // O(1) in memory + O(n) in time // s := "racecar" func isPalindrome(s string) bool { }

Middle+
127

Under what type of multitasking is livelock possible? What types of multitasking do you know?

Middle+
125

What is the difference between 'a' - 'A' and why is it needed for case conversion?

Middle+
123

How is a hash table (map) in Go structured? What is a collision and how is it handled? Closed vs open addressing, chaining.

Middle+
121

What is a snapshot in the context of MVCC in PostgreSQL?

Middle+
112

How is Mutex implemented under the hood? What is SpinLock and how does it work?

Middle+
111

func GetUniqueUserFirstNamesByProjectID(ctx context.Context, projectID string) ([]string, error) { userFirstNames, err := GetUserFirstNamesByProjectID(ctx, projectID) if err != nil { return nil, err } var ( userFirstNamesMap map[string]bool uniqueUserFirstNames []string ) for _, userFirstName := range userFirstNames { if _, ok := userFirstNamesMap[userFirstName]; !ok { userFirstNamesMap[userFirstName] = true uniqueUserFirstNames = append(uniqueUserFirstNames, userFirstName) } } return uniqueUserFirstNames, nil } // users // id first_name project_id func GetUserFirstNamesByProjectID(ctx context.Context, projectID string) ([]string, error) { rows, err := conn.Query(context.Background(), fmt.Sprintf("SELECT first_name from users where project_id = '%s';", projectID)) if err != nil { return nil, err } var userFirstNames []string for rows.Next() { var userFirstName string if err := rows.Scan(&userFirstName); err != nil { return nil, err } userFirstNames = append(userFirstNames, userFirstName) } return userFirstNames, nil }

Middle+
77
/5