# 9 Broadridge SQL Interview Questions (Updated 2024)

Updated on

August 11, 2024

Broadridge employees use SQL to analyze large financial datasets, including transactional data, customer portfolios, and market trends, to gain actionable insights, as well as to build data-driven solutions, like predictive models and dashboards, for improved customer financial management. Because of this, Broadridge uses SQL questions during interviews for Data Science, Analytics, and & Data Engineering jobs.

To help you ace the Broadridge SQL interview, here's 9 Broadridge Financial Solutions SQL interview questions – scroll down to start solving them!

## 9 Broadridge Financial Solutions SQL Interview Questions

### SQL Question 1: Calculate Monthly Average Rating

Broadridge Financial Solutions, Inc. is a US servicing company for the financial industry founded in 2007 as a spin-off from Automatic Data Processing (ADP). Suppose there's a system where clients provide reviews for various products of Broadridge. Your task as a data analyst is to write a query to calculate the average rating for each product on a monthly basis. The dataset has a table named .

The table has the following fields:

• : The unique identifier of the review
• : The id of the user who submitted the review
• : The date when the review was submitted
• : The id of the product which was reviewed
• : The rating given by the user. It is an integer varying from 1 to 5.
##### Example Input:
review_iduser_idsubmit_dateproduct_idstars
61711232022-06-08500014
78022652022-06-10698524
52933622022-06-18500013
63521922022-07-26698523
45179812022-07-05698522

You are required to output a table that includes:

• The month when the reviews were submitted
• The product id
• The average rating of the product for that month, up to two decimal places

You should format your output as per the 'Example Output' section.

##### Example Output:
mthproductavg_stars
6500013.50
6698524.00
7698522.50

You can use the SQL function to truncate the date to month and then use window function to calculate the average rating per product per month.

The PostgreSQL query will look like this:

This query works by first truncating the 'submit_date' to month level to group reviews by month. Next, it groups the data by 'product_id' to calculate the average stars for each product per month. The result is ordered by month and product for better readability.

p.s. Window functions show up pretty frequently during SQL interviews, so practice the 27+ window function questions on DataLemur

### SQL Question 2: Top Three Salaries

Suppose there was a table of Broadridge employee salary data. Write a SQL query to find the top three highest paid employees within each department.

employee_idnamesalarydepartment_id
1Emma Thompson38001
2Daniel Rodriguez22301
3Olivia Smith20001
4Noah Johnson68002
5Sophia Martinez17501
8William Davis68002
10James Anderson40001

#### Example Input:

department_iddepartment_name
1Data Analytics
2Data Science

#### Example Output:

department_namenamesalary
Data AnalyticsJames Anderson4000
Data AnalyticsEmma Thompson3800
Data AnalyticsDaniel Rodriguez2230
Data ScienceNoah Johnson6800
Data ScienceWilliam Davis6800

Solve this problem interactively on DataLemur:

We use the DENSE_RANK() window function to generate unique ranks for each employee's salary within their department, with higher salaries receiving lower ranks. Then, we wrap this up in a CTE and filter the employees with a ranking of 3 or lower.

If the solution above is confusing, you can find a detailed solution here: Top 3 Department Salaries.

### SQL Question 3: Are the results of a UNION ALL and a FULL OUTER JOIN usually the same?

No, in 99% of normal cases a and do NOT produce the same result.

You can think of more as set addition when it combines the results of two tables.

You can think of a more as set multiplication, producing all combos of table 1 with combos of table 2.

### SQL Question 4: Portfolio Transactions Analysis

Broadridge is a global fintech leader providing investor communications and technology-driven solutions to banks, broker-dealers, asset, and wealth managers, and corporate issuers. Let's consider a simple scenario where Broadridge needs to analyze portfolio transactions for its clients.

Assume the company holds two kinds of records for its clients - and .

The table includes the client_id, total_transactions, and total_investment.

The table holds information about each transaction, including transaction_id, client_id, transaction_date, amount, and transaction_type (purchase or sale).

Your task is to design an SQL query that returns the sum of purchases (transaction_type = 'purchase') for each client in the last month.

##### Example Input:
client_idtotal_transactionstotal_investment
152500
231200
343000
##### Example Input:
transaction_idclient_idtransaction_dateamounttransaction_type
112022-07-19500purchase
212022-07-20500purchase
312022-07-01500sale
422022-07-02400sale
532022-07-01750purchase
632022-07-02750purchase

This query returns the total amount of purchases for each client in the last month. It groups the data by client_id and only includes transactions where the transaction_type is 'purchase' and the transaction_date is within the last month. It calculates the total of the amount column for each group.

### SQL Question 5: What is a primary key?

A primary key is a column or group of columns that uniquely identifies a row in a table. For example, say you had a database of Broadridge marketing campaigns data:

In this Broadridge example, the CampaignID column is the primary key of the MarketingCampaigns table. The constraint ensures that no two rows have the same CampaignID. This helps to maintain the integrity of the data in the table by preventing duplicate rows.

### SQL Question 6: Average Number of Financial Transactions Processed per Date

As a part of Broadridge, a company that provides technology-driven solutions to banks, hedge funds, and other financial firms, you are required to analyze the average number of financial transactions processed per day. You have the following table :

##### Example Input:
transaction_idtransaction_dateclient_idtransaction_value
1012022-06-0110012000
1022022-06-0110023000
1032022-06-0210031500
1042022-06-0310042500
1052022-06-0310053500

In the table, is a unique id for each transaction, is the date when the transaction was processed, represents distinct clients, and is the value of the transaction.

Now, write a SQL query that returns the average number of transactions processed per day.

##### Example Output:
dateavg_transactions
2022-06-012
2022-06-021
2022-06-032

The PostgreSQL query will be something like this:

This query first groups the transactions by their respective dates using the clause. Then, for each group (which represents a day), it counts the number of transactions using the function. This effectively gives us the number of transactions processed per day. The final result is ordered by date.

To practice a very similar question try this interactive Uber User's Third Transaction Question which is similar for requiring date-specific transaction analysis or this Stripe Repeated Payments Question which is similar for focusing on detailed transaction data.

### SQL Question 7: In what circumstances might you choose to denormalize a database?

There are several advantages to normalizing a database, including less redundancy, more flexibility, and better performance.

• Less Redundancy: Normalization reduces redundancy by breaking down a larger, more general table into smaller, more specific tables. This reduces the amount of data that needs to be accessed for queries.

• More Flexibility: Normalization makes it easier to modify the structure of the database, as there is less redundancy, so it allows you to make changes to one table without affecting others. This makes it easier to adapt the database to changing business needs (a very real reality at Broadridge!)

• Better Performance: Normalization can improve the performance of the database by reducing the amount of data that needs to be stored and accessed in a single table. This can result in faster query times and better overall performance.

### SQL Question 8: Find average transaction amounts per customer

Broadridge, being a FinTech company, renders services to clients dealing with large transactions. Let's assume they have a transaction management system where they keep the records of each transaction with the respective customer details.

You are given a table named where each row represents a single transaction. The columns are:

• transaction_id (INT),
• customer_id (INT),
• transaction_amount (DECIMAL),
• transaction_date (DATE)

The task is to find the average transaction amounts per customer.

##### Example Input:
transaction_idcustomer_idtransaction_amounttransaction_date
1100112000.002022-06-08
210026750.002022-06-10
310038900.002022-06-18
4100113450.002022-07-26
510027070.002022-07-05
##### Example Output:
customer_idavg_transaction_amount
100112725.00
10026910.00
10038900.00

In order to answer this question, we use the clause to group the data on the basis of customer_id. This means for each unique customer_id in the table, a group is created. Then, for each group, we calculate the average of transaction_amount using the function. Finally, we get the average transaction amounts for each customer.

### SQL Question 9: Analyzing Customers Transactions

Suppose Broadridge Financials has two tables, one for Customers and another for Transactions. In the Customers table, each customer's information is stored with fields for customer_id, first_name, and last_name. In the Transactions table, each transaction's information is stored with fields for transaction_id, customer_id, transaction_date, and transaction_amount.

The task is to write a SQL query that retrieves the first and last names of all the customers along with their total transaction amount, sorted by their first names.

Here are the sample tables:

##### Example Input:
customer_idfirst_namelast_name
101JohnDoe
102JaneSmith
103DavidBrown
104SarahJohnson
105MikeDavis
##### Example Input:
transaction_idcustomer_idtransaction_datetransaction_amount
20110112/08/2021125.35
20210213/08/202175.50
20310114/08/2021225.20
20410315/08/2021339.40
20510216/08/2021135.65

The expected output would look like:

##### Example Output:
first_namelast_nametotal_transaction_amount
DavidBrown339.40
JaneSmith211.15
JohnDoe350.55
MikeDavis0.00
SarahJohnson0.00

This PostgreSQL query joins the Customers and Transactions tables using a LEFT JOIN, so the output includes all customers even if they did not have any transactions. The total transaction amount for each customer is found by taking the SUM of transaction_amount in the Transactions table, and the result is sorted by the customers' first names. The COALESCE function is used to return 0 for customers who did not have any transactions.

Because joins come up so often during SQL interviews, try an interactive SQL join question from Spotify:

### How To Prepare for the Broadridge SQL Interview

The best way to prepare for a SQL interview, besides making sure you have strong SQL fundamentals, is to practice a ton of real SQL questions that were asked in recent job interviews. Besides solving the earlier Broadridge SQL interview questions, you should also solve the 200+ tricky sql questions on DataLemur which come from companies like Netflix, Google, and Amazon.

Each interview question has hints to guide you, full answers and most importantly, there's an online SQL coding environment so you can easily right in the browser your query and have it graded.

To prep for the Broadridge SQL interview you can also be a great idea to solve interview questions from other financial services companies like:

Discover how Broadridge is harnessing the power of Artificial Intelligence to transform the financial industry!

But if your SQL foundations are weak, forget about jumping right into solving questions – improve your SQL foundations with this SQL interview tutorial.

This tutorial covers SQL concepts such as aggregate functions and CASE/WHEN/ELSE statements – both of which pop up often in Broadridge SQL interviews.

### Broadridge Financial Solutions Data Science Interview Tips

#### What Do Broadridge Data Science Interviews Cover?

Beyond writing SQL queries, the other topics to prepare for the Broadridge Data Science Interview include:

#### How To Prepare for Broadridge Data Science Interviews?

To prepare for Broadridge Data Science interviews read the book Ace the Data Science Interview because it's got:

• 201 interview questions sourced from tech companies like Netflix, Google, & Airbnb
• a refresher on SQL, Product-Sense & ML
• over 1000+ 5-star reviews on Amazon

Also focus on the behavioral interview – prep for that with this list of common Data Scientist behavioral interview questions.