Oracle Associate Developer PYQs Guide
Oracle Associate Developer PYQs Guide
HTTP methods like GET, POST, PUT, and DELETE have distinct purposes and are integral to REST API design. GET requests are used to retrieve data from a server; they are safe and idempotent, meaning repeated requests do not alter server state. POST requests are employed to send data to a server to create or update resources, altering the server state with each call. However, they lack inherent idempotency. PUT requests replace all current representations of the target resource with the uploaded content, thus each request having the same effect is idempotent. DELETE requests remove resources and, like PUT, are idempotent. These methods together form the CRUD (Create, Read, Update, Delete) operations critical for API functionality .
The four pillars of OOP—encapsulation, inheritance, polymorphism, and abstraction—promote better programming practices by encouraging higher modularity and flexibility. Encapsulation ensures data protection and reduces system complexity by keeping state details hidden from the outside. Inheritance facilitates code reuse, allowing developers to extend existing codebases without duplicating code. Polymorphism enables a unified interface to different types, promoting method overloading and interface flexibility. Abstraction reduces complexity by allowing programmers to focus on interactions at a higher level without needing to understand underlying implementation details. However, these concepts also have limitations. Overuse of inheritance can lead to rigid, hard-to-maintain class hierarchies and tight coupling. Encapsulation and abstraction can sometimes introduce performance overhead. Polymorphism, if not managed correctly, may lead to inefficient use of resources. Thus, developers need to balance these anagrams against specific application requirements and constraints .
Page replacement algorithms are strategies used by operating systems to manage how pages are allocated in memory when a page fault occurs and there’s no free page available. They are crucial for optimizing memory usage and overall system performance. The FIFO (First-In-First-Out) algorithm replaces the oldest page in memory, which is simple but doesn't always yield the best performance as it may remove frequently used pages. The LRU (Least Recently Used) algorithm replaces the page that has not been used for the longest period of time, which can lead to better performance as it more closely approximates the optimal algorithm of replacing the page not needed for the longest time period, though it is more complex to implement. Efficient page replacement improves cache utilization and reduces the frequency of slow disk I/O operations, thereby improving system performance .
Virtual memory is a memory management capability that provides an "idealized abstraction of the storage resources that are actually available on a given machine," creating the illusion to users of a very large (main) memory. It allows an operating system to use hardware memory more efficiently by extending it to disk storage. When physical memory runs low, the system swaps out portions of RAM not currently in use to the hard disk, allowing more applications to run than would otherwise be possible. This process increases system performance by enabling the running of large applications or multiple concurrent programs without needing additional physical RAM, though it can also lead to performance overhead when the system needs to frequently read/write to the disk .
ACID is an acronym for Atomicity, Consistency, Isolation, and Durability, which are essential properties ensuring reliable transaction processing in database management systems. Atomicity ensures that each transaction is treated as a single unit that either fully completes or does not occur at all. Consistency ensures that transactions only bring the database from one valid state to another, enforcing all database rules. Isolation ensures that transactions occur independently and transparently to other concurrent transactions. Durability guarantees that once a transaction is completed, it remains so even in the event of a system failure. These properties are critical for maintaining the integrity, accuracy, and reliability of a database, especially in environments where multiple transactions occur simultaneously .
Dynamic programming is used to solve problems by breaking them down into simpler subproblems and storing the results of these subproblems to avoid redundant computations. This approach is particularly useful in problems where the same subproblems are solved repeatedly, such as the Fibonacci sequence or variations of the knapsack problem, leading to significant reductions in time complexity. On the other hand, greedy algorithms build a solution step-by-step, always choosing the next step that offers the most immediate benefit. They are simpler and faster than dynamic programming because they don't require carrying around a table of computed results, making them suitable for problems like finding the minimum number of coins for change. However, greedy algorithms may not always produce the optimal solution for all problems, as they prioritize local optimization over global optimization .
A process is a self-contained execution environment with its own memory space; hence, processes are isolated from each other. A thread, however, is the smallest unit of processing within a process and shares the process's resources, including memory. This distinction means that processes are safer and less prone to errors from other processes since they do not share memory spaces, but communication between processes (inter-process communication) is more costly in terms of system resources. On the other hand, threads within the same process have low-cost communication and context-switching because they share memory and resources, but this can lead to issues like race conditions if not managed properly. Understanding these differences is important for optimizing system performance and responsiveness, especially in multicore systems where threads can significantly enhance computational efficiency .
The four pillars of Object-Oriented Programming (OOP) are encapsulation, inheritance, polymorphism, and abstraction. Encapsulation involves bundling data with the methods that operate on that data, restricting direct access to some of an object's components and can prevent accidental interference and misuse of the methods and data. Inheritance allows the creation of a new class that is a modified version of an existing class, promoting code reusability. Polymorphism enables objects to be treated as instances of their parent class, allowing one interface to be used for a general class of actions. Abstraction involves hiding complex implementation details and only exposing the essential features of an object. Together, these principles enhance code reusability, scalability, and maintainability, making them foundational for robust software development .
Deadlock prevention strategies are crucial for ensuring smooth execution in concurrent systems where multiple processes compete for finite resources. Several strategies exist: ensuring mutual exclusion by allowing at least one resource to remain globally shared when feasible; avoiding hold and wait by requiring that a process requests all resources at the start; preempting resources if a process holding some resources must wait for more resources; and imposing a strict order on the request of resources to prevent cycles. These strategies are vital because deadlocks can cause a complete halt in system processing, leading to decreased performance and potential data loss or corruption. By incorporating these strategies into system design, developers can enhance system robustness and reliability .
INNER JOIN returns only the rows with matching values in both tables. It is used when you need to retrieve data that exists in both tables. For instance, if you have a 'customers' table and an 'orders' table, an INNER JOIN will return only those customers who have placed orders. LEFT JOIN (or LEFT OUTER JOIN) returns all rows from the left table and matched rows from the right table. Unmatched rows from the left table will contain NULLs for columns from the right table. This is useful when you want a complete list of entities from the left table regardless of matching records in the right table. RIGHT JOIN (or RIGHT OUTER JOIN) is similar to LEFT JOIN but returns all rows from the right table and matched rows from the left table, inserting NULLs for unmatched rows in the left table. This operation is used to retrieve complete data from the right table even if there are no corresponding matches in the left table .