Sobes.tech
Junior — Middle+

Counting HTTP status codes during bulk link checking

livecode

Task condition

It is necessary to develop a highly efficient mechanism for processing a huge number of URLs (around a billion). For each address, a ready-made function sendRequest is called, which returns an HTTP response code. After all requests are completed, statistics should be output to the standard output: for each received code, output a line in the format <CODE>: <COUNT>. Implementing the actual request sending is not required – its logic is already hidden in the sendRequest function.

func main() {
    links := make([]string, 10000000000) // here are the links
}

func sendRequest(url string) (code int) {
    // nothing needs to be implemented here
}