AdvancedCoding~15 min
TypeScript Interface Architect
Write a TypeScript interface for a complex nested API response — handling optional fields, union types, and ISO dates correctly.
Skills Tested
TypeScript typingInterface designUtility types
Challenge Prompt
This is the example prompt structure. Write your own variation below.
Write TypeScript interfaces for this API response:
{
"user": {"id": "uuid", "email": "string", "role": "admin|editor|viewer"},
"subscription": {"plan": "free|pro|enterprise", "expires_at": "ISO8601|null", "seats": number},
"permissions": [{"resource": "string", "actions": ["read","write","delete"]}],
"metadata": {"created_at": "ISO8601", "updated_at": "ISO8601", "tags": string[]}
}
Requirements: (1) use strict TypeScript, no 'any', (2) dates as string with JSDoc comment noting ISO8601, (3) union types for enums, (4) export all interfaces, (5) add one utility type that extracts only the subscription fields.Your Prompt
Write your own version. Every word matters — be specific.
🪙
Reward
+200 GeraCoins
Earn GeraCoins for completing this challenge. Redeem across all Gera products.
Hints (3)
- 1"No any" is the most important constraint — it forces proper typing of all fields.
- 2Utility type requirement (Pick<Subscription, ...>) tests advanced TypeScript knowledge.
- 3JSDoc comments on date fields help future maintainers without changing the type.
Related Topics
TypeScriptinterfaceAPI responsetype safetyutility types
More Coding challenges
View all Coding →Intermediate
Armenian Phone Validator
Generate a regex that correctly validates Armenian mobile phone numbers — covering all network prefixes and the +374 country code.
IntermediateSQL From Schema
Write a prompt that produces a correct, optimised SQL query from a given schema — without any hallucinated column names.
AdvancedFind the Bug
Write a prompt that makes the AI identify ALL bugs in a given broken Python function — without fixing them first.