Bird
0
0

You have a REST API that returns dates in different formats like '2023-06-01' and '06/01/2023'. What is the main problem with this inconsistency?

medium📝 Debug Q14 of 15
Rest API - Request and Response Format
You have a REST API that returns dates in different formats like '2023-06-01' and '06/01/2023'. What is the main problem with this inconsistency?
AClients may misinterpret or fail to parse dates correctly.
BThe API response size increases significantly.
CThe server will crash when sending mixed formats.
DThe dates will always be interpreted as strings.
Step-by-Step Solution
Solution:
  1. Step 1: Identify the effect of mixed date formats

    Different date formats confuse clients parsing the date values.
  2. Step 2: Understand client parsing behavior

    Clients may misinterpret dates or throw errors if format is unexpected.
  3. Final Answer:

    Clients may misinterpret or fail to parse dates correctly. -> Option A
  4. Quick Check:

    Mixed date formats cause parsing errors = A [OK]
Quick Trick: Use one date format to avoid client parsing errors [OK]
Common Mistakes:
  • Thinking response size is the main issue
  • Assuming server crashes on format inconsistency
  • Believing all clients treat dates as strings

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes