InterviewQs Flashcards
(49 cards)
Explain what XAMPP is
XAMPP is a free and open-source cross-platform web server solution stack package developed by Apache Friends. It provides a simple and lightweight way to set up a local web server environment on your computer for testing and development.
Explain the role of XAMPP in your project
Local Server Environment: XAMPP simulates a live web server on your local machine, allowing you to build and test your website or web application without needing an internet connection or a live hosting service.
What is the role of the MySQL Server
Data Storage: It stores all the project’s data—such as user information, product details, orders, or any dynamic content—in organized tables within databases.
Identify and explain any 1:M relationships in your database schema
A 1:M (one-to-many) relationship in a database schema means that one record in a table can be associated with many records in another table.
Show your SQL DDL & DML statements and explain
DDL Statements (Define the structure of the database(Create Table)), DML Statements (Insert, update, delete, or retrieve data)
What is required for a Java program to connect to a Database
JDBC API (Java Database Connectivity), Database Driver (JDBC Driver), Database Server, Java Code with JDBC Logic
What is the purpose of a Data Access Layer (Data Access Pattern)
Separation of Concerns, Reusability, Maintainability, Testability, Security & Validation
What is a DTO and explain why it is necessary
A DTO (Data Transfer Object) is a plain Java object used to transfer data between different layers of an application. Why? Encapsulation of Data, Separation of Concerns, Security, Efficiency, Improves Maintainability
Show your DTOs in your code and explain their structure
DTO’s class and structure includes Fields, Constructor, Getters/Setters
Locate and show your range of DAO methods
In DAO class and show methods
How have you included a defense against “SQL Injection”
A PreparedStatement is a type of SQL statement that is precompiled. PreparedStatement separates the SQL code from the input data, which is passed as parameters.
Explain what a Result Set is
A ResultSet is a Java object that represents the result of a SQL query executed on a database. When you execute a query (such as a SELECT statement) through a Statement or PreparedStatement, the database returns the results of the query, which are stored in a ResultSet.
How is a DAO related to a DTO
DAO: Responsible for interacting with the database and fetching or storing data.
DTO: Represents the data retrieved by the DAO, acting as a data carrier between layers of the application.
DAO uses DTO objects to transfer data between the database and the business/application logic, keeping the layers decoupled and the code more maintainable and testable.
Should a DAO method return a “null” value – discuss the issue
Returning null from a DAO method is a common way to indicate that no data was found, but it has drawbacks.
What is the Business Logic Layer
The Business Logic Layer is where the real-world rules and decisions of your application are enforced. It acts as a bridge between the UI and the database, ensuring the system behaves correctly and predictably.
What is the purpose of the DAO Interface classes
The purpose of DAO interface classes in Java is to define a contract for how your application will interact with the database, without tying it to a specific implementation. They help enforce separation of concerns, flexibility, and testability in your application’s architecture.
How is an interface used in the Business Object layer
In the Business Object Layer, an interface defines what business services are available (like registration, validation, or processing), while the implementation class defines how they work. This separation makes the application more modular, testable, and maintainable.
Explain what a Socket is
A socket is an endpoint for sending or receiving data across a computer network.
What type of data is sent on a socket
The type of data sent on a socket depends on the application and the protocol used (TCP or UDP), but in general, all data sent through a socket is transmitted as a stream of bytes.
What is a Server Socket and what is its purpose
A Server Socket is used on the server side to listen for client connections on a specific port. It acts like a doorman, accepting connections and handing off each one to a regular Socket for communication.
What is a Blocking I/O method, and give an example from your code
A Blocking I/O method is a method that waits (or “blocks”) until the operation is complete before it allows the program to continue.
What is a Server
A server is a system that waits for client requests, processes them, and returns results or services.
How do we create a Server
To create a server in Java, you typically use the ServerSocket class from the java.net package.
Explain Port Numbers
A port number is a 16-bit integer (ranging from 0 to 65535) used to identify specific services or applications running on a machine that uses TCP/IP or UDP/IP protocols.