# Reflection (Go) > reflect package, type inspection, value manipulation, struct tags, use cases, performance - 20 interview questions - Senior - [Interview Questions: Go](https://sharpskill.dev/en/technologies/go/interview-questions.md) ## 1. What is the reflect package in Go? **Answer** The reflect package allows inspecting and manipulating types and values at runtime. It is used to implement generic libraries (JSON marshaling, ORM), but its direct use in application code is discouraged as it sacrifices type safety and performance. ## 2. How to get the type of a variable with the reflect package? **Answer** The reflect.TypeOf() function returns a reflect.Type representing the dynamic type of the interface passed as argument. If the variable is nil, reflect.TypeOf() returns nil. Using .Kind() on the returned Type allows getting the type category (int, string, struct, etc.). ## 3. What is the difference between reflect.Type and reflect.Value? **Answer** reflect.Type represents type metadata (name, kind, methods, fields) and is obtained via reflect.TypeOf(). reflect.Value represents the concrete value and allows reading or modifying it via reflect.ValueOf(). Both are complementary: Type describes 'what' and Value contains 'the data'. ## 17 more questions available - How to modify a variable's value via reflection? - What is a reflect.Kind? Sign up for free: https://sharpskill.dev/en/login ## Other Go interview topics - [Go Basics](https://sharpskill.dev/en/technologies/go/interview-questions/go-basics.md): 25 questions, Junior - [Go Data Structures](https://sharpskill.dev/en/technologies/go/interview-questions/go-data-structures.md): 20 questions, Junior - [Go Interfaces](https://sharpskill.dev/en/technologies/go/interview-questions/go-interfaces.md): 18 questions, Junior - [Error Handling](https://sharpskill.dev/en/technologies/go/interview-questions/error-handling.md): 20 questions, Junior - [Goroutines Basics](https://sharpskill.dev/en/technologies/go/interview-questions/goroutines-basics.md): 20 questions, Junior - [Channels](https://sharpskill.dev/en/technologies/go/interview-questions/channels.md): 22 questions, Junior - [Go Modules](https://sharpskill.dev/en/technologies/go/interview-questions/go-modules.md): 18 questions, Mid-Level - [HTTP Server](https://sharpskill.dev/en/technologies/go/interview-questions/http-server.md): 24 questions, Mid-Level - [HTTP Client](https://sharpskill.dev/en/technologies/go/interview-questions/http-client.md): 18 questions, Mid-Level - [JSON Encoding](https://sharpskill.dev/en/technologies/go/interview-questions/json-encoding.md): 20 questions, Mid-Level - [Database/SQL](https://sharpskill.dev/en/technologies/go/interview-questions/database-sql.md): 22 questions, Mid-Level - [Context Package](https://sharpskill.dev/en/technologies/go/interview-questions/context-package.md): 20 questions, Mid-Level - [Testing](https://sharpskill.dev/en/technologies/go/interview-questions/testing.md): 22 questions, Mid-Level - [Concurrency Patterns](https://sharpskill.dev/en/technologies/go/interview-questions/concurrency-patterns.md): 24 questions, Mid-Level - [Sync Primitives](https://sharpskill.dev/en/technologies/go/interview-questions/sync-primitives.md): 22 questions, Mid-Level - [Go Web Frameworks](https://sharpskill.dev/en/technologies/go/interview-questions/go-web-frameworks.md): 20 questions, Mid-Level - [REST API Design](https://sharpskill.dev/en/technologies/go/interview-questions/rest-api-design.md): 20 questions, Mid-Level - [gRPC](https://sharpskill.dev/en/technologies/go/interview-questions/grpc.md): 22 questions, Mid-Level - [Memory Management](https://sharpskill.dev/en/technologies/go/interview-questions/memory-management.md): 24 questions, Senior - [Performance Optimization](https://sharpskill.dev/en/technologies/go/interview-questions/performance-optimization.md): 22 questions, Senior - [Generics](https://sharpskill.dev/en/technologies/go/interview-questions/generics.md): 20 questions, Senior - [Go Design Patterns](https://sharpskill.dev/en/technologies/go/interview-questions/design-patterns.md): 24 questions, Senior - [Microservices](https://sharpskill.dev/en/technologies/go/interview-questions/microservices.md): 24 questions, Senior - [Security & Authentication](https://sharpskill.dev/en/technologies/go/interview-questions/security-authentication.md): 24 questions, Senior - [Docker & Containerization](https://sharpskill.dev/en/technologies/go/interview-questions/docker-containerization.md): 20 questions, Senior - [Kubernetes Basics](https://sharpskill.dev/en/technologies/go/interview-questions/kubernetes-basics.md): 22 questions, Senior - [Advanced Go](https://sharpskill.dev/en/technologies/go/interview-questions/advanced-go.md): 20 questions, Senior - [CLI Development](https://sharpskill.dev/en/technologies/go/interview-questions/cli-development.md): 20 questions, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/en/technologies/go/interview-questions/reflection