In J.R.R. Tolkien’s The Hobbit, Gollum challenges Bilbo Baggins with riddles beneath the Misty Mountains.
Bilbo encounters Gollum after becoming separated from the Dwarves in the underground passages. Gollum lives beside an underground lake and agrees to a riddle contest with the Hobbit. The contest allows Bilbo to delay danger while searching for a way out.
Bilbo’s accidental discovery of the One Ring changes the encounter. In the original 1937 edition, Tolkien’s presentation of the Ring and Gollum differed from the later version. Tolkien revised the chapter “Riddles in the Dark” so that Bilbo’s possession of the Ring became connected to its corrupting nature and to the history explained in The Lord of the Rings.
Gollum is not the dragon who guards the treasure in The Hobbit. That dragon is Smaug, while Thorin Oakenshield leads the Dwarves. Gollum’s role is tied specifically to the Ring’s earlier history and Bilbo’s escape.