R1: Bar Raiser
The first interview was the Bar Raiser. It contained only behavioral questions and no coding.
R2 Coding: Minimum Point Consumption Across Multiple Programs
Problem description
A user has points from different programs, such as airline miles, credit-card points, and store points. Each program has a different redemption rate, and the rates change daily. The user wants to pay a fixed amount. Find a combination of points that minimizes the total number of points consumed.
Example
Target amount: $168
Point programs: [("airline", 36000, \$0.012), ("store", 12000, \$0.009), ("credit_card", 25000, \$0.0085)]
Each program contains its name, available point balance, and redeemable value per point.
Without exceeding the balance of any program, calculate the minimum total number of points needed to pay the target amount. If payment is impossible, return a failure result.
R3 Coding: Rearrange a String So Adjacent Characters Differ
Problem description
Given a string containing repeated characters, rearrange its characters so that no two adjacent characters are the same.
If a valid arrangement exists, return any valid result. If the condition cannot be satisfied, return an empty string or a failure marker.
R4 Coding: Movie Theater Ticket Pricing
Problem description
Implement a ticket-pricing system for a movie theater. A ticket consists of:
- Movie format, such as standard, 3D, or IMAX, each with a different base price.
- Showtime, such as morning, afternoon, or night, each with a different multiplier.
- Seat tier, such as standard, premium, or VIP, each with a different multiplier.
- Optional add-on services, such as seat selection, extra legroom, or a blanket. A ticket may contain zero or more add-ons, each with a fixed price.
The final price is:
Price = (movie base price + sum of add-on prices)
* showtime multiplier
* seat tier multiplier
Design and implement the corresponding data structures and calculation logic. The code should remain easy to extend when new movie formats, showtimes, seat tiers, or add-on services are introduced.
Discussion
Loading comments…