InterviewQs Flashcards

(49 cards)

1
Q

Explain what XAMPP is

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain the role of XAMPP in your project

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the role of the MySQL Server

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Identify and explain any 1:M relationships in your database schema

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Show your SQL DDL & DML statements and explain

A

DDL Statements (Define the structure of the database(Create Table)), DML Statements (Insert, update, delete, or retrieve data)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is required for a Java program to connect to a Database

A

JDBC API (Java Database Connectivity), Database Driver (JDBC Driver), Database Server, Java Code with JDBC Logic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the purpose of a Data Access Layer (Data Access Pattern)

A

Separation of Concerns, Reusability, Maintainability, Testability, Security & Validation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a DTO and explain why it is necessary

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Show your DTOs in your code and explain their structure

A

DTO’s class and structure includes Fields, Constructor, Getters/Setters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Locate and show your range of DAO methods

A

In DAO class and show methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How have you included a defense against “SQL Injection”

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Explain what a Result Set is

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How is a DAO related to a DTO

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Should a DAO method return a “null” value – discuss the issue

A

Returning null from a DAO method is a common way to indicate that no data was found, but it has drawbacks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the Business Logic Layer

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the purpose of the DAO Interface classes

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How is an interface used in the Business Object layer

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Explain what a Socket is

A

A socket is an endpoint for sending or receiving data across a computer network.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What type of data is sent on a socket

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is a Server Socket and what is its purpose

A

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.

21
Q

What is a Blocking I/O method, and give an example from your code

A

A Blocking I/O method is a method that waits (or “blocks”) until the operation is complete before it allows the program to continue.

22
Q

What is a Server

A

A server is a system that waits for client requests, processes them, and returns results or services.

23
Q

How do we create a Server

A

To create a server in Java, you typically use the ServerSocket class from the java.net package.

24
Q

Explain Port Numbers

A

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.

25
What is localhost
Localhost refers to the local computer or device that you are currently using.
26
What is a Multi-Threaded Server and what is its purpose
A multi-threaded server is designed to handle multiple client connections at once by assigning each connection to a separate thread. This improves performance, concurrency, and responsiveness, especially for high-traffic services. It is commonly used in applications like web servers, game servers, and chat systems.
27
What is the role of the Client Handler
A Client Handler is a thread in a multi-threaded server that is responsible for managing communication with a specific client. It handles client requests, performs necessary actions (e.g., reading, processing, or responding to requests), and ensures the client connection is closed once communication is complete.
28
How are threads used in this Client Handler
In the Client Handler, threads are used to process each client's request independently and concurrently. This allows the server to handle multiple clients at the same time, without blocking, ensuring non-blocking and scalable operations.
29
What is a Protocol (in terms of your program)
A protocol in your program defines the rules for communication between the client and the server, specifying how requests and responses are structured, how errors are handled, and ensuring that both parties understand the messages being sent and received.
30
Why do we need a protocol
A protocol is essential in client-server communication because it defines the rules and conventions for data exchange between the two systems.
31
What is Serialization and Deserialization
Serialization and Deserialization are processes used to convert objects (usually in a program's memory) to a specific format that can be easily stored or transmitted (and vice versa).
32
Why are Serialization and Deserialization necessary
They are essential because they allow us to efficiently store, transfer, and reconstruct complex objects across different environments and over time.
33
What is JSON and why is it necessary
JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format that's easy for both humans to read and machines to parse and generate. It is primarily used to represent structured data and is commonly used for data exchange between a server and a client, particularly in web applications.
34
What alternatives are there to JSON
XML, YAML, Protocol Buffers
35
What did you use to convert Java Objects to JSON
No
36
What is the advantage of JSON
Human-readable, Lightweight and Compact, Fast Parsing
37
What is Junit – explain expected and actual results
JUnit uses assertions like assertEquals() to compare expected and actual results, helping to determine whether the unit of code being tested works as expected. Expected Result: The predefined correct result based on the input data and the function's specification. Actual Result: The result that the method or function produces when it is executed during testing.
38
What Collection classes have you used in the system – show
List Interface – ArrayList, LinkedList. Set Interface – HashSet, LinkedHashSet. Map Interface – HashMap, TreeMap. Stack Class – Stack.
39
What is JavaFX
JavaFX is a framework used for building rich, interactive user interfaces (UIs) in Java applications.
40
What is FXML
FXML is an XML-based markup language used to define the structure and layout of user interfaces in JavaFX applications.
41
Explain “Dependency Injection” in FXML
Dependency Injection (DI) in the context of FXML refers to a design pattern used to implement loosely coupled relationships between components in an application.
42
What is an Observable object and what is it used to achieve
An Observable object is used to track changes in its state and notify observers about those changes. This is useful for creating dynamic, interactive applications, particularly for UI elements that need to update automatically when underlying data changes.
43
What is a binary stream of data
A binary stream of data refers to a sequence of data that is represented in binary (i.e., 0s and 1s) format and transmitted or processed as a continuous flow of bits (the smallest unit of data in computing).
44
How does a Client-Server deal with the transfer of binary data
In a Client-Server architecture, the transfer of binary data involves sending raw byte sequences between the client and server over a network connection.
45
What is a buffer and what is the right size for a buffer
A buffer in computing refers to a temporary memory area used to store data that is being transferred from one place to another. 8KB
46
Distinguish between Git and GitHub
Git is the tool you use to manage version control, while GitHub is the platform that hosts your Git repositories and adds features for collaboration and project management.
47
What is a Repo
A repo (short for repository) is a storage location where all the files related to a project are stored, along with their version history.
48
What is a Git branch
A Git branch is a lightweight, movable pointer to one of the commits in your repository.
49
Explain what code maintainability is
Code maintainability refers to how easily software code can be modified, updated, extended, and fixed over time. It reflects how well the codebase supports the continuous process of maintaining and evolving a software system, ensuring that developers can make changes with minimal effort, risk, and errors.