I don't know what a developer should do, but here's my process:
How do you implement X in lang Y? - Work with the interviewer as if you're pair programming. Even if I totally have no idea about something, I usually say I "don't remember" things about it and come up with some educated guesses about it based on the context they're giving me. Then I start from those assumptions in order to define "X" in great detail, confirming each piece with the interviewer as I go.
If I do it right, the process of discovery/learning from my interviewer looks identical to when I already know the thing, because either way, I am taking care to confirm all my assumptions.
I also always make sure they provide at least a sample input/output so that I have an accurate representation of THEIR assumptions about its behavior. This is a place where newbies will often out-perform mid-level developers, because they're less inclined to make assumptions in an attempt to show off technical skills.
Do you know technology X? - This is an opportunity to have a conversation with the interviewer about what X is and what transferable skills you have from working with other, similar things. Talk about the features of X and how they compare to other offerings out there. Highlight anything that's similar, especially if you can show a deep understanding of the similarities between different technologies. For example, I've been known to talk about the transferability of React/RoR skills in someone with strong CS/OOP basics.
This is a great opportunity to learn more about technology X in general, too! By talking to your interviewer, you'll get a better picture of why they're an enthusiast about the technologies their company is using (or why they're not but it's still "good enough," which is SUPER useful information—nuanced opinions are usually the most informative).
TBQH, by FAR the most successful approach I've taken to interviews is to treat them as an opportunity to learn, and fully lean into the joy of learning.