Practice Interview Questions
| Question | Status |
|---|---|
As part of your task for Amazon, find the shipment with the 3rd heaviest weight. Your query should return the shipment_id and the weight of this shipment.
In cases of tied weights, ranks should be assigned without gaps. For instance, if there are 5 shipments with weights of 100, 100, 50, 40, and 30 pounds, the first 2 shipments at 100 pounds each would both be ranked 1st, the 50-pound shipment would be ranked 2nd, and the 40-pound shipment would be ranked 3rd.
shipments table:
| Column Name | Description |
|---|---|
| shipment_id | Unique identifier for each shipment |
| weight | Total weight of the shipment (in lbs) |
| shipment_date | Date of the shipment |
As part of your task for Amazon, find the shipment with the 3rd heaviest weight. Your query should return the shipment_id and the weight of this shipment.
In cases of tied weights, ranks should be assigned without gaps. For instance, if there are 5 shipments with weights of 100, 100, 50, 40, and 30 pounds, the first 2 shipments at 100 pounds each would both be ranked 1st, the 50-pound shipment would be ranked 2nd, and the 40-pound shipment would be ranked 3rd.
shipments table:
| Column Name | Description |
|---|---|
| shipment_id | Unique identifier for each shipment |
| weight | Total weight of the shipment (in lbs) |
| shipment_date | Date of the shipment |
| weight |
|---|
| 1232 | 24 |
| 1912 | 24 |
| weight |
|---|
| 1232 | 24 |
| 1912 | 24 |