← 返回 openai 的题目列表Coding: Credit/Bug-free Implementation
类型:online_judge
Implement a core data structure or API for a "credit"-related system, with a strong emphasis on being bug-free.
The exact prompt is interviewer-defined, but it typically asks you to:
Design clear data structures and APIs (e.g., add/spend credits, query balance, time-based expiration, rule-based consumption).
Handle edge cases and invalid inputs.
Meet expected time complexity (often near O(1) or O(log n)).
Produce runnable code and validate it with examples.
Note: the original post did not include the full statement; the interview will provide concrete rules.