Question: DeShaw OA | Coding Round | Triangle Area | Email Campaign Tracker | Hackerland Road Repair
0
Entering edit mode

Question 1: Triangle Area

Problem Statement: Given three sets of distinct coordinates that form a triangle, calculate the area of the triangle. At least one side of the triangle will be parallel to either the x-axis or the y-axis.

Example: x = [0, 3, 0] y = [0, 5, 2]

Aligned by index, the 3 coordinates are [0,0], [3,5], [0,2]. The base of the triangle is 2, and the height is 3. The area of a triangle is (base * height)/2, so 3 * 2 / 2 = 3. All resulting areas will be whole numbers.

Question 2: Email Campaign Tracker (SQL)

Problem Statement: An email campaign tracking platform maintains data on various campaigns and their email statistics. The task is to generate a report that lists each campaign's name along with the total number of emails sent, emails opened, and emails not opened.

The result should have the following columns: campaign_name | total_emails_sent | total_emails_opened | total_emails_not_opened.

  • campaign_name: The name of the email campaign.

  • total_emails_sent: The total number of emails sent.

  • total_emails_opened: The total number of emails opened.

  • total_emails_not_opened: The total number of emails not opened (calculated as the difference between sent and opened).

The result should be sorted in ascending order by campaign_name..

Question 3: Hackerland Road Repair

Problem Statement: The state of Hackerland is represented as a graph of g_nodes with each city numbered from 1 to g_nodes. There are g_edges bidirectional roads between the cities g_from[i] and g_to[i] with a repair cost of g_weight[i]. Initially, all roads are damaged. One can spend some amount of money, say X, and repair all the roads whose repair cost is less than or equal to X.

The task is to reach the city numbered g_nodes starting from city 1 by traveling no more than k roads while spending as little money as possible. Find the minimum money

Login before adding your answer.

Similar Posts
Loading Similar Posts