What are the common security mechanisms used to secure RESTful APIs?
- IP Whitelisting
- JWT (JSON Web Tokens)
- OAuth 2.0
- SSL/TLS Encryption
Secure RESTful APIs employ various mechanisms to protect data and authenticate clients. SSL/TLS encryption ensures that data transmitted between clients and servers is encrypted, preventing unauthorized access and eavesdropping. OAuth 2.0 is a popular authorization framework that allows secure token-based authentication, enabling clients to access resources on behalf of users without exposing sensitive credentials. JWT (JSON Web Tokens) are used for securely transmitting information between parties as compact, URL-safe tokens, facilitating stateless authentication and authorization in RESTful architectures. IP whitelisting restricts access to API endpoints based on predefined IP addresses, enhancing security by allowing only trusted clients to interact with the API. Each of these mechanisms plays a vital role in safeguarding RESTful APIs against common security threats such as data breaches, unauthorized access, and man-in-the-middle attacks.
Which design pattern is used to ensure a class has only one instance and provides a global point of access to it?
- Factory
- Observer
- Singleton
- Strategy
The design pattern used to ensure a class has only one instance and provides a global point of access to it is the Singleton pattern. This pattern restricts instantiation of a class to a single object and provides a way to access that instance globally. It is commonly used in scenarios such as database connections, logging mechanisms, and configuration settings where having multiple instances can lead to issues like resource wastage or inconsistent behavior.
In a doubly linked list, each node contains a reference to the ___________ and ___________ nodes.
- First, Last
- Last, First
- Next, Previous
- Previous, Next
In a doubly linked list, each node contains references to the next node and the previous node. This is because each node has two pointers, one pointing to the next node and one to the previous node.
How does a database system ensure durability, one of the ACID properties, even in the event of system failures?
- Optimistic Concurrency Control
- Rollback Mechanism
- Two-Phase Commit
- Using Write-Ahead Logging
A database system ensures durability, one of the ACID properties, by using techniques like Write-Ahead Logging (WAL). In WAL, before modifying data in the database, the system first writes the changes to a log file on disk. This log file acts as a record of all transactions, and in the event of a system failure, the database can recover by replaying the logged transactions from the log file to restore the database to a consistent state. This ensures that even if the system crashes, committed transactions are not lost and the database remains durable. Other techniques such as checkpoints and transaction logs also contribute to ensuring durability in database systems, making them robust against failures.
To retrieve only unique values from a column in SQL, you would use the ___________ keyword.
- DISTINCT
- SELECT DISTINCT
- UNIQUE
- UNIQUE VALUES
The SELECT DISTINCT keyword is used in SQL to retrieve only unique values from a specified column in a table. When you use SELECT DISTINCT, the query results will eliminate duplicate values, presenting only distinct values in the result set. This is particularly useful when you want to analyze or display unique entries without redundancy. It's important to note that SELECT DISTINCT operates on a single column or a combination of columns, and it can be combined with other clauses like WHERE for more specific filtering. Understanding how to use SELECT DISTINCT helps in generating accurate and concise reports or data analysis results.
What is the first phase in the Software Development Life Cycle?
- Planning
- Analysis
- Design
- Implementation
The correct option is Planning. The first phase in the SDLC is Planning, where project goals, scope, requirements, and resources are defined.
What are the key principles of the Agile Manifesto?
- Detailed documentation
- Individuals and interactions
- Responding to change
- Working software
The Agile Manifesto emphasizes individuals and interactions over processes and tools, valuing working software over comprehensive documentation, customer collaboration over contract negotiation, and responding to change over following a plan. These principles guide Agile teams in prioritizing people and adaptability in software development.
Composite indexes consist of _______ columns.
- Single
- Multiple
- Unique
- Primary
Composite indexes combine multiple columns into a single index, allowing for efficient retrieval based on multiple criteria. Therefore, option 2, "Multiple," accurately describes composite indexes.
How does the CSS box model work, and what are its components?
- Content, Padding, Border, Margin
- Margin, Border, Padding, Content
- Margin, Padding, Content, Border
- Width, Height, Border, Padding
The CSS box model describes the structure of an HTML element by breaking it down into four components: content, padding, border, and margin. Content refers to the actual content within the element, while padding adds space between the content and the border. The border outlines the content and padding, and margin provides space outside the border. Understanding the box model is essential for layout design and spacing in CSS.
What are the security challenges associated with containerization, and how can they be mitigated?
- Incompatibility with legacy systems, network latency issues, and lack of monitoring tools.
- Isolation breaches, kernel exploits, and insecure configurations are challenges. Solutions include using secure images, network policies, and regular updates.
- Lack of standardization, performance overhead, and portability limitations.
- Limited scalability, resource sharing vulnerabilities, and dependency management issues.
Security challenges in containerization include isolation breaches and vulnerabilities such as kernel exploits. Mitigation involves using secure container images, implementing strict network policies, and regularly updating containers and underlying systems.