21.) What is the most efficient way to handle large JSON datasets in memory-constrained environments?
A) Load the entire JSON at once
B) Use streaming APIs to process JSON incrementally
C) Convert JSON to XML first
D) Remove all nested objects
22.) What is the best approach to log sensitive information within JSON responses?
A) Use a secure logging framework and mask sensitive data
B) Log the raw JSON data as is
C) Use JSON.stringify()
D) Avoid logging altogether
23.) Why is it important to validate JSON data received from external sources?
A) To improve parsing speed
B) To convert JSON into JavaScript objects
C) To compress JSON
D) To prevent unexpected errors and security vulnerabilities
24.) What does the Content-Security-Policy header do for JSON responses?
A) Specifies how JSON is cached
B) Defines the format of JSON data
C) Ensures JSON is minified
D) Restricts where JSON can be loaded from to prevent cross-site scripting (XSS) attacks
25.) Why is it important to remove unused fields from JSON responses?
A) To avoid key duplication
B) To reduce payload size and improve performance
C) To enhance JSON readability
D) To prevent JSON schema validation errors
Related