Tuesday, September 16, 2025

MAD1 Viva -2

1.what is an API?

An API, or Application Programming Interface, is a software intermediary that allows two applications or systems to communicate and exchange data. It is required because it enables different software components, operating systems, or microservices to work together without exposing their internal details. For example, an e-commerce website that wants to display weather information could use a weather API to fetch the necessary data instead of building its own weather application. This allows the website to focus on its core functions while still providing additional services through the API. APIs are also crucial because they allow developers to build platform-independent applications, meaning the same application can run on different systems like Windows, Mac, or Linux without needing to be rewritten for each platform.
2.Why an API required?

APIs save time and resources by allowing developers to integrate existing services instead of building everything from scratch. They also make applications platform-independent, meaning the same API can be used across different operating systems like Windows, Mac, or Linux without rewriting the code for each platform. Overall, APIs are essential for building flexible, scalable, and feature-rich applications that can seamlessly interact with other services and systems.

3.What is an Authentication?

Authentication is the process of verifying the identity of a user or system to grant access to resources or services. Typically, it involves using a username and password, although more advanced methods such as voice recognition, biometrics, or multi-factor authentication can also be used. When a user attempts to log in, their credentials are compared against stored data, and if they match, access is granted; if not, access is denied. Authentication is essential for web security, as it ensures only authorized users can access sensitive information or perform specific actions.

4.How the Authentication process works with an example?

For example, consider an online banking website. When a customer tries to log in, they provide their username and password. The server checks these details against the records in its database. If the username and password are correct, the user is authenticated and redirected to their account dashboard, where they can view balances or transfer money. If the credentials are incorrect, the system denies access and might display an error message asking the user to re-enter the correct details. In more secure systems, additional methods like two-factor authentication (e.g., receiving a one-time password on a mobile phone) may be used to further verify the user’s identity. This multi-step verification ensures that even if a password is compromised, unauthorized access is still prevented

5.what is an Authorization?

Authorization, on the other hand, determines whether an authenticated user has the necessary permissions to access certain resources or perform specific actions. It is a security mechanism that controls access by assigning roles or permissions to users. For instance, a website may restrict access to user profiles, administrative settings, or files based on authorization rules. Even after logging in successfully, a user may only be able to access features permitted by their role, such as an admin having additional privileges compared to a standard user.

6.How did you implement authentication in Flask application?

In a Flask application, authentication can be implemented by creating a login system where the user provides their username and password, which are then validated against stored credentials. For example, in a Booktheshow Flask app, authentication can be implemented for both admin and user logins to verify identities and authorize specific activities. This ensures that only verified users and admins can perform actions like managing or booking shows.
7.Differentate between API Testing and UI Testing?

API testing and UI testing are two different types of software testing. UI testing focuses on the user interface and the client-side experience, ensuring that the application’s presentation logic works as intended when used by humans through a browser or front-end. API testing, on the other hand, verifies the functionality, reliability, and security of the backend or server-side of an application by testing the business logic and the communication between different software components. Both are crucial for delivering a fully functional and user-friendly application.



No comments:

Post a Comment

Mangerial Economics Quiz1 solutions Guide

Mangerial Economics Quiz1 solutions Guide  solutions watch on you tube channel