# The Dog Riddle

DevFeed: [The Dog Riddle](<https://devfeed.tech/articles/the-dog-riddle-27084.md>)

Original publisher: [Read original article](<https://zsmb.co/the-dog-riddle/>)

Author: Márton Braun

Published: 2019-04-25T18:00:00Z

Content type: article

Language: en

Sources: [zsmb.co](<https://devfeed.tech/sources/zsmb-co.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [API](<https://devfeed.tech/topics/api.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [api-design](<https://devfeed.tech/tags/api-design.md>), [code](<https://devfeed.tech/tags/code.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [marton-braun](<https://devfeed.tech/tags/marton-braun.md>), [sealed](<https://devfeed.tech/tags/sealed.md>), [sealed-class](<https://devfeed.tech/tags/sealed-class.md>), [zsmb](<https://devfeed.tech/tags/zsmb.md>), [zsmb-co](<https://devfeed.tech/tags/zsmb-co.md>), [zsmb13](<https://devfeed.tech/tags/zsmb13.md>), [zsmbco](<https://devfeed.tech/tags/zsmbco.md>)

## AI overview

A Kotlin API design challenge asks readers to model cats and dogs, including dogs with optional breeds, while enforcing valid syntax and predictable instance creation. The article discusses submitted solutions, a common singleton-related pitfall, sealed hierarchies, and exhaustive expressions.

## Source excerpt

A fun little challenge in Kotlin API design. Give it a try!