# 동시성 패턴 (Go) > Worker pool, pipeline, fan-out/fan-in, 취소, context, errgroup, 세마포어 - 24 면접 질문 - Mid-Level - [면접 질문: Go](https://sharpskill.dev/ko/technologies/go/interview-questions.md) ## 1. Go에서 worker pool이란 무엇인가요? **답변** worker pool은 고정된 수의 goroutine(worker)을 사용하여 공유 channel에서 오는 작업을 처리하는 동시성 패턴입니다. 이 패턴을 사용하면 활성 goroutine 수를 제한하고 시스템 리소스 소비를 제어할 수 있습니다. 작업마다 goroutine을 하나씩 생성하는 것과 달리, worker pool은 일련의 worker를 재사용하여 대량의 작업을 효율적으로 처리합니다. ## 2. 작업마다 goroutine을 생성하는 대신 worker pool을 사용하는 주된 이점은 무엇인가요? **답변** 활성 goroutine 수를 제한하면 시스템 리소스(메모리와 CPU) 소비를 제어하고 과부하를 방지할 수 있습니다. 작업마다 goroutine을 생성하면 수천 또는 수백만 개의 동시 goroutine이 발생하여 scheduler를 포화시키고 메모리를 고갈시킬 수 있습니다. worker pool은 최적의 worker 수를 유지하며 작업을 순차적으로 처리하여 높은 부하에서도 예측 가능한 성능을 보장합니다. ## 3. Go의 동시성 맥락에서 pipeline이란 무엇인가요? **답변** pipeline은 channel로 연결된 일련의 단계(stage)이며, 각 단계는 동일한 함수를 실행하는 goroutine 그룹입니다. 각 단계는 입력 channel을 통해 데이터를 받고, 처리를 수행한 후 출력 channel을 통해 결과를 보냅니다. 이 패턴을 사용하면 복잡한 처리를 단순하고 재사용 가능한 단계로 분해할 수 있어 각 구성 요소를 독립적으로 조합하고 테스트하기 쉬워집니다. ## 21개 추가 질문 이용 가능 - 처리 종료를 알리기 위해 worker pool에서 channel을 올바르게 닫으려면 어떻게 해야 하나요? - fan-out과 fan-in의 차이는 무엇인가요? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 Go 면접 주제 - [Go 기초](https://sharpskill.dev/ko/technologies/go/interview-questions/go-basics.md): 25개 질문, Junior - [Go 데이터 구조](https://sharpskill.dev/ko/technologies/go/interview-questions/go-data-structures.md): 20개 질문, Junior - [Go 인터페이스](https://sharpskill.dev/ko/technologies/go/interview-questions/go-interfaces.md): 18개 질문, Junior - [에러 처리](https://sharpskill.dev/ko/technologies/go/interview-questions/error-handling.md): 20개 질문, Junior - [Goroutine 기초](https://sharpskill.dev/ko/technologies/go/interview-questions/goroutines-basics.md): 20개 질문, Junior - [Channels](https://sharpskill.dev/ko/technologies/go/interview-questions/channels.md): 22개 질문, Junior - [Go Modules](https://sharpskill.dev/ko/technologies/go/interview-questions/go-modules.md): 18개 질문, Mid-Level - [HTTP 서버](https://sharpskill.dev/ko/technologies/go/interview-questions/http-server.md): 24개 질문, Mid-Level - [HTTP 클라이언트](https://sharpskill.dev/ko/technologies/go/interview-questions/http-client.md): 18개 질문, Mid-Level - [JSON 인코딩](https://sharpskill.dev/ko/technologies/go/interview-questions/json-encoding.md): 20개 질문, Mid-Level - [Database/SQL](https://sharpskill.dev/ko/technologies/go/interview-questions/database-sql.md): 22개 질문, Mid-Level - [context 패키지](https://sharpskill.dev/ko/technologies/go/interview-questions/context-package.md): 20개 질문, Mid-Level - [Testing](https://sharpskill.dev/ko/technologies/go/interview-questions/testing.md): 22개 질문, Mid-Level - [동기화 프리미티브](https://sharpskill.dev/ko/technologies/go/interview-questions/sync-primitives.md): 22개 질문, Mid-Level - [Go 웹 프레임워크](https://sharpskill.dev/ko/technologies/go/interview-questions/go-web-frameworks.md): 20개 질문, Mid-Level - [REST API 설계](https://sharpskill.dev/ko/technologies/go/interview-questions/rest-api-design.md): 20개 질문, Mid-Level - [gRPC](https://sharpskill.dev/ko/technologies/go/interview-questions/grpc.md): 22개 질문, Mid-Level - [Reflection](https://sharpskill.dev/ko/technologies/go/interview-questions/reflection.md): 20개 질문, Senior - [메모리 관리](https://sharpskill.dev/ko/technologies/go/interview-questions/memory-management.md): 24개 질문, Senior - [성능 최적화](https://sharpskill.dev/ko/technologies/go/interview-questions/performance-optimization.md): 22개 질문, Senior - [Generics](https://sharpskill.dev/ko/technologies/go/interview-questions/generics.md): 20개 질문, Senior - [Go Design Patterns](https://sharpskill.dev/ko/technologies/go/interview-questions/design-patterns.md): 24개 질문, Senior - [Microservices](https://sharpskill.dev/ko/technologies/go/interview-questions/microservices.md): 24개 질문, Senior - [보안 및 인증](https://sharpskill.dev/ko/technologies/go/interview-questions/security-authentication.md): 24개 질문, Senior - [Docker & Containerization](https://sharpskill.dev/ko/technologies/go/interview-questions/docker-containerization.md): 20개 질문, Senior - [Kubernetes Basics](https://sharpskill.dev/ko/technologies/go/interview-questions/kubernetes-basics.md): 22개 질문, Senior - [고급 Go](https://sharpskill.dev/ko/technologies/go/interview-questions/advanced-go.md): 20개 질문, Senior - [CLI 개발](https://sharpskill.dev/ko/technologies/go/interview-questions/cli-development.md): 20개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/go/interview-questions/concurrency-patterns