MCQs / Computer Science / Web Services: Accessing and Creating
Web Services: Accessing and Creating MCQs — Computer Science 35 multiple-choice questions on Web Services: Accessing and Creating from Computer Science, each with the correct answer and, where available, a teacher's explanation. Read through them to revise the chapter, then practise the same questions one by one to test yourself.
1. Which method and status code are typical for successfully creating a resource? PUT, 404 DELETE, 204 POST, 201 Created GET, 200 Answer: C) POST, 201 Created
Explanation: Creation with POST returns 201.
Discuss this question
2. A permanent two-way connection used for live chat is provided by: WebSockets WSDL REST polling only SharedPreferences Answer: A) WebSockets
Explanation: WebSockets keep an open bidirectional connection.
Discuss this question
3. Which free fake API is used in this course to practise GET requests? maps.google.com JSONPlaceholder localhost:8080 api.android.com Answer: B) JSONPlaceholder
Explanation: jsonplaceholder.typicode.com returns sample JSON.
Discuss this question
4. REST stands for: REpresentational State Transfer Resource Entry State Table Reliable Encrypted Socket Transfer Remote Execution Service Technology Answer: A) REpresentational State Transfer
Explanation: REST was defined by Roy Fielding in 2000.
Discuss this question
5. /api/v1/students includes v1 to support: API versioning Pagination Encryption Authentication Answer: A) API versioning
Explanation: Versioning allows changes without breaking old apps.
Discuss this question
6. Which HTTP method is NOT idempotent? POST PUT GET DELETE Answer: A) POST
Explanation: Repeating POST may create duplicates.
Discuss this question
7. From the Android emulator, the developer computer's localhost is reached at: 10.0.2.2 192.168.0.1 0.0.0.0 127.0.0.1 Answer: A) 10.0.2.2
Explanation: 10.0.2.2 is the emulator's alias for the host loopback interface.
Discuss this question
8. On Android, tokens should be encrypted using the: strings.xml file Android Keystore system res/raw folder Logcat Answer: B) Android Keystore system
Explanation: The Keystore protects cryptographic keys.
Discuss this question
9. A token sent with each request in the header usually looks like: Host: token Cookie: password=1234 Content-Type: token Authorization: Bearer eyJhbGciOi... Answer: D) Authorization: Bearer eyJhbGciOi...
Explanation: Bearer tokens (often JWT) authenticate API requests.
Discuss this question
10. OpenAPI (Swagger) is used to: Encrypt APIs Document APIs and provide interactive testing pages Compile Kotlin Host databases Answer: B) Document APIs and provide interactive testing pages
Explanation: OpenAPI describes endpoints, parameters and responses.
Discuss this question
11. A successful DELETE that returns no body usually responds with: 500 301 204 No Content 200 with HTML Answer: C) 204 No Content
Explanation: 204 indicates success without content.
Discuss this question
12. Which tool is widely used to test API endpoints by sending requests manually? Logcat Postman Figma Gradle Answer: B) Postman
Explanation: Postman sends HTTP requests and shows responses.
Discuss this question
13. REST is best described as a: Database Programming language Architectural style Protocol Answer: C) Architectural style
Explanation: REST is a set of architectural constraints, not a protocol.
Discuss this question
14. A web service is mainly designed for: Machine-to-machine communication over a network Drawing layouts Storing preferences on the phone Designing app icons Answer: A) Machine-to-machine communication over a network
Explanation: Web services let programs exchange data over the web.
Discuss this question
15. Before an API is used by a real app it should be deployed with: HTTP only No domain HTTPS on a public server or cloud platform A WSDL file only Answer: C) HTTPS on a public server or cloud platform
Explanation: Production APIs must be reachable over HTTPS.
Discuss this question
16. Firebase and Supabase are examples of: IDEs Backend-as-a-Service (BaaS) platforms Mobile operating systems Programming languages Answer: B) Backend-as-a-Service (BaaS) platforms
Explanation: BaaS platforms provide databases, auth and APIs without writing a full server.
Discuss this question
17. Which API technology lets the client request exactly the fields it needs? FTP SMTP SOAP GraphQL Answer: D) GraphQL
Explanation: GraphQL queries specify the required fields.
Discuss this question
18. Which of these is a popular JavaScript framework for building REST APIs? Jetpack Compose Express (Node.js) Retrofit Room Answer: B) Express (Node.js)
Explanation: Express runs on Node.js to build web servers and APIs.
Discuss this question
19. Which Python framework is commonly used to build REST APIs? ASP.NET Spring Boot Django REST Framework / FastAPI / Flask Laravel Answer: C) Django REST Framework / FastAPI / Flask
Explanation: Python has several API frameworks.
Discuss this question
20. Why should secret API keys not be stored inside the APK? Google Play rejects all strings Keys slow down the app APKs cannot hold strings APKs can be decompiled and the keys extracted Answer: D) APKs can be decompiled and the keys extracted
Explanation: Secrets in the client are not secure; keep them on the server.
Discuss this question
21. "Sign in with Google" is based on which standard? FTP SMTP SOAP OAuth 2.0 / OpenID Connect Answer: D) OAuth 2.0 / OpenID Connect
Explanation: OAuth 2.0 and OpenID Connect handle delegated authentication.
Discuss this question
22. In res.status(201).json(item), 201 tells the client that: The resource was deleted Authentication is needed A new resource was created The request failed Answer: C) A new resource was created
Explanation: 201 Created confirms creation.
Discuss this question
23. Which is TRUE about REST compared with SOAP? REST cannot use HTTP REST needs WSDL REST only uses XML REST is lighter, usually uses JSON and is better suited to mobile apps Answer: D) REST is lighter, usually uses JSON and is better suited to mobile apps
Explanation: REST's lightweight JSON messages suit mobile networks.
Discuss this question
24. Which OkHttp feature can add an Authorization header to every request automatically? Interceptor Converter Dispatcher Adapter Answer: A) Interceptor
Explanation: Interceptors modify requests and responses.
Discuss this question
25. GET /api/students?semester=5&page=2 uses query parameters for: Creating a record Deleting records Authentication Filtering and pagination Answer: D) Filtering and pagination
Explanation: Query strings filter and paginate lists.
Discuss this question
Page 1 of 2 Next
Practise Web Services: Accessing and Creating MCQs
More Computer Science chapters