Go

Standard Library, HTTP & Systems Design in Go Interview Questions

35 Go interview questions on standard library, http & systems design in go, with detailed answers and code.

0/577 known
35 questions
Standard Library, HTTP & Systems Design in GoQ450Medium

func h(w http.ResponseWriter, r *http.Request) { w.Write([]byte("hello")) w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusCreated) } The…

Standard Library, HTTP & Systems Design in GoQ455Medium

type Resp struct { Items []int `json:"items"` Meta map[string]int `json:"meta"` Ptr *int `json:"ptr"` } var a []int b := []int{} x, _ := json.Marshal(Resp{Items: a}) y,…

Standard Library, HTTP & Systems Design in GoQ460Medium

Scanner: the default max token size is 64 KB ( bufio.MaxScanTokenSize ). A longer line makes Scan() return false, and unless you check sc.Err() (which is…

Standard Library, HTTP & Systems Design in GoQ465Medium

retries := 3 // d := retries * time.Second // compile error: mismatched types int and time.Duration d := time.Duration(retries) * time.Second fmt.Println(d) const n = 3…

Standard Library, HTTP & Systems Design in GoQ469Hard

Classic O(1) LRU: a hash map from key to a node in a doubly linked list ( container/list ); move to front on access, evict from back when over capacity. TTL is checked…

Next topicTricky Output & Code-Review Puzzles