Design Patterns: Name One and Say Where You Used It
- Know how the design pattern question has been asked at Lockheed Martin, newest report first
- Explain singleton, factory, observer, strategy and adapter in two spoken sentences each
- Tie every pattern you name to a project you built, and survive the obvious follow-up
Understanding the question
Something like this, asked aloud by the hiring manager: "Are you aware of any design patterns? Have you used one in your own code? Tell me about it."
The newest report is from May 2026. A software engineer II in Fort Worth, who accepted an offer, said the interview "wasn't too technical heavy" and "asked a couple object oriented questions and some design pattern questions." Those two lines are all the report says. The pattern questions came alongside the OOP ones, and nothing in the report suggests a whiteboard or an editor.
The older reports fill in the wording. In September 2017 a hiring manager on a phone call asked an associate whether they knew a design pattern and what design patterns are, then said "Name a design pattern." A Halifax onsite in March 2017 asked about "software design patterns used in the past." A Montreal junior developer in January 2017 got design patterns among Java questions on interfaces and threads. Two 2014 hires, in Manassas and in Marion, Massachusetts, were asked which patterns they were aware of or had used while coding.
| How the candidate wrote it | Role and place | Date |
|---|---|---|
| "a couple object oriented questions and some design pattern questions" | Software engineer II, Fort Worth (offer) | May 2026 |
| "Name a design pattern", and what design patterns are | Associate software engineer, US (offer) | September 2017 |
| "Software design patterns used in the past" | Software engineer, Halifax (offer) | March 2017 |
| Java questions on interfaces, threads, "design pattern etc." | Junior developer, Montreal | January 2017 |
| "what design patterns I'm aware of" | Software engineer, Manassas (offer) | November 2014 |
| "Are you aware or have you used any design patterns while coding?" | Software engineer, Marion, MA (offer) | July 2014 |
| Design patterns named among the topics | Software engineer, Colorado Springs | 2009 |
Seven reports across seventeen years is a small number, and only one is from the last twelve months. Some teams ask it, and many loops never do. It costs an evening to prepare, though, and the 2026 report shows it's still in use. No report asks you to apply a pattern to a fresh problem, draw a class diagram, or code one up. The question is recall plus experience. Do you know what a pattern is, and have you ever used one for a reason?
What a good answer has to do
What the interviewer is checking
A hiring manager working from a prepared list wants three things in about a minute. Can you define the term without stumbling? Can you name a real pattern and say what problem it solves? And did you ever use one on purpose, or did you just memorize a list? The third is the one that separates answers, because anybody can recite "singleton means one instance."
Do
- Define design patterns in one sentence before naming any
- Name a pattern from your own code, even if a more famous one comes to mind
- Say the problem first, then how the pattern fixed it
- Mention one cost or risk of the pattern you picked
- Keep a C++ or Java sketch in your head in case they ask
Don't
- Recite all 23 patterns from the classic book
- Name a pattern you can't explain past its name
- Claim a pattern your project didn't really use
- Turn it into a lecture; stop after a minute and let them ask
How long and how deep
It's a short segment inside a longer interview. The same panel will also ask OOP questions, resume questions and STAR questions, so a pattern answer that runs five minutes eats someone else's time. Aim for about a minute per pattern, then stop. If they want more, they'll ask for the code or a second pattern.
- Reports: seven. From 2009 to May 2026, all firsthand. One falls in the last twelve months.
- Who asks: usually the hiring manager. Where a report names the asker, it is a manager, alone or with a lead, by phone or onsite.
- Format: spoken. No report describes writing a pattern in an editor or on a whiteboard.
- Applied to a problem: never reported. The question is "name one" or "which have you used," every time.
The five patterns to have ready
If they ask what design patterns are, say this: a design pattern is a named, reusable answer to a design problem that keeps coming up in object-oriented code. The names come mostly from the 1994 book Design Patterns by Gamma, Helm, Johnson and Vlissides, often called the Gang of Four. It describes 23 patterns in three groups. Creational patterns control how objects get made, structural ones control how objects fit together, and behavioral ones control how objects talk to each other. You don't need all 23. Five cover nearly every project a candidate is likely to describe, and they span all three groups.
Singleton (creational)
Exactly one instance of a class, reachable from anywhere. Settings, a logger, one connection to a piece of hardware.
Factory (creational)
One function decides which concrete class to build, so callers ask for "a parser for this format" and never name the class.
Observer (behavioral)
One object keeps a list of listeners and tells each of them when something changes. Event handlers and GUI updates work this way.
Strategy (behavioral)
A family of swappable algorithms behind one interface, chosen at run time. A comparator passed to a sort is the everyday example.
Adapter (structural)
A thin wrapper that makes a class with the wrong interface fit the one your code expects. Common when wrapping an old library.
To make the patterns concrete, the diagram puts all five into one small practice program, an imaginary sensor dashboard. It's an example built for this lesson, and it doesn't describe any Lockheed system. Blue is code we don't own, violet is a class we write, amber is the object that notifies others, and green is shared state.
1) Bytes arrive through the adapter. The Old radio library hands over raw bytes using its own method names. The Radio adapter implements the interface our program expects and translates each call, so nothing past it knows the old library exists.
2) The factory picks a parser. Each message names its format. The Parser factory returns the right parser for it through a shared base type, and the reading it produces goes to the Altitude feed.
3) The feed notifies its listeners. The feed calls the Display screen, the Logger and the Low altitude alarm in turn. Each does its own job with the reading. The feed never learns what that job is.
4) Strategy and singleton do the supporting work. The display smooths readings with whatever Smoothing strategy is currently set. The alarm and the display both read their units and thresholds from the one Settings singleton.
You won't be asked to draw this. It helps to have one picture where every pattern has an obvious job, though, because then "where did you use it" has an answer even if your own project only used two of them.
The spoken answer, as an interface
Every pattern answer follows the same four beats, in this order. Think of them as the calls your answer has to make before it returns.
Potential deep dives
"Name a design pattern" (2017)
This is the 2017 associate's wording, from a hiring manager on a phone screen. It's the easiest version and the one where answers vary most, because the question puts no limit on how much you say.
Approach
"Singleton. It's a class that only has one instance." Then silence.
Challenges
It's correct and it tells the interviewer nothing about you. Singleton is a common first pick, so the follow-up is predictable: why would you want only one, and what's wrong with that? An answer that stops at the definition leaves you unprepared for exactly the question that comes next.
Approach
"Observer. One object keeps a list of listeners and notifies each one when its state changes. It solves the problem of an object needing to tell several others about a change without knowing who they are. A button click handler is the everyday example: the button doesn't know what the handlers do."
Challenges
This shows you understand why the pattern exists, which puts it well ahead of a bare definition. What's missing is you. The example is a textbook one, so the interviewer still can't tell whether you've ever reached for the pattern yourself. On a team that asks "which have you used," this answer leads straight to that follow-up.
Approach
"Observer. A subject keeps a list of listeners and calls each one when something changes. In my capstone, a sensor reader had to update a live plot, a CSV logger and a threshold alert. I first had the reader call all three directly, and every new output meant editing the reader. Switching to observer meant each output subscribed itself, and adding the alert took one line."
Challenges
Then name the cost before they ask. "In C++, a listener destroyed without unsubscribing left the reader calling a dangling pointer, so listeners unsubscribe in their destructor." One sentence like that shows you've debugged the pattern yourself. Keep the answer under a minute, and swap in your own project's details.
The 2017 associate was also asked what design patterns are, in the same call. That's the one-sentence definition from earlier: a named, reusable answer to a design problem that keeps coming up. Say it first, then name the pattern. The same call went on to real-time scheduling and C++ template classes, so the pattern question was one item on a longer list. Answer it cleanly and move on.
"Which design patterns have you used in the past?" (2014, 2017)
The Halifax onsite in 2017 and the Marion manager in 2014 both asked about your own use. This is harder than naming one, because you need a real project, and plenty of candidates have used patterns without knowing their names. Go through your projects before the interview and label what's already there. A config class with a static instance is a singleton. A function that returns a different subclass depending on input is a factory. Any callback list is an observer. Passing a comparator or a function into another function is a strategy.
Approach
Picking an impressive name like abstract factory or visitor because it sounds senior, then describing a project that didn't really use it.
Challenges
The panel is often a hiring manager and an engineer from the team, and an engineer who hears the claim can ask one question about how it worked. "Which classes were the visitors?" ends the answer. A small pattern you really used is worth far more than a big one you can't defend.
Approach
"I've used factory and strategy. On my team project the factory created the right message handler for each packet type, and the strategy let users pick between two path-planning algorithms at run time." Each one gets a sentence on the problem it solved.
Challenges
Solid, and enough for most interviews. It can feel like a list, though. If the interviewer seems interested, pick the one with the better story and go one level deeper: what the code looked like before, and what changed after.
Approach
Give the Good answer, then add a decision: "I also considered a singleton for the database connection and decided against it. Tests needed a fake connection, and a singleton made that awkward, so I passed the connection into the classes that needed it instead."
Challenges
Saying why you passed on a pattern shows judgment, and judgment is hard to fake. It also connects naturally to the design-choice STAR question several Lockheed loops ask. The risk is rambling, so keep each decision to two sentences.
Singleton, for the one shared instance
Spoken answer: a singleton makes sure a class has exactly one instance and gives the whole program one way to reach it. Use it for something that really is one of a kind, like settings loaded from a file or the one handle to a device.
The private constructor in the C++ sketch below stops anyone else from creating a second copy. Since C++11, a function-local static like this one is initialized exactly once, even if two threads call it at the same time.
class Settings {public: static Settings& instance() { static Settings the_settings; return the_settings; }private: Settings() = default; // nobody else can construct one};Tie it to a project: "Our ground-station app read units and limits from one config file, so the config class was a singleton." Then be ready for the usual follow-up about singletons: isn't that just a global variable? Mostly, yes. It hides a dependency and makes tests harder, because every test shares the one instance. Say you'd keep it for truly single things and pass objects in everywhere else.
Factory, for building the right class
Spoken answer: a factory is a function or class whose job is creating objects, so the caller asks for what it needs and doesn't name the concrete class. When a new type comes along, only the factory changes.
The sketch below returns a different parser depending on the format, but the caller only ever sees the base type.
std::unique_ptr<Parser> make_parser(const std::string& format) { if (format == "json") return std::make_unique<JsonParser>(); if (format == "csv") return std::make_unique<CsvParser>(); throw std::invalid_argument("unknown format: " + format);}Tie it to a project: "Our telemetry tool read three file formats, and one factory function picked the parser, so the rest of the code just called parse." If they push, the honest cost is one more layer to read through, which isn't worth it when there's only ever one concrete class. Strictly, the Gang of Four call this the factory method when a subclass decides what to build. A plain function like this one is usually called a simple factory, and either name is fine aloud.
Observer, for telling every listener
Spoken answer: in the observer pattern, a subject keeps a list of observers and notifies each of them when its state changes. The subject doesn't know what the observers do, so you can add new ones without touching it.
Strip it down and observer is a list of callbacks plus a loop over it.
class AltitudeFeed { std::vector<std::function<void(double)>> listeners;public: void subscribe(std::function<void(double)> listener) { listeners.push_back(listener); } void publish(double feet) { for (auto& listener : listeners) listener(feet); }};Tie it to a project: any GUI, any event handler, any time one change had to reach several places. Two follow-ups are worth preparing. A destroyed listener that never unsubscribed leaves the subject calling freed memory in C++, so unsubscribe in the destructor or hold weak references. And if a listener subscribes or unsubscribes during a publish, looping over the live list can break, so loop over a copy.
Strategy, for swapping the algorithm
Spoken answer: strategy puts each version of an algorithm in its own class behind one interface, and the object that uses it holds whichever one is set. It replaces a growing if-else chain with a swap.
In the Java sketch, the display never checks which smoothing it has. It just calls apply.
interface Smoothing { double apply(double[] readings); }class SensorDisplay { private Smoothing smoothing; // any Smoothing can be set at run time void setSmoothing(Smoothing choice) { smoothing = choice; } double shown(double[] readings) { return smoothing.apply(readings); }}Tie it to a project: "We had two routing algorithms and a setting to pick one, so each was a class behind the same interface." Java's sort with a comparator is the standard library version of the same idea. Strategy is also polymorphism put to work, which is a good bridge if the interviewer has just asked about polymorphism. The OOP pillars lesson covers that side.
Adapter, for an interface that doesn't fit
Spoken answer: an adapter wraps a class whose interface doesn't match what your code expects and translates each call. You use it when you can't change either side, which is common with vendor libraries and older code.
The sketch implements the interface our code wants and forwards to the old method underneath.
class LegacyRadioAdapter implements Radio { private final OldRadio oldRadio; LegacyRadioAdapter(OldRadio oldRadio) { this.oldRadio = oldRadio; } public void send(String text) { oldRadio.transmitBytes(text.getBytes()); }}Tie it to a project: "We wrapped an old serial-port library in an adapter, so the rest of the app used our own interface and we could swap in a simulator for tests." Testing against a simulator is the strongest reason to give, because an adapter is also how you put a fake behind a real interface. A common follow-up is adapter versus facade. An adapter changes one interface into another, while a facade puts one simple interface in front of a whole subsystem.
The older UML question
A 2010 Santa Clara onsite asked candidates to explain UML, use cases and sequence diagrams next to C++ OOP questions, and no report since has mentioned UML.
Practice the core in code
None of the Lockheed reports asks you to code a pattern, so this is practice rather than a reported question. Observer is the pattern with the most moving parts, and writing a small one makes the follow-ups about order, duplicates and unsubscribing much easier to answer aloud.
Alert Hub With Observers
Problem
AlertHub where listeners subscribe to topics and receive every message published to a topic they're subscribed to.subscribe(listener, topic) adds the listener to the topic and returns true. If the listener is already subscribed to that topic, it changes nothing and returns false. unsubscribe(listener, topic) removes it and returns true, or returns false if it wasn't subscribed.publish(topic, message) delivers the message to every listener currently subscribed to the topic, in the order they subscribed, and returns the list of listeners it reached. A listener who unsubscribes and subscribes again goes to the back of the order. inbox(listener) returns every message that listener has received, oldest first, or an empty list for a listener that has never received one.Input encoding. A test case is a JSON array of operations. The first entry is
["AlertHub", []] and each later entry is [method, [args]]. The expected array holds each operation's return, with null for the constructor.- AlertHub()
- subscribe("display", "altitude")→ true
- subscribe("logger", "altitude")→ true
- publish("altitude", "12000 ft")→ ["display","logger"]
- inbox("display")→ ["12000 ft"]
Both listeners are on the altitude topic, so the message reaches them in the order they subscribed.
Keep two dictionaries: topic to an ordered list of listeners, and listener to its received messages. Publish walks one list and appends to the other.
Alert Hub With Observers
Click "Run" to execute your code
What is expected at each level
Intern, associate and early career
This is where the 2017 associate report sits. You need the one-sentence definition, one pattern explained well, and one example. A class project counts as "where you used it." If you genuinely haven't used a pattern, say which one you'd reach for and why, rather than inventing a project. The bar: define design patterns cleanly and explain one pattern with a real or class-project example.
Software engineer and SWE II
The May 2026 report is a SWE II, and the two 2014 reports are software engineer hires. The 2014 Marion manager asked which patterns you'd used while coding, and that's the safer version to prepare for at this level. Bring two patterns from work, each with the problem it solved and what it cost. The bar: two patterns from your own code, each with a reason and a trade-off, delivered in about a minute.
Senior and staff
No senior or staff report names a design pattern question. Senior loops dig into your resume and your stack instead, so if patterns come up, they'll come up inside a project story. Have one pattern decision from a system you led: what you chose, what you rejected, and what happened. The bar: a pattern decision you made on a real system, including one you decided against and why.
Common questions
Does Lockheed Martin ask design pattern questions?
On some teams. A Fort Worth SWE II got them in May 2026, and six older reports from 2009 to 2017 mention them. They're asked aloud, usually by the hiring manager and next to OOP questions.
Will I have to code a design pattern?
No report says so. Every version asks you to name a pattern, define the term, or say which ones you've used. A short sketch in your head helps if they ask how it works, but there's no editor in this part of the interview.
Which language should I use, C++ or Java?
Use the one your resume leads with. Recent Lockheed reports ask a lot of C++ questions, especially for embedded roles, while the 2017 Montreal report asked design patterns among Java questions. The five patterns look almost the same in either language.
Key Takeaways
- ✓Design pattern questions are asked aloud, newest in May 2026; no report asks you to code or apply one.
- ✓Have singleton, factory, observer, strategy and adapter ready, each in two sentences.
- ✓Every pattern you name needs a real project, the problem it solved and one cost.
- ✓Expect the singleton-is-a-global and dangling-observer follow-ups, and answer them before they ask.
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.