1️⃣ SQL: Combining Successful and Failed Transactions Analysis
Problem Statement
A financial technology service is conducting a comprehensive analysis of its transactions to identify areas for improvement. The company wants to generate a report that details both the successful and failed transactions, focusing on the volume and total amount involved. For failed transactions, the report must list all the reasons for failure.
The result should have the following columns:status | total_transactions | total_amount | failure_reasons
- status – the status of the transaction
- total_transactions – the total number of transactions for a specific status
- total_amount – the total amount of money involved in the transactions for a specific status, rounded to two decimal places, including trailing zeros if necessary (e.g., $5.00)
- failure_reasons – the list of reasons for transaction failures, separated by commas, sorted first descending by number of occurrences, then ascending by reason
The result should be sorted in ascending order by status.
Note:
- For transactions with a status of
"success", set the failure reason to"N/A". - For transactions with a status of
"failure"but without a specified reason (null value), set the failure reason to"Unknown".
Schema
Table: transactions
| Name | Type | Description |
|---|---|---|
| id | INT | The identifier of the transaction |
| amount | DECIMAL(6,2) | The amount of the transaction |
| status | ENUM(success, failure) | The status of the transaction |
| failure_reason | VARCHAR(255) | The reason for transaction failure |

2️⃣ Node Disconnection
Problem Statement
Secure a compromised communication network by disconnecting all nodes.
There is a series of nodes represented by lowercase English letters in a string. In a single operation, you can disconnect any number of adjacent nodes that are the same letter.
Determine the minimum number of operations required to disconnect all nodes and secure the network.
Example
series = "aabbaa"
The minimum number of operations required is 2:
- Disconnect the group
"bb". - Disconnect the remaining group
"aaaa".
Function Description
Complete the function getMinOperations in the editor with the following parameter:
string series: a series of nodes
Returns
int: the minimum number of operations required to delete the entire series
Constraints
- 1 ≤ length of series ≤ 500
- It is guaranteed that series contains lowercase English letters only.

3️⃣ Bash: Array Sum
Problem Statement
Given an array of strings, add all the numeric values within the array and print the sum to stdout. If there are no numeric values, print 0.
Note:
The sum will not exceed 7,000,000.
Example
my_array = ["First", "2", "3rd", "4"]
The array_sum function should return 6 because 2 + 4 = 6.
Input Format For Custom Testing
The input contains the newline-separated elements of the given array.

我们长期稳定承接各大科技公司如Capital One、TikTok、Google、Amazon等的OA笔试代写服务,确保满分通过。如有需求,请随时联系我们。
We consistently provide professional online assessment services for major tech companies like TikTok, Google, and Amazon, guaranteeing perfect scores. Feel free to contact us if you're interested.

