Adobe OA - Drone Physics / OOP Problem 🚁

I got an interesting C++ question in the Adobe University Hackathon OA.

At first glance, it looked like a small drone/flight simulation game rather than a typical DSA problem.

You had different types of drones carrying freight or medical payloads, and you had to calculate the energy required for a flight based on things like:

  • Flight distance
  • Payload mass
  • Flight zone
  • Base power consumption
  • Zone penalties
  • Cryogenic coolant
  • Mission priority

🚁 The basic idea

There was a base FreightDrone class with:

callsign
flightZone
payloadMass
basePowerDraw

The energy calculation was roughly:

Energy =
    (distance × basePowerDraw)
    +
    (payloadMass × 9.81 × flightZone)

then apply the zone penalty

The interesting part was that the problem didn't stop there.

A MedevacDrone inherited from FreightDrone and introduced additional mechanics:

Cryo coolant → additional energy consumption

Priority code divisible by 5
        → 1.5× energy

Otherwise
        → 1.1× energy

The C++ concepts being tested

The question heavily relied on understanding:

1. Constructor overloading

FreightDrone had multiple constructors with different default values.

2. Inheritance

class MedevacDrone : public FreightDrone

3. Virtual functions

virtual double getZonePenalty();
virtual double calculateEnergy(double distanceKm);

4. Method overriding

double getZonePenalty() override;
double calculateEnergy(double distanceKm) override;

5. Calling the base implementation

Inside the medevac calculation:

double energy =
    FreightDrone::calculateEnergy(distanceKm);

But FreightDrone::calculateEnergy() itself calls the virtual getZonePenalty(), so the overridden MedevacDrone::getZonePenalty() is used.

That makes the execution flow interesting:

MedevacDrone::calculateEnergy()
            ↓
FreightDrone::calculateEnergy()
            ↓
MedevacDrone::getZonePenalty()
            ↓
Back to MedevacDrone
            ↓
Cryo adjustment
            ↓
Priority multiplier

Why I found this question interesting

There wasn't a traditional DSA trick here.

The difficulty was understanding how OOP concepts interact at runtime while also tracing a small physics-like calculation.

It felt like the OA was essentially asking:

"Can you understand the mechanics of this drone simulation and correctly implement the object model?"

This was probably one of the more interesting C++ questions I got in the Adobe OA.

Has anyone else encountered similar OOP/simulation-style questions in coding OAs?

Comments (0)