Fundamentals of REST and RESTful Principles Quiz

  1. Resource Identification in REST

    Which of the following best describes how resources are identified in a RESTful API?

    1. By a unique URI
    2. By using HTML tags
    3. By method name
    4. By IP address
    5. By API key
  2. HTTP Method Usage

    If you want to update the details of an existing user in a RESTful system, which HTTP method should typically be used?

    1. PUT
    2. FETCH
    3. SEND
    4. POSTE
    5. REMOVE
  3. Statelessness in REST

    What does it mean for REST to be stateless in communication between client and server?

    1. Each request contains all information needed to understand and process it
    2. The server remembers previous requests
    3. Clients must store server session information
    4. State is shared via cookies only
    5. Sessions are always required
  4. RESTful Response Codes

    Upon successfully creating a new resource, which HTTP status code should a RESTful API usually return?

    1. 201
    2. 301
    3. 404
    4. 500
    5. 202
  5. Uniform Interface

    Which characteristic ensures that the REST architecture has a clearly defined method for clients to interact with resources, regardless of the application?

    1. Uniform interface
    2. Caching
    3. Connectionlessness
    4. Encription
    5. Middleware
  6. Cacheable Responses

    Why is it important for responses in RESTful APIs to be labeled as cacheable or non-cacheable?

    1. To improve performance by allowing client or intermediaries to reuse responses
    2. To restrict methods to only GET and POST
    3. To increase security for sensitive operations
    4. To support direct database access
    5. To require authentication for all responses
  7. Safe and Idempotent Methods

    Which HTTP method is considered both safe and idempotent in RESTful practice?

    1. GET
    2. PATCH
    3. CONNECT
    4. UPDTE
    5. TRACE
  8. Manipulating Collections in REST

    In a RESTful API, which HTTP method would you use to add a new item to a collection such as /books?

    1. POST
    2. REMOVE
    3. PULL
    4. MOV
    5. GET
  9. Representation of Resources

    Which format is commonly used to represent resource data in RESTful APIs for easy human and machine readability?

    1. JSON
    2. JASONN
    3. TXT
    4. JS
    5. CFG
  10. Discoverability in REST

    What principle allows clients to navigate a RESTful API dynamically using provided links in the response?

    1. Hypermedia as the engine of application state
    2. Stateful session tracking
    3. URL encryption
    4. Layered system
    5. Uniform resourc locators