# Serwer HTTP (Go) > net/http, handlers, ServeMux, middleware, request/response, routing, context - 24 pytań z rozmów - Mid-Level - [Pytania z rozmów: Go](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne.md) ## 1. Czym jest pakiet net/http w Go? **Odpowiedź** Pakiet net/http udostępnia funkcjonalność do tworzenia serwerów i klientów HTTP. Zawiera typy takie jak http.Server, http.Handler, http.Request, http.ResponseWriter oraz funkcje takie jak ListenAndServe. To standardowa biblioteka Go dla HTTP, używana w większości aplikacji webowych bez zewnętrznych zależności. ## 2. Jak utworzyć prosty serwer HTTP w Go? **Odpowiedź** Funkcja http.ListenAndServe uruchamia serwer HTTP na danym porcie z handlerem. Przyjmuje dwa parametry: adres (np. ':8080') i handler (może być nil, aby użyć DefaultServeMux). To najprostsza metoda uruchomienia serwera; blokuje wykonanie aż do wystąpienia błędu. ## 3. Czym jest http.Handler w Go? **Odpowiedź** http.Handler to interfejs z jedną metodą ServeHTTP(ResponseWriter, *Request). Każdy typ implementujący tę metodę może obsługiwać żądania HTTP. To podstawowy kontrakt do tworzenia niestandardowych handlerów, middleware i routerów. Wszystkie webowe frameworki Go używają tego interfejsu jako fundamentu. ## Jeszcze 21 dostępnych pytań - Jaka jest różnica między http.Handler a http.HandlerFunc? - Do czego służy http.ServeMux? Zarejestruj się za darmo: https://sharpskill.dev/pl/login ## Inne tematy rekrutacyjne Go - [Podstawy Go](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/go-basics.md): 25 pytań, Junior - [Struktury danych w Go](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/go-data-structures.md): 20 pytań, Junior - [Interfejsy w Go](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/go-interfaces.md): 18 pytań, Junior - [Obsługa błędów](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/error-handling.md): 20 pytań, Junior - [Podstawy goroutines](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/goroutines-basics.md): 20 pytań, Junior - [Channels](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/channels.md): 22 pytań, Junior - [Go Modules](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/go-modules.md): 18 pytań, Mid-Level - [Klient HTTP](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/http-client.md): 18 pytań, Mid-Level - [Kodowanie JSON](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/json-encoding.md): 20 pytań, Mid-Level - [Database/SQL](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/database-sql.md): 22 pytań, Mid-Level - [Pakiet context](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/context-package.md): 20 pytań, Mid-Level - [Testing](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/testing.md): 22 pytań, Mid-Level - [Wzorce współbieżności](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/concurrency-patterns.md): 24 pytań, Mid-Level - [Prymitywy synchronizacji](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/sync-primitives.md): 22 pytań, Mid-Level - [Frameworki webowe Go](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/go-web-frameworks.md): 20 pytań, Mid-Level - [Projektowanie API REST](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/rest-api-design.md): 20 pytań, Mid-Level - [gRPC](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/grpc.md): 22 pytań, Mid-Level - [Reflection](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/reflection.md): 20 pytań, Senior - [Zarządzanie pamięcią](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/memory-management.md): 24 pytań, Senior - [Optymalizacja wydajności](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/performance-optimization.md): 22 pytań, Senior - [Generics](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/generics.md): 20 pytań, Senior - [Go Design Patterns](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/design-patterns.md): 24 pytań, Senior - [Microservices](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/microservices.md): 24 pytań, Senior - [Bezpieczeństwo i uwierzytelnianie](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/security-authentication.md): 24 pytań, Senior - [Docker & Containerization](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/docker-containerization.md): 20 pytań, Senior - [Kubernetes Basics](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/kubernetes-basics.md): 22 pytań, Senior - [Zaawansowany Go](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/advanced-go.md): 20 pytań, Senior - [Tworzenie CLI](https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/cli-development.md): 20 pytań, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/pl/technologies/go/pytania-rekrutacyjne/http-server