# REST API 設計 (Go) > REST の原則、バージョニング、ページネーション、フィルタリング、HATEOAS、ステータスコード、OpenAPI/Swagger - 20 面接問題 - Mid-Level - [面接問題: Go](https://sharpskill.dev/ja/technologies/go/interview-questions.md) ## 1. REST の基本原則とは何ですか? **回答** REST は、一意の URI を介してアクセスできるリソースを表現するという原則に基づいています。各リソース(ユーザー、製品、注文)は URI を持ち、標準的な HTTP 動詞(GET、POST、PUT、DELETE)を通じて操作できます。このリソース指向のパラダイムにより、サーバーがクライアントのセッション状態を保存しない、スケーラブルで疎結合なアーキテクチャが実現します。 ## 2. リソースの冪等な完全更新操作にはどの HTTP メソッドを使用すべきですか? **回答** PUT は冪等であり、リソースを完全に置き換えます。同じデータで PUT を複数回呼び出しても、1 回の呼び出しと同じ結果になります。一方、POST は冪等ではなく(複数のリソースを作成してしまう)、PATCH は部分更新を行い、DELETE はリソースを削除します。PUT の冪等性により、ネットワークエラー時のリトライの安全性が保証されます。 ## 3. 新しいリソースの作成に成功した後、どの HTTP コードを返すべきですか? **回答** 201 Created コードは、リソースが正常に作成されたことを示します。新しいリソースの URI を指す Location ヘッダーが付随します。200 OK コードは作成には汎用的すぎ、204 No Content はレスポンスボディがない場合に使用し、202 Accepted はまだ完了していない非同期処理を示します。 ## さらに17問利用可能 - REST API と RPC API を区別する主要な違いは何ですか? - REST における statelessness の原則とは何を意味しますか? 無料で登録: https://sharpskill.dev/ja/login ## その他のGo面接トピック - [Goの基礎](https://sharpskill.dev/ja/technologies/go/interview-questions/go-basics.md): 25問, Junior - [Goのデータ構造](https://sharpskill.dev/ja/technologies/go/interview-questions/go-data-structures.md): 20問, Junior - [Go のインターフェース](https://sharpskill.dev/ja/technologies/go/interview-questions/go-interfaces.md): 18問, Junior - [エラー処理](https://sharpskill.dev/ja/technologies/go/interview-questions/error-handling.md): 20問, Junior - [Goroutine の基礎](https://sharpskill.dev/ja/technologies/go/interview-questions/goroutines-basics.md): 20問, Junior - [Channels](https://sharpskill.dev/ja/technologies/go/interview-questions/channels.md): 22問, Junior - [Go Modules](https://sharpskill.dev/ja/technologies/go/interview-questions/go-modules.md): 18問, Mid-Level - [HTTP サーバー](https://sharpskill.dev/ja/technologies/go/interview-questions/http-server.md): 24問, Mid-Level - [HTTPクライアント](https://sharpskill.dev/ja/technologies/go/interview-questions/http-client.md): 18問, Mid-Level - [JSON エンコーディング](https://sharpskill.dev/ja/technologies/go/interview-questions/json-encoding.md): 20問, Mid-Level - [Database/SQL](https://sharpskill.dev/ja/technologies/go/interview-questions/database-sql.md): 22問, Mid-Level - [context パッケージ](https://sharpskill.dev/ja/technologies/go/interview-questions/context-package.md): 20問, Mid-Level - [Testing](https://sharpskill.dev/ja/technologies/go/interview-questions/testing.md): 22問, Mid-Level - [並行処理パターン](https://sharpskill.dev/ja/technologies/go/interview-questions/concurrency-patterns.md): 24問, Mid-Level - [同期プリミティブ](https://sharpskill.dev/ja/technologies/go/interview-questions/sync-primitives.md): 22問, Mid-Level - [Go Web フレームワーク](https://sharpskill.dev/ja/technologies/go/interview-questions/go-web-frameworks.md): 20問, Mid-Level - [gRPC](https://sharpskill.dev/ja/technologies/go/interview-questions/grpc.md): 22問, Mid-Level - [Reflection](https://sharpskill.dev/ja/technologies/go/interview-questions/reflection.md): 20問, Senior - [メモリ管理](https://sharpskill.dev/ja/technologies/go/interview-questions/memory-management.md): 24問, Senior - [パフォーマンス最適化](https://sharpskill.dev/ja/technologies/go/interview-questions/performance-optimization.md): 22問, Senior - [Generics](https://sharpskill.dev/ja/technologies/go/interview-questions/generics.md): 20問, Senior - [Go Design Patterns](https://sharpskill.dev/ja/technologies/go/interview-questions/design-patterns.md): 24問, Senior - [Microservices](https://sharpskill.dev/ja/technologies/go/interview-questions/microservices.md): 24問, Senior - [セキュリティと認証](https://sharpskill.dev/ja/technologies/go/interview-questions/security-authentication.md): 24問, Senior - [Docker & Containerization](https://sharpskill.dev/ja/technologies/go/interview-questions/docker-containerization.md): 20問, Senior - [Kubernetes Basics](https://sharpskill.dev/ja/technologies/go/interview-questions/kubernetes-basics.md): 22問, Senior - [高度な Go](https://sharpskill.dev/ja/technologies/go/interview-questions/advanced-go.md): 20問, Senior - [CLI開発](https://sharpskill.dev/ja/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/ja/technologies/go/interview-questions/rest-api-design