A parameterized query replaces user input in SQL statements with ________ to prevent SQL injection.

  • functions
  • operators
  • placeholders
  • variables
Parameterized queries replace user input in SQL statements with placeholders. These placeholders act as markers for where the input data should be inserted into the query. By using placeholders, the SQL engine can differentiate between executable SQL code and user-provided data, thereby preventing SQL injection attacks.

What is the purpose of the BeginTransaction method in ADO.NET?

  • To begin a database transaction
  • To establish a connection to the database
  • To execute a SQL command
  • To retrieve data from the database
The BeginTransaction method in ADO.NET is used to initiate a database transaction. It marks the beginning of a sequence of database operations that must be treated as a single unit of work, ensuring data integrity and consistency.

Which method is used to open a database connection in ADO.NET?

  • Begin()
  • Connect()
  • Open()
  • Start()
The method used to open a database connection in ADO.NET is Open(). Calling this method establishes a connection to the database specified by the connection string associated with the connection object.

In Entity Framework, what is the primary purpose of an Entity?

  • Defining the structure of the database
  • Modeling business entities
  • Performing database operations
  • Representing a table in the database
In Entity Framework, an Entity primarily represents a business object or concept, such as a customer or an order. It models the data that the application works with and typically corresponds to a table in the database. Entities in EF are used to perform CRUD (Create, Read, Update, Delete) operations on the underlying data.

Which LINQ to SQL operation is used to delete records from a database table?

  • DeleteOnSubmit
  • InsertOnSubmit
  • RemoveOnSubmit
  • UpdateOnSubmit
In LINQ to SQL, the operation used to delete records from a database table is DeleteOnSubmit. Similar to insertion and updating, deletion operations are also performed within a DataContext instance. This method queues up objects for deletion, and upon calling SubmitChanges(), the changes are applied to the underlying database. Understanding how to delete records is crucial for maintaining data integrity and managing database content effectively in LINQ to SQL applications.

When resolving a merge conflict in Git, what approach would you take to ensure the integrity of the codebase?

  • Choose one side's changes without review
  • Merge conflicting changes manually
  • Discard conflicting changes
  • Always accept remote changes
The correct option is b) Merge conflicting changes manually. This approach involves carefully reviewing and selecting the changes from both sides to create a resolution that maintains code integrity. Options a, c, and d may lead to loss of important code or introduce errors.

In a situation where data normalization is causing performance issues, what SQL technique could be used to balance normalization with query efficiency?

  • Denormalization
  • Indexing
  • Partitioning
  • Subquery
In situations where data normalization impacts performance, denormalization can be used. Denormalization involves introducing redundancy into the database by storing redundant data, which can reduce the need for complex joins and improve query efficiency. It's a trade-off between normalization and performance.

In financial time series data of a stock market, what type of model would be ideal for predicting future stock prices considering past trends and volatilities?

  • Autoregressive Integrated Moving Average (ARIMA)
  • GARCH (Generalized Autoregressive Conditional Heteroskedasticity)
  • Long Short-Term Memory (LSTM) Networks
  • Random Forest Regressor
GARCH models are well-suited for financial time series data as they account for volatility clustering and changing variances over time. ARIMA and LSTM are more focused on capturing patterns in the mean, while Random Forest is generally not used for time series forecasting in financial markets.

When you need to create a lagged feature in a time series dataset in Pandas, which function would you use?

  • delay()
  • diff()
  • lag()
  • shift()
The shift() function in Pandas is used to create lagged features in a time series dataset. It shifts the values of a column by a specified number of periods, allowing you to create lagged versions of the original data for time series analysis.

In time series analysis, how is the term 'stationarity' best described?

  • The ability of a time series to move in a straight line
  • The predictability of future values in a time series
  • The presence of external factors affecting a time series
  • The statistical properties of a time series remaining constant over time
Stationarity refers to the statistical properties of a time series remaining constant over time. Achieving stationarity is important for accurate modeling and forecasting in time series analysis.