Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Create a Go program to demonstrate the use of type assertion with an empty interface.

Medium

Problem Statement

Create a Go program to demonstrate the use of type assertion with an empty interface.

Sample Input

An empty interface holding a value (e.g., "Hello, Go!").

Sample Output

Type: string, Value: Hello, Go!

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
package main import "fmt" func main() { // Demonstrate type assertion with an empty interface }
Log in or sign up to run or submit your code.Log inSign up
Input
An empty interface holding a value (e.g., "Hello, Go!").
Expected Output
Type: string, Value: Hello, Go!