OOP Pillars, Polymorphism & Inheritance
- Name and explain the four pillars of OOP in under a minute, each with a one-line example
- Answer "What is polymorphism?" with both kinds and a real example, in C++ and Java
- Separate abstract class from interface, overloading from overriding, and OOP from procedural code
- Handle the follow-ups: an example from your own project, .equals versus ==, and real-time versus non-real-time
If a Lockheed Martin hiring manager asks you one technical question, it's probably about object-oriented programming. Forty-eight candidate reports from June 2019 to July 2026 mention it, all but one firsthand, which makes it the most reported technical topic for the company's software roles. It comes up for interns, associates, mid-level engineers and at least one senior hire.
The 2026 reports read alike. An associate software engineer in June 2026 described two technical leaders, some behavioral questions and "some technical object oriented programming questions", one of which was "What are the pillars of object oriented programming." A Canadian intern in July 2026 had a hiring manager and a developer ask "What is polymorphism? What is OOP?" A Fort Worth SWE II in May 2026 got "a couple object oriented questions and some design pattern questions." In December 2025 a Syracuse intern spent about an hour with two managers: 20 minutes on OOP, 20 on behavior, the rest on the resume. And in October 2026 an Orlando embedded intern listed OOP right next to C++ keywords and multithreading in a single hiring-manager round.
Each question below has the date it was reported, a short spoken answer and a small C++ and Java snippet. C++ comes first because it dominates the embedded, Orlando, Fort Worth and Sunnyvale reports, and a Canadian candidate in October 2024 said the round was "mostly OOP questions in C++". Java gets equal room, since a 2021 Halifax loop and a 2020 new-grad loop asked in Java. Design patterns sit in the system design section, in Design Patterns: Name One and Say Where You Used It.
How the OOP questions show up in a Lockheed Martin interview
- Who asks: the hiring manager. Often with an engineer or a second manager in the room.
- How long: a few minutes to 20. A Syracuse intern in December 2025 spent 20 minutes on it.
- Format: spoken, no editor. A 2019 Canadian candidate said all of them were verbal.
- Who gets it: interns to seniors. Associates and early career get it most often.
It usually sits in the middle of a single interview, after the resume and before or after the STAR questions. Many candidates call it easy, and most of the time it is. A December 2020 new grad had a different experience and warned that interviewers asked "very detailed questions much harder than the simple 'What is encapsulation?'" Prepare the definition, then prepare the follow-up behind it.
| Question, as candidates wrote it | Role and place | Date |
|---|---|---|
| "What is polymorphism? What is OOP?" | Software engineer intern, Canada | July 2026 |
| "What are the pillars of object oriented programming." | Associate software engineer, US | June 2026 |
| "a couple object oriented questions and some design pattern questions" | Software engineer II, Fort Worth | May 2026 |
| "20 mins technical questions about OOP" | Software engineer intern, Syracuse | December 2025 |
| "What are the pillars of object oriented programming?" | Software engineer, Dallas | September 2025 |
| "Describe OOP" | Software engineer, Orlando | January 2025 |
| "Explain the basics of OOP", and how projects used it | Software engineer, US | September 2024 |
| "What is Polymorphism?" | Senior software engineer, Fort Worth | December 2023 |
| "What is the difference between OOP and procedural programming?" | Associate software engineer, US | April 2022 |
| "Describe inheritance, overloading vs overriding, encapsulation" | Software engineering intern, Mount Laurel | October 2021 |
| Abstract class versus interface in Java, overloading versus overriding | Software engineer, Halifax | May 2021 |
| .equals versus ==, and memory addresses | Software engineer, US | November 2020 |
Lockheed Martin OOP interview questions, with spoken answers
What are the four pillars of object oriented programming? (2026, 2025)
This is the most common single question in the set. A June 2026 associate, a September 2025 Dallas engineer and a February 2025 candidate all got some version of it, and older reports go back to 2020. The answer is four words, each with a sentence.
Encapsulation keeps an object's data private and lets the outside world change it only through methods, so the object can protect its own rules. Abstraction shows callers what an object does and hides how; you call start() without knowing the startup sequence. Inheritance lets a class take on the fields and behavior of a more general one, so Radar can reuse what every Sensor has. Polymorphism lets one call do the right thing for whichever type is behind it at run time.
class Sensor { // abstraction: callers see read(), not howpublic: virtual double read() = 0; // polymorphism: each sensor reads its own way virtual ~Sensor() = default; int failure_count() const { return failures; }protected: void record_failure() { ++failures; }private: int failures = 0; // encapsulation: no one outside can reset it};class Altimeter : public Sensor { // inheritance: an Altimeter is a Sensorpublic: double read() override { return query_altitude_feet(); }private: double query_altitude_feet();};abstract class Sensor { // abstraction private int failures = 0; // encapsulation abstract double read(); // polymorphism int failureCount() { return failures; } protected void recordFailure() { failures++; }}class Altimeter extends Sensor { // inheritance @Override double read() { return queryAltitudeFeet(); } private double queryAltitudeFeet() { return 0.0; }}Two things go wrong in this answer. The first is mixing up encapsulation and abstraction. Encapsulation is about protecting state, abstraction is about hiding complexity behind a simpler surface, and the manager may ask you to separate them. The second is giving textbook examples like Dog extends Animal. They're fine, but a short example from your own code lands better, and the next question is often about your projects anyway.
What is polymorphism? Give a real example (2026, 2023)
Polymorphism has its own row of reports: a July 2026 Canadian intern, a December 2023 Fort Worth senior engineer, a November 2023 Fort Worth intern, plus 2022, 2021 and 2020 loops. It's the question to over-prepare.
Polymorphism means one interface with many forms. There are two kinds, and naming both is what makes the answer complete. Compile-time polymorphism is resolved by the compiler: function overloading, operator overloading and, in C++, templates. Run-time polymorphism goes through a base class pointer or reference and a virtual method, so the object's real type decides which code runs. When people say "polymorphism" without a qualifier, they usually mean the run-time kind.
Then give the example. Something like a navigation system that reads position from several sources. The code that fuses them holds a list of PositionSource and calls position() on each. A GPS receiver and an inertial unit answer that call in very different ways, and adding a third source means writing one new class, not touching the fusion code.
struct Position { double latitude; double longitude; };class PositionSource {public: virtual Position position() = 0; virtual ~PositionSource() = default;};class GpsReceiver : public PositionSource {public: Position position() override { /* decode the latest fix */ return {}; }};class InertialUnit : public PositionSource {public: Position position() override { /* integrate motion since the last fix */ return {}; }};void update_track(std::vector<PositionSource*>& sources) { for (PositionSource* source : sources) { Position fix = source->position(); // the real type picks the method // ... blend fix into the estimate }}interface PositionSource { Position position();}class GpsReceiver implements PositionSource { public Position position() { return new Position(0.0, 0.0); }}// run time: the object decidesPositionSource source = new GpsReceiver();Position fix = source.position();// compile time: the argument types decidestatic double distance(Position a, Position b) { return 0.0; }static double distance(Position a, double latitude, double longitude) { return 0.0; }For C++, expect one push deeper: how does the program know which method to call? Each class with virtual functions usually gets a table of function pointers, the vtable, and each object carries a hidden pointer to its class's table. The call looks up the slot at run time. The C++ rapid-fire lesson covers virtual, pure virtual and the virtual destructor in more detail.
What is inheritance, and when would you not use it? (2021, 2019)
"Please describe what inheritance is" came up in Denver in December 2021, "What is inheritance?" in another 2021 entry-level loop, and "Describe inheritance" in a Canadian one in June 2019. It's an older question on its own, but it sits inside every pillars answer today.
Inheritance lets a derived class reuse and extend a base class. Public inheritance means "is-a": a Radar is a Sensor, so a Radar can go anywhere a Sensor is expected. The mature half of the answer is when not to use it. If the relationship is "has-a", like an aircraft that has engines, use composition and make the engine a member. Deep hierarchies get brittle, because a change near the top ripples through every subclass.
class Radar : public Sensor { // is-a: a Radar is a Sensorpublic: double read() override;};class Aircraft { // has-a: an Aircraft has enginesprivate: std::array<Engine, 2> engines; // composition, not inheritance};The same standard limits multiple inheritance to "n interfaces plus m private implementations, plus at most one protected implementation." In plain terms: inherit as many pure interfaces as you like, but don't stack concrete base classes. That's also why Java forbids extending two classes while allowing many interfaces, which leads straight into the next question.
Abstract class versus interface (2021)
A Halifax candidate in May 2021 was asked to "describe the difference between an abstract class and an interface in Java," and it's the natural next step after any inheritance answer. Answer it for Java first, since that's where the two are separate keywords, then say how C++ does it.
Abstract class
- Can hold state: fields, constructors and fully written methods.
- A class extends only one, in Java.
- Use it when related classes share code and data, like a Sensor base that counts failures.
- Members can be private or protected.
Interface
- A contract: method signatures, plus default and static methods since Java 8, and no instance fields.
- A class can take on many at once.
- Use it when unrelated classes need the same ability, like anything that can be logged.
- Its methods are public by default.
C++ has no interface keyword. An interface there is a class with only pure virtual functions and a virtual destructor, and an abstract class is any class with at least one pure virtual function. The rule of thumb is the same in both languages. Reach for an interface when you're describing what something can do, and an abstract class when you're also sharing how.
class Loggable { // interface: pure virtual onlypublic: virtual std::string log_line() const = 0; virtual ~Loggable() = default;};class Sensor : public Loggable { // abstract: shares state and codepublic: virtual double read() = 0; std::string log_line() const override { return "failures=" + std::to_string(failures); }protected: int failures = 0;};Overloading versus overriding (2021)
A Mount Laurel intern in October 2021 and the May 2021 Halifax candidate were both asked to compare the two. The one-line answer: overloading is same name, different parameters, in the same scope, chosen at compile time. Overriding is same signature, in a subclass, replacing a virtual method, chosen at run time.
class Logger {public: void write(int code); // overloads: same name, void write(const std::string& message); // different parameters virtual void flush(); virtual ~Logger() = default;};class FileLogger : public Logger {public: using Logger::write; // without this, write(double) below hides both base overloads void write(double reading); void flush() override; // override: same signature, replaces the base version};The C++ follow-up is hiding. If FileLogger declares its own write(double), both base write overloads disappear from FileLogger until a using-declaration in FileLogger brings them back into scope. And if you redefine a function that isn't virtual, the version that runs depends on the pointer type, not the object. Lockheed's F-35 standard bans that outright: "An inherited nonvirtual function shall not be redefined in a derived class." Always write override so the compiler catches a signature that doesn't match.
class Logger { void write(int code) { } void write(String message) { } // overload void flush() { }}class FileLogger extends Logger { @Override void flush() { } // override: Java methods are virtual by default}OOP versus procedural programming (2022)
An associate software engineer was asked "What is the difference between OOP and procedural programming?" in April 2022. It's a good question to answer with an honest trade-off rather than a sales pitch for OOP.
Procedural code is organized around functions that run in order and act on data passed to them, the way most C is written. Object-oriented code bundles data with the methods that act on it, so each object guards its own state. OOP tends to pay off as a system grows and has many kinds of the same thing. Procedural code is often simpler and more predictable for a small, fixed job, which is why plenty of embedded C is procedural and works fine. Saying that both have a place sounds more like an engineer than saying OOP is better.
// procedural: data and functions live apartstruct Tank { double fuel_pounds; };void burn(Tank* tank, double pounds) { tank->fuel_pounds -= pounds; }// object-oriented: the object guards its own stateclass FuelTank {public: void burn(double pounds) { if (pounds > fuel_pounds) throw std::invalid_argument("not enough fuel"); fuel_pounds -= pounds; }private: double fuel_pounds = 0.0;};.equals versus == in Java (2020)
One November 2020 candidate was asked about memory addresses and .equals versus == alongside a short string problem. It's a single report, so treat it as an extra for Java roles.
For objects, == asks whether two references point to the same object in memory. .equals asks whether two objects hold equal values, if the class overrides it; the default in Object is the same identity check as ==. For primitives like int, == compares values. Add that a class overriding equals must override hashCode too, or it breaks inside a HashMap. In C++ the equivalent split is comparing two pointers versus comparing the objects with an overloaded operator==.
String first = new String("F-35");String second = new String("F-35");boolean sameObject = (first == second); // false: two objectsboolean sameValue = first.equals(second); // true: same charactersThe follow-ups a hiring manager pushes on
Where did you use this in your own project?
This comes up again and again. In September 2024 one candidate said the managers "asked a lot of questions about OOP and how my projects used them." Another, an associate in January 2023, got "Have you done any projects using OOP concepts?" Back in November 2020 a loop asked which OOP programs the candidate had built. Since most Lockheed interviews are a resume walk-through anyway, the definition question is often a bridge into your own code.
Pick one project before the interview and find one real place each pillar shows up. A private field with a setter that checks a range is encapsulation. Two classes behind one base class or interface give you inheritance and polymorphism. Wrapping a messy library or a serial protocol in a clean class is abstraction. Say what the design bought you, like "adding the second sensor type took one new class." If you didn't use OOP, say so and say what you'd change. That's a stronger answer than stretching a script into a class hierarchy.
Real-time versus non-real-time (2023)
The December 2023 Fort Worth senior loop asked "What is Polymorphism?" and then moved to real-time versus non-real-time systems. Expect that turn on embedded and flight software teams.
A real-time system is correct only if it produces the right answer by a deadline. Hard real time means a missed deadline is a failure, like a flight control loop. Soft real time means a late result loses value but the system carries on, like a video feed. A non-real-time system is judged on average throughput, and the occasional slow response is fine. What makes real-time code different is predictability: bounded worst-case timing, priority scheduling, and no surprises such as a heap allocation in the middle of a control cycle.
If the manager links it back to OOP, the question is what polymorphism costs. A virtual call is an extra indirect jump through the vtable and usually can't be inlined, but its cost is fixed, so it's still predictable. The F-35 standard calls class hierarchies appropriate "when run-time selection of implementation is required" and otherwise says to consider templates, which it calls "better-behaved and faster than virtual functions." It also bans heap allocation after initialization, so you create your objects at startup and reuse them.
template <typename Source>Position read_fix(Source& source) { return source.position(); // resolved at compile time, can be inlined}GpsReceiver gps; // created once at startup, no heapPosition fix = read_fix(gps);How to answer so it sounds like you
Keep each first answer to two or three sentences, then stop. The manager is often working down a list, and a short, right answer gets you to the next question while a long one eats the time you want for your projects. Use your own words. A January 2025 Orlando candidate was asked to "Describe OOP" and a March 2022 one to define the concepts "in your own words", which is a polite way of saying a memorized definition won't do.
Sounds like an engineer
- Give one concrete example per answer, ideally from your own code.
- Name both kinds of polymorphism, then lead with run-time.
- Answer in the language the role uses, usually C++ on embedded and avionics teams.
- Admit a gap and reason it out: "I haven't used multiple inheritance, but I'd expect..."
Sounds like a flashcard
- Recite four definitions without one example.
- Mix up encapsulation and abstraction.
- Claim OOP is always better than procedural code.
- Write code unless asked; this round is spoken.
Common questions
Does Lockheed Martin ask OOP interview questions?
Yes, more than any other technical topic. Forty-eight reports from 2019 to July 2026 mention them, four of them in the last 12 months, and an October 2026 Orlando embedded intern listed OOP among the C++ questions. They're asked out loud by the hiring manager, usually in the same single interview as the STAR questions.
Do I answer in C++ or Java?
In the language the role uses. C++ dominates the embedded and avionics reports, and one 2024 Canadian loop asked "mostly OOP questions in C++". Java came up in a 2021 Halifax loop and a 2020 new-grad loop. Know how each pillar looks in both.
Are design patterns part of this?
On some teams. A Fort Worth SWE II in May 2026 got design pattern questions right after the OOP ones. They're covered in Design Patterns: Name One and Say Where You Used It.
Key Takeaways
- ✓OOP is the most reported Lockheed Martin technical topic: 48 reports from 2019 to July 2026, all spoken.
- ✓Know the four pillars with one example each, and keep encapsulation and abstraction apart.
- ✓For polymorphism, name compile-time and run-time, then give a real example from your own code.
- ✓Expect follow-ups on your projects and, on embedded teams, real-time versus non-real-time.
Lockheed Martin interview guideKnow what Lockheed Martin asks before you walk in.
14 coding · 3 system design · 50 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.