Prepin
Log in

Deceptive Transactions

Approach / Explanation

The task requires you to create a SQL query to identify or examine fraudulent transactions. It can generally be assumed that a "fraudulent transaction" is characterized by specific attributes, such as being marked as fraudulent, the transaction amount surpassing a certain limit, or occurring at unusual times. Prior to writing the SQL query, it is important to consider the following points: Clarify what the interviewer means by "fraudulent transaction." Determine if there is a need to filter or sort the transactions. Identify which columns to select and if any aggregation calculations are necessary. Crucially, ensure that the SQL code is structured in a way that is clear and easy to understand. Below are examples of queries designed to retrieve fraudulent transactions based on their key characteristics.

Suggested Answer

For this illustration, consider a hypothetical "Transactions" table containing the columns "TransactionID", "AccountID", "Amount", "TransactionTime", and "IsFraud". In this scenario, a fraudulent transaction is indicated by the "IsFraud" column being marked. The corresponding SQL query would be: SELECT TransactionID, AccountID, Amount, TransactionTime FROM Transactions WHERE IsFraud = 1; This query retrieves all transactions that have been marked as fraudulent.

Alternative Answer

In this scenario, let's define a fraudulent transaction as one where the transaction amount surpasses a certain limit, for instance, $10,000. The columns in the "Transactions" table are identical to those in the previous example. The SQL query would be as follows: SELECT TransactionID, AccountID, Amount, TransactionTime FROM Transactions WHERE Amount > 10000; This query will retrieve all transactions with amounts greater than $10,000.

Question Details

Difficulty & Category

Medium
sql

Product

For CandidatesFor RecruitersCompaniesBrowse JobsInterview QuestionsDeep ProfileSkill AssessmentOpportunity Matching
Prepin.ai

© 2026 Prepin LLC · Philadelphia, PA · All rights reserved.