# Servidor HTTP (Go) > net/http, handlers, ServeMux, middleware, request/response, routing, context - 24 perguntas de entrevista - Mid-Level - [Perguntas de entrevista: Go](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista.md) ## 1. O que é o pacote net/http em Go? **Resposta** O pacote net/http fornece a funcionalidade para criar servidores e clientes HTTP. Ele inclui tipos como http.Server, http.Handler, http.Request, http.ResponseWriter e funções como ListenAndServe. É a biblioteca padrão de Go para HTTP, usada na maioria das aplicações web sem dependências externas. ## 2. Como criar um servidor HTTP simples em Go? **Resposta** A função http.ListenAndServe inicia um servidor HTTP em uma porta dada com um handler. Ela recebe dois parâmetros: o endereço (ex: ':8080') e um handler (pode ser nil para usar o DefaultServeMux). É o método mais simples para iniciar um servidor, ela bloqueia até que ocorra um erro. ## 3. O que é um http.Handler em Go? **Resposta** Um http.Handler é uma interface com um único método ServeHTTP(ResponseWriter, *Request). Qualquer tipo que implemente esse método pode lidar com requisições HTTP. É o contrato básico para criar handlers personalizados, middleware e routers. Todos os frameworks web de Go usam essa interface como base. ## Mais 21 perguntas disponiveis - Qual é a diferença entre http.Handler e http.HandlerFunc? - Para que serve o http.ServeMux? Cadastre-se gratis: https://sharpskill.dev/pt/login ## Outros temas de entrevista Go - [Fundamentos de Go](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/go-basics.md): 25 perguntas, Junior - [Estruturas de dados em Go](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/go-data-structures.md): 20 perguntas, Junior - [Interfaces em Go](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/go-interfaces.md): 18 perguntas, Junior - [Tratamento de erros](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/error-handling.md): 20 perguntas, Junior - [Goroutines básicas](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/goroutines-basics.md): 20 perguntas, Junior - [Channels](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/channels.md): 22 perguntas, Junior - [Go Modules](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/go-modules.md): 18 perguntas, Mid-Level - [Cliente HTTP](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/http-client.md): 18 perguntas, Mid-Level - [Codificação JSON](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/json-encoding.md): 20 perguntas, Mid-Level - [Database/SQL](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/database-sql.md): 22 perguntas, Mid-Level - [Pacote context](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/context-package.md): 20 perguntas, Mid-Level - [Testing](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/testing.md): 22 perguntas, Mid-Level - [Padrões de concorrência](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/concurrency-patterns.md): 24 perguntas, Mid-Level - [Primitivas de sincronização](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/sync-primitives.md): 22 perguntas, Mid-Level - [Frameworks web Go](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/go-web-frameworks.md): 20 perguntas, Mid-Level - [Design de API REST](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/rest-api-design.md): 20 perguntas, Mid-Level - [gRPC](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/grpc.md): 22 perguntas, Mid-Level - [Reflection](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/reflection.md): 20 perguntas, Senior - [Gerenciamento de memória](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/memory-management.md): 24 perguntas, Senior - [Otimização de desempenho](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/performance-optimization.md): 22 perguntas, Senior - [Generics](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/generics.md): 20 perguntas, Senior - [Go Design Patterns](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/design-patterns.md): 24 perguntas, Senior - [Microservices](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/microservices.md): 24 perguntas, Senior - [Segurança e autenticação](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/security-authentication.md): 24 perguntas, Senior - [Docker & Containerization](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/docker-containerization.md): 20 perguntas, Senior - [Kubernetes Basics](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/kubernetes-basics.md): 22 perguntas, Senior - [Go Avançado](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/advanced-go.md): 20 perguntas, Senior - [Desenvolvimento de CLI](https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/cli-development.md): 20 perguntas, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/pt/technologies/go/perguntas-entrevista/http-server