Challenge - 5 Problems
API Mastery: REST, SOAP & GraphQL
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Key difference in data fetching between REST and GraphQL
Which statement best describes how REST and GraphQL differ in data fetching?
Attempts:
2 left
💡 Hint
Think about how flexible the client is in choosing data with each approach.
✗ Incorrect
REST endpoints return fixed data structures, while GraphQL queries let clients specify exactly which fields they want.
❓ Predict Output
intermediate2:00remaining
Output of a SOAP fault response
What is the output when a SOAP service returns a fault response with this XML snippet?
Rest API
<?xml version="1.0"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Client</faultcode> <faultstring>Invalid request</faultstring> </soap:Fault> </soap:Body> </soap:Envelope>
Attempts:
2 left
💡 Hint
Look at the element and its children.
✗ Incorrect
The
❓ Predict Output
advanced2:00remaining
GraphQL query result for nested data
Given this GraphQL query, what is the expected JSON response?
Rest API
query {
user(id: "1") {
name
posts {
title
comments {
text
}
}
}
}Attempts:
2 left
💡 Hint
GraphQL returns exactly the fields requested, including nested objects.
✗ Incorrect
The query asks for user name, posts with titles, and comments with text, so the response includes all nested data.
🧠 Conceptual
advanced2:00remaining
SOAP vs REST protocol characteristics
Which of these is true about SOAP compared to REST?
Attempts:
2 left
💡 Hint
Think about the protocol and message format differences.
✗ Incorrect
SOAP is a protocol with strict standards and XML messages; REST is an architectural style supporting multiple formats and is more flexible.
🧠 Conceptual
expert2:00remaining
Choosing API style for complex client-driven data needs
A mobile app needs to fetch complex, nested data but wants to minimize the number of requests and data size. Which API style is best suited?
Attempts:
2 left
💡 Hint
Consider how each API style handles nested data and request flexibility.
✗ Incorrect
GraphQL lets clients specify nested data in one query, reducing requests and data size. REST often requires multiple calls, SOAP is verbose.