{"id":562,"date":"2026-09-09T09:00:00","date_gmt":"2026-09-09T03:30:00","guid":{"rendered":"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/"},"modified":"2026-11-29T01:30:11","modified_gmt":"2026-11-28T20:00:11","slug":"go-interfaces-interview-questions-part-8","status":"publish","type":"post","link":"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/","title":{"rendered":"Go Interfaces Interview Questions: Type Assertions (Part 8)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">These Go interfaces interview questions cover implicit interfaces, the empty interface, type assertions, type switches, the typed nil trap and interface design. We gathered them from public interview lists, coding rounds and community threads. Then we rewrote them in plain words and grouped them by idea, so you can revise one area at a time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This post is questions only, so answer each one in your own words first. When you need help, read <a href=\"https:\/\/smitabharat.com\/blog\/go-interfaces-examples\/\">Go interfaces explained with examples<\/a> and <a href=\"https:\/\/smitabharat.com\/blog\/go-type-assertion-type-switch\/\">Go type assertion and type switch<\/a>. Also, finish <a href=\"https:\/\/smitabharat.com\/blog\/go-structs-interview-questions-part-7\/\">Part 7 on structs and pointers<\/a> first, because method sets decide which types satisfy an interface.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Use These Go Interfaces Interview Questions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Answer each of these Go interfaces interview questions out loud, then write a tiny program to prove your answer. Interface bugs often hide until a nil value or a wrong type reaches the code at run time. Finally, try the scenario questions, since they come from real production issues.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The table below lists each section and its number of questions.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Section<\/th><th>What it tests<\/th><th>Questions<\/th><\/tr><\/thead><tbody><tr><td>Interface basics<\/td><td>Declaring and satisfying interfaces<\/td><td>15<\/td><\/tr><tr><td>Empty interface and any<\/td><td>any, assertions and type switches<\/td><td>16<\/td><\/tr><tr><td>Interface values and nil<\/td><td>Dynamic type, value and typed nil<\/td><td>15<\/td><\/tr><tr><td>Interface design<\/td><td>Small interfaces and where to define them<\/td><td>16<\/td><\/tr><tr><td>Standard library interfaces<\/td><td>io.Reader, Stringer, error and sort<\/td><td>15<\/td><\/tr><tr><td>Interface coding tasks<\/td><td>Classic interview programs<\/td><td>15<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-diagram-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-diagram-1-1024x640.png\" alt=\"Go Interfaces Interview Questions diagram showing six question areas from interface basics to coding tasks\" class=\"wp-image-533\" srcset=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-diagram-1-1024x640.png 1024w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-diagram-1-300x188.png 300w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-diagram-1-768x480.png 768w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-diagram-1-1536x960.png 1536w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-diagram-1-2048x1280.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">The six areas covered in this question list, from interface basics to coding tasks.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Go Interfaces Interview Questions on the Basics<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before you answer, study <a href=\"https:\/\/smitabharat.com\/blog\/go-interfaces-examples\/\">Go interfaces explained with examples<\/a>. These Go interfaces interview questions check the rules that every Go developer should know by heart.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>What is an interface in Go, and what does it describe?<\/li>\n\n\n<li>How do you declare an interface type with two methods?<\/li>\n\n\n<li>Why does Go use implicit satisfaction instead of an implements keyword?<\/li>\n\n\n<li>What are the benefits of implicit interfaces for large codebases?<\/li>\n\n\n<li>How can a type satisfy two interfaces at the same time?<\/li>\n\n\n<li>Does a type need to list the interfaces it satisfies anywhere in its code?<\/li>\n\n\n<li>What happens at compile time when a type misses one method of an interface?<\/li>\n\n\n<li>How do you check at compile time that a type satisfies an interface, for example with var _ Shape = (*Circle)(nil)?<\/li>\n\n\n<li>Can an interface hold fields, or only methods?<\/li>\n\n\n<li>What is interface embedding, and how does io.ReadWriter use it?<\/li>\n\n\n<li>Why can a value of type T fail to satisfy an interface when the methods use pointer receivers?<\/li>\n\n\n<li>How do method sets of T and *T affect interface satisfaction?<\/li>\n\n\n<li>When would you define an interface with only one method?<\/li>\n\n\n<li>Scenario: when a new struct compiles but does not satisfy the interface you expected, how would you find the missing method fast?<\/li>\n\n\n<li>Scenario: when a teammate adds a method to a widely used interface and many packages break, how would you fix the design?<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Go Interfaces Interview Questions on any and Type Assertions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before you answer, study <a href=\"https:\/\/smitabharat.com\/blog\/go-type-assertion-type-switch\/\">Go type assertion and type switch<\/a>. Interviewers love these Go interfaces interview questions, because one missing ok check can crash a whole service.<\/p>\n\n\n\n<ol start=\"16\" class=\"wp-block-list\">\n<li>What is the empty interface, and why can it hold a value of any type?<\/li>\n\n\n<li>How is any related to interface{}, and since which Go version can you use it?<\/li>\n\n\n<li>When should you avoid any, so that the compiler can still help you?<\/li>\n\n\n<li>What is a type assertion, and what does x.(T) return?<\/li>\n\n\n<li>Why does a failed type assertion panic, while the comma ok form does not?<\/li>\n\n\n<li>How does the comma ok form work, for example v, ok := x.(int)?<\/li>\n\n\n<li>Can you assert to an interface type instead of a concrete type, and then what does it check?<\/li>\n\n\n<li>What is a type switch, and how does its syntax differ from a normal switch?<\/li>\n\n\n<li>Which type does the variable have inside a case that lists two types?<\/li>\n\n\n<li>How do you match a nil interface value inside a type switch?<\/li>\n\n\n<li>Does the order of cases matter in a type switch, for example when one case is an interface?<\/li>\n\n\n<li>Why does a type switch use a default case, and when can you skip it?<\/li>\n\n\n<li>How do JSON values decoded into any look, for example numbers as float64?<\/li>\n\n\n<li>What is the cost of storing a small value such as an int inside any?<\/li>\n\n\n<li>Scenario: when a handler receives any from a queue and must process three message types, how would you write it safely?<\/li>\n\n\n<li>Scenario: when a service panics with interface conversion: interface is string, not int, what went wrong, and how do you fix it?<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Go Interfaces Interview Questions on Interface Values and nil<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before you answer, study <a href=\"https:\/\/smitabharat.com\/blog\/go-error-handling-guide\/\">Go error handling<\/a>, because the error type is the most common interface in Go. Many senior candidates still miss the typed nil trap in these Go interfaces interview questions.<\/p>\n\n\n\n<ol start=\"32\" class=\"wp-block-list\">\n<li>What two parts make up an interface value inside the runtime?<\/li>\n\n\n<li>How does Go decide that an interface value equals nil?<\/li>\n\n\n<li>Why can an interface that holds a nil pointer still compare unequal to nil?<\/li>\n\n\n<li>Explain the typed nil trap with a function that returns error.<\/li>\n\n\n<li>How do you write a function so that it always returns a true nil error?<\/li>\n\n\n<li>Can you call a method on an interface that holds a nil pointer, and when does it panic?<\/li>\n\n\n<li>What happens when you call a method on a nil interface value itself?<\/li>\n\n\n<li>When can you compare two interface values with ==?<\/li>\n\n\n<li>Why does comparing two interfaces that hold slices panic at run time?<\/li>\n\n\n<li>What happens when you use an interface value as a map key, and what can go wrong?<\/li>\n\n\n<li>What is the difference between the static type and the dynamic type of a variable?<\/li>\n\n\n<li>How does fmt print the dynamic type of an interface value with %T?<\/li>\n\n\n<li>Does storing a value in an interface copy it, and what about a pointer?<\/li>\n\n\n<li>Scenario: when a caller sees err != nil but the error message prints as nil, how would you debug it?<\/li>\n\n\n<li>Scenario: when a cache keyed by any panics during a lookup, what would you check first?<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Go Interfaces Interview Questions on Design<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before you answer, study <a href=\"https:\/\/smitabharat.com\/blog\/go-mocking-interfaces-testing\/\">Go mocking with interfaces<\/a> and <a href=\"https:\/\/smitabharat.com\/blog\/go-clean-architecture\/\">Go clean architecture<\/a>. These Go interfaces interview questions test judgement, so explain the trade-off behind each answer.<\/p>\n\n\n\n<ol start=\"47\" class=\"wp-block-list\">\n<li>Why do Go developers prefer small interfaces with one or two methods?<\/li>\n\n\n<li>What does the saying accept interfaces, return structs mean in practice?<\/li>\n\n\n<li>Where should you define an interface, in the package that uses it or the one that implements it?<\/li>\n\n\n<li>How do interfaces help you write unit tests with fakes and mocks?<\/li>\n\n\n<li>When is an interface premature, and how do you spot one in a code review?<\/li>\n\n\n<li>How can you add behaviour to a type without breaking existing interfaces?<\/li>\n\n\n<li>What are optional interfaces, and how does http.Flusher show the idea?<\/li>\n\n\n<li>How do you check at run time whether a value also supports an optional method?<\/li>\n\n\n<li>Why should a constructor usually return a concrete type instead of an interface?<\/li>\n\n\n<li>When does returning an interface from a function still make sense?<\/li>\n\n\n<li>How do interfaces support dependency injection without a framework?<\/li>\n\n\n<li>What is the difference between an interface and a function type, so when would you pick each?<\/li>\n\n\n<li>How does embedding an interface inside a struct help with partial mocks, and what is the risk?<\/li>\n\n\n<li>How do interface constraints in generics change the way you design small interfaces?<\/li>\n\n\n<li>Scenario: when a service struct depends on a big Store interface with twenty methods, how would you split it?<\/li>\n\n\n<li>Scenario: when every package in a project defines its own copy of the same interface, how would you clean it up?<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Interview Questions on Standard Library Interfaces<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before you answer, study <a href=\"https:\/\/smitabharat.com\/blog\/go-io-reader-writer\/\">Go reader and writer interfaces<\/a>. Also, these Go interfaces interview questions show how well you know the interfaces that Go itself uses everywhere.<\/p>\n\n\n\n<ol start=\"63\" class=\"wp-block-list\">\n<li>What methods do io.Reader and io.Writer have, and why are they so small?<\/li>\n\n\n<li>How does io.Copy work with any reader and any writer?<\/li>\n\n\n<li>Which types in the standard library satisfy io.Reader, for example files and network connections?<\/li>\n\n\n<li>What is the fmt.Stringer interface, and when does fmt call it?<\/li>\n\n\n<li>Why can a String method with a value receiver cause infinite recursion when it calls fmt.Sprintf with %v?<\/li>\n\n\n<li>How does the built-in error interface look, and why is it so short?<\/li>\n\n\n<li>What does sort.Interface require, and how does sort.Slice make it easier?<\/li>\n\n\n<li>How does http.Handler let any type serve HTTP requests?<\/li>\n\n\n<li>What is http.HandlerFunc, and how does it turn a function into an interface value?<\/li>\n\n\n<li>Which interface does json.Marshaler define, and when would you implement it?<\/li>\n\n\n<li>How does io.Closer pair with defer in real code?<\/li>\n\n\n<li>What is the purpose of io.ReaderFrom or io.WriterTo in fast copies?<\/li>\n\n\n<li>Why does context.Context use an interface instead of a struct?<\/li>\n\n\n<li>Scenario: when you must count bytes written to an http.ResponseWriter, how would you wrap it?<\/li>\n\n\n<li>Scenario: when a log line shows a struct as a long list of fields, how would you print it in a friendly form?<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Go Interfaces Interview Questions for Coding Rounds<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before you answer, study <a href=\"https:\/\/smitabharat.com\/blog\/go-interfaces-examples\/\">Go interfaces explained with examples<\/a> again, then write each program by hand. Interviewers watch how you name and size the interface, not only whether the code runs.<\/p>\n\n\n\n<ol start=\"78\" class=\"wp-block-list\">\n<li>Write a Shape interface with Area and Perimeter, then implement it for a circle and a rectangle.<\/li>\n\n\n<li>Sum the areas of a slice of different shapes using the Shape interface.<\/li>\n\n\n<li>Write a Notifier interface with email and SMS types, then send one message through both.<\/li>\n\n\n<li>Implement fmt.Stringer for a Money type that prints two decimal places.<\/li>\n\n\n<li>Write a type switch that turns any value into a short description.<\/li>\n\n\n<li>Build a tiny plugin registry that maps names to values of an interface type.<\/li>\n\n\n<li>Write a custom error type and return it through the error interface.<\/li>\n\n\n<li>Implement io.Writer for a type that counts how many bytes it receives.<\/li>\n\n\n<li>Wrap an io.Reader so that it turns every letter to upper case.<\/li>\n\n\n<li>Write a fake Store for a unit test instead of a real database.<\/li>\n\n\n<li>Implement sort.Interface for a slice of employees sorted by age.<\/li>\n\n\n<li>Write a middleware that wraps an http.Handler and logs the request path.<\/li>\n\n\n<li>Create a Cache interface, then write two versions, one in memory and one that does nothing.<\/li>\n\n\n<li>Scenario: when an interviewer asks you to add a new payment method without changing old code, how would you design it with interfaces?<\/li>\n\n\n<li>Scenario: when a test needs a clock that you can control, how would you hide time.Now behind an interface?<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Code Reading Questions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Read each program carefully and predict the output before you run it. Then explain the result in your own words.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport \"fmt\"\n\ntype Shape interface {\n    Area() float64\n}\n\ntype Square struct{ Side float64 }\n\nfunc (s *Square) Area() float64 {\n    if s == nil {\n        return 0\n    }\n    return s.Side * s.Side\n}\n\nfunc find(name string) Shape {\n    var sq *Square\n    if name == \"big\" {\n        sq = &amp;Square{Side: 4}\n    }\n    return sq\n}\n\nfunc main() {\n    a := find(\"big\")\n    b := find(\"small\")\n    fmt.Println(a.Area(), b.Area())\n    fmt.Println(a == nil, b == nil)\n    fmt.Printf(\"%T\\n\", b)\n}<\/code><\/pre>\n\n\n\n<ol start=\"93\" class=\"wp-block-list\">\n<li>What do the three print lines show, and why is b not equal to nil?<\/li>\n\n\n<li>How would you change find so that the caller can compare the result with nil safely?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The second program mixes a type switch, a Stringer and the comma ok form.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package main\n\nimport \"fmt\"\n\ntype Celsius float64\n\nfunc (c Celsius) String() string {\n    return fmt.Sprintf(\"%.1f C\", float64(c))\n}\n\nfunc describe(v any) string {\n    switch x := v.(type) {\n    case nil:\n        return \"nil\"\n    case fmt.Stringer:\n        return \"stringer: \" + x.String()\n    case int, int64:\n        return fmt.Sprintf(\"integer %v\", x)\n    case error:\n        return \"error: \" + x.Error()\n    default:\n        return fmt.Sprintf(\"other %T\", x)\n    }\n}\n\nfunc main() {\n    fmt.Println(describe(Celsius(21.5)))\n    fmt.Println(describe(42))\n    fmt.Println(describe(fmt.Errorf(\"disk full\")))\n    fmt.Println(describe(nil))\n    fmt.Println(describe([]int{1}))\n    n, ok := any(3.5).(int)\n    fmt.Println(n, ok)\n}<\/code><\/pre>\n\n\n\n<ol start=\"95\" class=\"wp-block-list\">\n<li>Which case runs for each call to describe, and what is the type of x in the int, int64 case?<\/li>\n\n\n<li>Why does the last line print 0 false instead of a panic?<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Quick Revision Table for Go Interfaces<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use the table below as a final check before your interview. It compares the two ways to read the type inside an interface.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Point<\/th><th>Type assertion<\/th><th>Type switch<\/th><\/tr><\/thead><tbody><tr><td>Syntax<\/td><td>v, ok := x.(T)<\/td><td>switch v := x.(type)<\/td><\/tr><tr><td>Types checked<\/td><td>One<\/td><td>Many, in order<\/td><\/tr><tr><td>On a miss<\/td><td>Panics without ok<\/td><td>Falls to default<\/td><\/tr><tr><td>Matches nil<\/td><td>No<\/td><td>Yes, with case nil<\/td><\/tr><tr><td>Variable type<\/td><td>Always T<\/td><td>Depends on the case<\/td><\/tr><tr><td>Best for<\/td><td>One expected type<\/td><td>Several possible types<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Also, many interviewers ask you to compare these two tools directly. The diagram below shows the difference side by side.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-diagram-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-diagram-2-1024x640.png\" alt=\"Go interfaces diagram comparing a type assertion with a type switch\" class=\"wp-image-534\" srcset=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-diagram-2-1024x640.png 1024w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-diagram-2-300x188.png 300w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-diagram-2-768x480.png 768w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-diagram-2-1536x960.png 1536w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-diagram-2-2048x1280.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">A type assertion checks one type, while a type switch checks many types in order.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Official Resources<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">These official pages explain the rules behind these questions.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/go.dev\/ref\/spec#Interface_types\">Go specification: Interface types<\/a><\/li>\n\n\n<li><a href=\"https:\/\/go.dev\/tour\/methods\/9\">A Tour of Go: Interfaces<\/a><\/li>\n\n\n<li><a href=\"https:\/\/go.dev\/doc\/effective_go#interfaces_and_types\">Effective Go: Interfaces and other types<\/a><\/li>\n\n\n<li><a href=\"https:\/\/go.dev\/doc\/faq#nil_error\">Go FAQ: Why is my nil error value not equal to nil?<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Quick Recap<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>These Go interfaces interview questions cover basics, any, nil values, design, standard interfaces and coding tasks.<\/li>\n\n\n<li>A type satisfies an interface when it has all the methods, with no implements keyword.<\/li>\n\n\n<li>An interface value holds a dynamic type and a value, so a typed nil is not nil.<\/li>\n\n\n<li>Use the comma ok form or a type switch, because a plain failed assertion panics.<\/li>\n\n\n<li>Keep interfaces small and define them where you use them.<\/li>\n\n\n<li>Know io.Reader, io.Writer, error, fmt.Stringer and http.Handler well.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s Next?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">By now, you have Go interfaces interview questions for every part of interfaces and types. Study the answers in your own notes, then check them against the <a href=\"https:\/\/smitabharat.com\/blog\/go-interview-topics-study-guide\/\">Go interview topics study guide<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next up: <a href=\"https:\/\/smitabharat.com\/blog\/go-error-handling-questions-part-9\/\">Go error handling interview questions (Part 9)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>These Go interfaces interview questions cover implicit interfaces, the empty interface, type assertions, type switches, the typed nil trap and interface design. We gathered&hellip;<\/p>\n","protected":false},"author":1,"featured_media":532,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_swapz_level":"","_swapz_series_part":0,"_swapz_hide_toc":false,"_swapz_hide_featured":false,"_swapz_description":"","footnotes":""},"categories":[10],"tags":[33,95,11,50,77],"swapz_series":[],"class_list":["post-562","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-interview","tag-go-interfaces","tag-go-interview-questions","tag-go-lang","tag-go-type-assertion","tag-intermediate"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Go Interfaces Interview Questions: Type Assertions<\/title>\n<meta name=\"description\" content=\"Practise 96 Go interfaces interview questions on implicit interfaces, any, type assertions, type switches, typed nil and design, plus real scenarios.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Go Interfaces Interview Questions: Type Assertions\" \/>\n<meta property=\"og:description\" content=\"Practise 96 Go interfaces interview questions on implicit interfaces, any, type assertions, type switches, typed nil and design, plus real scenarios.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/\" \/>\n<meta property=\"og:site_name\" content=\"Smita Bharat - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-09T03:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-28T20:00:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-featured.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Smita\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Smita\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-interfaces-interview-questions-part-8\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-interfaces-interview-questions-part-8\\\/\"},\"author\":{\"name\":\"Smita\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\"},\"headline\":\"Go Interfaces Interview Questions: Type Assertions (Part 8)\",\"datePublished\":\"2026-09-09T03:30:00+00:00\",\"dateModified\":\"2026-11-28T20:00:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-interfaces-interview-questions-part-8\\\/\"},\"wordCount\":2146,\"publisher\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\"},\"image\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-interfaces-interview-questions-part-8\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-interfaces-interview-questions-part-8-featured.png\",\"keywords\":[\"Go Interfaces\",\"Go Interview Questions\",\"Go Lang\",\"Go Type Assertion\",\"Intermediate\"],\"articleSection\":[\"Interview\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-interfaces-interview-questions-part-8\\\/\",\"url\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-interfaces-interview-questions-part-8\\\/\",\"name\":\"Go Interfaces Interview Questions: Type Assertions\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-interfaces-interview-questions-part-8\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-interfaces-interview-questions-part-8\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-interfaces-interview-questions-part-8-featured.png\",\"datePublished\":\"2026-09-09T03:30:00+00:00\",\"dateModified\":\"2026-11-28T20:00:11+00:00\",\"description\":\"Practise 96 Go interfaces interview questions on implicit interfaces, any, type assertions, type switches, typed nil and design, plus real scenarios.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-interfaces-interview-questions-part-8\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-interfaces-interview-questions-part-8\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-interfaces-interview-questions-part-8\\\/#primaryimage\",\"url\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-interfaces-interview-questions-part-8-featured.png\",\"contentUrl\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-interfaces-interview-questions-part-8-featured.png\",\"width\":2400,\"height\":1260,\"caption\":\"Go Interfaces Interview Questions featured image: reader, type switch and typed nil cards\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-interfaces-interview-questions-part-8\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Go Interfaces Interview Questions: Type Assertions (Part 8)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/\",\"name\":\"Smita Bharat Blog\",\"description\":\"Golang &amp; Backend Development Tutorials and Interview Questions\",\"publisher\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\"},\"alternateName\":\"Smita Bharat\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\",\"name\":\"Smita\",\"logo\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/smitabharat.com\\\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Go Interfaces Interview Questions: Type Assertions","description":"Practise 96 Go interfaces interview questions on implicit interfaces, any, type assertions, type switches, typed nil and design, plus real scenarios.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/","og_locale":"en_US","og_type":"article","og_title":"Go Interfaces Interview Questions: Type Assertions","og_description":"Practise 96 Go interfaces interview questions on implicit interfaces, any, type assertions, type switches, typed nil and design, plus real scenarios.","og_url":"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/","og_site_name":"Smita Bharat - Blog","article_published_time":"2026-09-09T03:30:00+00:00","article_modified_time":"2026-11-28T20:00:11+00:00","og_image":[{"width":2400,"height":1260,"url":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-featured.png","type":"image\/png"}],"author":"Smita","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Smita","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/#article","isPartOf":{"@id":"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/"},"author":{"name":"Smita","@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339"},"headline":"Go Interfaces Interview Questions: Type Assertions (Part 8)","datePublished":"2026-09-09T03:30:00+00:00","dateModified":"2026-11-28T20:00:11+00:00","mainEntityOfPage":{"@id":"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/"},"wordCount":2146,"publisher":{"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339"},"image":{"@id":"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/#primaryimage"},"thumbnailUrl":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-featured.png","keywords":["Go Interfaces","Go Interview Questions","Go Lang","Go Type Assertion","Intermediate"],"articleSection":["Interview"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/","url":"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/","name":"Go Interfaces Interview Questions: Type Assertions","isPartOf":{"@id":"https:\/\/smitabharat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/#primaryimage"},"image":{"@id":"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/#primaryimage"},"thumbnailUrl":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-featured.png","datePublished":"2026-09-09T03:30:00+00:00","dateModified":"2026-11-28T20:00:11+00:00","description":"Practise 96 Go interfaces interview questions on implicit interfaces, any, type assertions, type switches, typed nil and design, plus real scenarios.","breadcrumb":{"@id":"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/#primaryimage","url":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-featured.png","contentUrl":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-interfaces-interview-questions-part-8-featured.png","width":2400,"height":1260,"caption":"Go Interfaces Interview Questions featured image: reader, type switch and typed nil cards"},{"@type":"BreadcrumbList","@id":"https:\/\/smitabharat.com\/blog\/go-interfaces-interview-questions-part-8\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/smitabharat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Go Interfaces Interview Questions: Type Assertions (Part 8)"}]},{"@type":"WebSite","@id":"https:\/\/smitabharat.com\/blog\/#website","url":"https:\/\/smitabharat.com\/blog\/","name":"Smita Bharat Blog","description":"Golang &amp; Backend Development Tutorials and Interview Questions","publisher":{"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339"},"alternateName":"Smita Bharat","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/smitabharat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339","name":"Smita","logo":{"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/smitabharat.com\/blog"]}]}},"_links":{"self":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts\/562","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/comments?post=562"}],"version-history":[{"count":1,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts\/562\/revisions"}],"predecessor-version":[{"id":1013,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts\/562\/revisions\/1013"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/media\/532"}],"wp:attachment":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/media?parent=562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/categories?post=562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/tags?post=562"},{"taxonomy":"swapz_series","embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/swapz_series?post=562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}