Test your Retrofit knowledge with a free interactive quiz — 26 questions with answers and explanations. No signup needed to play.
Question 1/12Score 0
When a Retrofit interface method is declared as a suspend function, what does the caller need in order to invoke it?
In this round
When a Retrofit interface method is declared as a suspend function, what does the caller need in order to invoke it?
How does returning `Response<T>` instead of `T` from a suspend Retrofit method change error handling?
If baseUrl is set to "https://api.example.com/v1/" and an endpoint is declared as `@GET("/users")` (note the leading slash), what typically happens to the final URL?
What is the purpose of baseUrl() in Retrofit.Builder?
A Retrofit interface method is declared as `suspend fun getUser(id: String): User`. If the server responds with HTTP 404, what happens?
Why is it useful to wrap Retrofit calls in a helper like a sealed ApiResult (Success/Error) type rather than letting each call site handle try/catch individually?
What does the @Body annotation do on a Retrofit method parameter?
Why should HttpLoggingInterceptor.Level.BODY generally be disabled in production release builds?
What happens if you add two different JSON converter factories to the same Retrofit.Builder without careful ordering?
What Retrofit feature would you reach for to support returning a different asynchronous wrapper type (e.g. RxJava's Single<T>) instead of Call<T> or a suspend function?
Why might a Kotlin-first project choose Moshi over Gson as its Retrofit converter?
What is a Call<T> return type in a Retrofit interface method used for, compared to a suspend function returning T directly?