Question
Which of the following HTTP methods is idempotent and
used to completely replace a resource on the server?ÂSolution
The HTTP PUT method is idempotent, meaning that making the same request multiple times will result in the same outcome. It is used to completely replace a resource on the server with the provided data. If the resource does not exist, PUT can create it. However, subsequent PUT requests with the same data will not change the state of the resource, ensuring idempotency. Why Other Options are Incorrect: A) GET: The GET method is idempotent but is used to retrieve data, not replace it. B) POST: The POST method is not idempotent, as multiple requests can result in the creation of multiple resources. D) DELETE: While DELETE can be idempotent (deleting the same resource multiple times has no additional effect), it does not replace a resource. E) PATCH: The PATCH method is not idempotent and is used for partial updates to a resource, not complete replacement.
In a 5-stage pipeline (Fetch, Decode, Execute, Memory, Write-back), how many instructions can be in various stages of processing at the same time?
A transformer has a primary coil with 300 turns and a secondary coil with 150 turns. If the primary voltage is 240V, calculate the secondary voltage.
Which of the following is a common problem that synchronization mechanisms address in multi-threaded or multi-process environments?
What happens when a program accesses data that is not currently in physical memory (RAM) due to virtual memory management?
Which of the following is not a valid keyword in C++ language?
XML is designed to ____ and ____ data)
What is the main purpose of a digital signature in public key cryptography?
The best case time complexity of selection sort?
What is the space complexity of an algorithm?
Which functions are declared inside a class have to be defined separately outside the class?