Lesson 4.9.4.10
4.9.4.10 Client server model Quiz: AQA Computer Science, Unit 9
20 questions
In partnership with Revision Ninja
Lesson 4.9.4.10, Client server model: 20 multiple choice questions for the AQA Computer Science (7517), Unit 9: Fundamentals of communication and networking, written with Revision Ninja.
Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.
The 20 questions
-
In the client server model, what does the client send and what does the server return?
- Both sides send requests at the same time and no response is required.
- The server sends a request message and the client returns a response message to the server, which then closes the connection straight away.
- The client sends a response, and the server sends the request in return.
- The client sends a request message and the server responds with a response message.
-
What does the WebSocket protocol provide?
- A connection that opens and closes after every single web page request.
- A full-duplex connection over TCP that stays open, allowing both client and server to send data at any time.
- A method of sending email messages using a persistent connection to port 25.
- A one-way connection in which only the server can send data to the client.
-
Why is WebSocket used in applications such as live chat or live sports scores?
- Because it stops the client from sending any requests to the server at all.
- Because the server can push updates to the client immediately, without the client repeatedly asking for them.
- Because it encrypts every message, which is not possible with ordinary HTTP.
- Because it stores each message in a database before sending it to the client.
-
What do the letters in CRUD stand for?
- Connect, Read, Upload and Download, which are the four operations that a web application uses when it sends files to a server.
- Create, Retrieve, Update and Delete.
- Copy, Remove, Undo and Display.
- Compile, Run, Use and Discard.
-
In a REST API, which HTTP method maps to the SQL SELECT statement?
- DELETE
- GET
- PUT
- POST
-
Which HTTP method is mapped to the SQL INSERT statement in a REST API?
- PUT
- GET
- DELETE
- POST
-
Which REST methods map to DELETE and UPDATE?
- DELETE maps to UPDATE and PUT maps to DELETE, because a delete removes a value from a row while a put adds a brand new row to it.
- GET maps to DELETE and POST maps to UPDATE.
- POST maps to DELETE and GET maps to UPDATE.
- DELETE maps to DELETE and PUT maps to UPDATE.
-
A JavaScript page needs to fetch a list of products from a server using REST. Which method and SQL statement correspond?
- POST, which maps to INSERT.
- PUT, which maps to UPDATE.
- DELETE, which maps to DELETE.
- GET, which maps to SELECT.
-
An API request is made to remove a customer record from the database. Which HTTP method is most appropriate?
- DELETE
- POST
- GET
- PUT
-
A REST client needs to change the address stored for an existing customer. Which HTTP method and SQL statement fit this?
- POST, which maps to an SQL INSERT statement.
- GET, which maps to an SQL SELECT statement.
- PUT, which maps to an SQL UPDATE statement.
- DELETE, which maps to an SQL DELETE statement.
-
Which format is easier for a human to read than XML and is more compact?
- YAML with full document markers
- XML with nested tags and namespaces
- JSON (JavaScript Object Notation)
- Binary data stored in a packed format
-
Which JSON fragment represents a single customer with a name and an age?
- customer(name=Ada, age=36)
- <customer><name>Ada</name><age>36</age></customer>
- {"name": "Ada", "age": 36}
- name Ada age 36 end
-
Why is JSON generally quicker for a computer to parse than XML?
- It is stored in a relational database, which removes the need for parsing.
- It is always compressed by the browser before being sent over the network, which is why it is always smaller than the equivalent XML.
- It uses binary encoding so that no characters need to be read at all.
- It has less markup overhead, so fewer characters must be read and interpreted.
-
What does REST stand for?
- Relational Entity Storage and Transfer
- Representational State Transfer
- Remote Execution of Structured Tasks
- Real-time Event Stream Transport
-
In a web application, what runs in the browser and what runs on the server?
- Neither runs on the server, as all data is stored in the HTML file.
- JavaScript in the browser calls an API that runs on the server.
- The API runs in the browser and the JavaScript runs on the server.
- Both the JavaScript and the API run only on the user's device.
-
Which format is commonly used to send data between a REST API and a web application's JavaScript?
- JSON
- Plain text with no structure
- Source code of a compiled program
- Raw binary images only
-
Why would a live chat application use WebSocket instead of repeated HTTP requests?
- Because HTTP cannot send any data from the client to the server.
- Because WebSocket stores each message in a local file on the client.
- A persistent full-duplex connection avoids constant new requests and lets the server push messages to clients.
- Because WebSocket is the only protocol that can carry text messages at all.
-
In the client server model, which component starts an exchange?
- Whichever side has the larger amount of data.
- The server.
- The router that connects the two.
- The client.
-
Why should a web application use POST rather than GET to add a new record?
- GET requests cannot be sent by a JavaScript program running in a browser.
- GET is encrypted by default, so it cannot be used for sensitive data.
- GET is limited to 1 kilobyte of data, so POST is always needed for records.
- GET is intended to retrieve data without changing the server, whereas POST is used to create a new resource.
-
What is the main difference between a WebSocket connection and a standard HTTP exchange?
- A WebSocket cannot carry text while HTTP can carry only binary files.
- A WebSocket sends only encrypted data while HTTP sends only plain text.
- A WebSocket uses port 25 while HTTP uses port 80 for all of its messages.
- A WebSocket keeps one connection open for two-way messages, whereas HTTP follows a request and response pattern for each exchange.
Related quizzes
- Data types Quiz · 4.1.1.1 · 20 questions
- Entity relationship modelling Quiz · 4.10.1.1 · 20 questions
- Big Data Quiz · 4.11.1.1 · 20 questions
- Function types and first-class objects Quiz · 4.12.1.1 · 20 questions
- Analysis Quiz · 4.13.1.1 · 20 questions
- Data structures and abstract data types Quiz · 4.2.1.1 · 20 questions
- Breadth-first and depth-first search Quiz · 4.3.1.1 · 20 questions
- Problem-solving and algorithms Quiz · 4.4.1.1 · 20 questions
- Natural, rational, irrational and real numbers Quiz · 4.5.1.1 · 20 questions
- Programming concepts: sequence, selection and iteration Quiz · 4.1.1.2 · 20 questions