Contents
The Interview Primer: When Theory Is Tested Instead of Practice

The Interview Primer: When Theory Is Tested Instead of Practice

“Explain the difference between Abstract Factory and Factory Method.”

And do you know why they ask? Because we use it on the project! Right? RIGHT?!

Narrator: They did not.

Prologue: A theatrical performance

javascript
// Day 1: Interview
interviewer = "Do you know all the SOLID principles?"
candidate = "Yes: Single Responsibility, Open/Closed..."
interviewer = "And Liskov Substitution? Explain!"
candidate = *explains perfectly*
interviewer = "Hmm..."

// Day 30: First day at work
tech_lead = "Here is a 10,000-line file. Add a feature."
new_developer = "But... SOLID? Clean Code?"
tech_lead = "What? Yes, yes... later. Hotfix now."

// Day 60: Code review
new_developer = "Should I refactor this class?"
senior = "We don't have time. It works."
new_developer = "And tests?"
senior = "What tests?"

// Reality check:
coverage = "0%"
solid_principles = "never heard of them in production"
tdd = "what is that?"
clean_code = "maybe next sprint..."

A real story? It happens everywhere.

Chapter 1: The A-to-Z primer

Scene 1: The theory marathon

The interview, 2 hours:

Minutes 0–15: "Tell us about yourself"
You: "10 years of experience, Spring Boot, Angular..."
Interviewer: *nods* "OK, let's get technical."

Minutes 15–30: Algorithms
"Write quicksort on the whiteboard."
"What is the time complexity?"
"And the space complexity?"
*inner voice: "When did I last write quicksort? 2008?"*

Minutes 30–45: Design patterns
"Difference between Strategy and State?"
"When do you use Singleton?"
"Why is Singleton an anti-pattern?"
"But when should you use it?"
"But why is it an anti-pattern?"
*brain: stopped working*

Minutes 45–60: Java specifics
"Difference between String and StringBuilder?"
"How does HashMap work internally?"
"What is ConcurrentHashMap?"
"Why is synchronized dangerous?"

Minutes 60–90: Framework knowledge
"How does Spring AOP work?"
"What is the Bean Lifecycle?"
"Difference between @Component and @Service?"
"When do you use @Transactional?"
"And propagation?"
*inner voice: "I Google this every week..."*

Minutes 90–120: Testing and best practices
"TDD approach?"
"Required test coverage?"
"SOLID principles?"
"Clean Code principles?"

The end:
Interviewer: "Thank you, we'll be in touch."
You: *brain.exe stopped working*

Scene 2: The knowledge paradox

javascript
// Scenario A: You know too little
interviewer = "They don't know all the principles..."
decision = "❌ Insufficiently qualified"

// Scenario B: You know exactly enough
interviewer = "They know everything we need..."
decision = "✅ Maybe... we'll think about it"

// Scenario C: You know too much
interviewer = "They know more than I do..."
inner_thoughts = "Risk. They'll challenge me."
decision = "❌ Overqualified / Not a team fit"

// Sweet spot:
perfect_candidate = {
    knowledge: "Exactly as much as me + 10%",
    experience: "No more than mine",
    confidence: "Moderate (not threatening)",
    salary_expectations: "Below budget"
}

// Reality:
perfect_candidate_found = false
we_settled_for = "The closest approximation"

The truth:

The interviewer has worked with one technology stack for 10 years:
- Spring Boot 2.3
- MySQL
- jQuery
- SVN

The candidate has experience with:
- Spring Boot 3.x
- PostgreSQL + MongoDB
- React + Angular
- Git + GitHub Actions

Result:
"They don't have experience with our stack."

Plot twist: Their stack is eight years behind.

Chapter 2: The gap with reality

Scene 1: Interview vs first day

Interview:

Interviewer: "We use Test-Driven Development."
Candidate: "Great! I prefer TDD too."
Interviewer: "And code coverage?"
Candidate: "At least 80%."
Interviewer: "Perfect!"

First day:

bash
# Check test coverage
mvn test jacoco:report

# Output:
[INFO] Code Coverage: 0%
[INFO] Tests: 0
[INFO] Test Classes: 0

# Wait, what?

# Check the last test commit
git log --all --since="1 year ago" --grep="test"

# Output:
# (nothing)

# Check CI/CD
cat .gitlab-ci.yml

# Output:
stages:
  - build
  - deploy
# No 'test' stage

Standup in the first week:

You: "Where are the tests?"
Team: "What tests?"
You: "Unit tests? Integration tests?"
Team: "We don't have time for tests."
You: "But at the interview..."
Team: "Yes, yes... that's for candidates."
You: *silent scream*

Scene 2: SOLID vs reality

Interview:

Interviewer: "What is your approach to design?"
Candidate: "SOLID principles, Clean Code..."
Interviewer: "Exactly! Us too!"

Production code:

java
// UserController.java (3,500 lines)
@RestController
public class UserController {
    
    // Injected dependencies: 15 services
    @Autowired private UserService userService;
    @Autowired private EmailService emailService;
    @Autowired private SmsService smsService;
    @Autowired private NotificationService notificationService;
    @Autowired private LoggingService loggingService;
    @Autowired private AuditService auditService;
    @Autowired private CacheService cacheService;
    @Autowired private ValidationService validationService;
    @Autowired private AuthService authService;
    @Autowired private PermissionService permissionService;
    @Autowired private ReportService reportService;
    @Autowired private AnalyticsService analyticsService;
    @Autowired private SearchService searchService;
    @Autowired private ExportService exportService;
    @Autowired private ImportService importService;
    
    @PostMapping("/users")
    public ResponseEntity createUser(@RequestBody UserDTO dto) {
        // 500 lines of code
        // - Validation
        // - Business logic
        // - Database operations
        // - Sending emails
        // - Sending SMS
        // - Notifications
        // - Logging
        // - Audit
        // - Updating cache
        // - Analytics event
        // - Generating reports
        // Everything in ONE method!
        
        // Where is Single Responsibility?
    }
    
    // ... 50 more similar methods
}

// Comments in the code:
// TODO: Refactor this mess
// TODO: Split into services
// TODO: Add tests
// TODO: Apply SOLID
// (Comments from 2019, still here in 2024)

Code review:

You: "This violates Single Responsibility..."
Senior: "It works. No need to touch it."
You: "But we could refactor..."
Senior: "No time. Next feature."

And that is how technical debt is born...

Scene 3: Clean Code vs chaos

Interview:

Interviewer: "Have you read Clean Code?"
Candidate: "Yes, Robert Martin is great!"
Interviewer: "We follow it! Clear names, small functions..."

Production code:

java
// OrderService.java

public class OrderService {
    
    // Method 1: What does this do?
    public void processOrder(Order o) {
        // 800 lines of code
        // No comments
        // Variables: a, b, c, tmp, tmp2, result, r
        // Nested ifs: 8 levels deep
        // Multiple returns in random places
        // Side effects everywhere
        
        if (o.getType() == 1) {
            if (o.getStatus() != null) {
                if (!o.getStatus().equals("")) {
                    if (o.getItems() != null && o.getItems().size() > 0) {
                        for (Item i : o.getItems()) {
                            if (i.getPrice() > 0) {
                                if (i.getQuantity() > 0) {
                                    // Business logic niekde tu
                                    // Good luck finding it!
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    
    // Method 2: Creative naming
    public String doIt(String s, int n) {
        String tmp = s;
        for (int i = 0; i < n; i++) {
            tmp = tmp + "x";
        }
        return tmp;
    }
    
    // Method 3: Magic numbers everywhere
    public boolean validate(Order order) {
        if (order.getTotal() > 1000 && 
            order.getItems().size() < 50 &&
            order.getWeight() < 100 &&
            order.getStatus() == 3) {
            return true;
        }
        return false;
    }
}

// Git blame:
// Author: Architect (left the company 5 years ago)
// Last modified: 2019
// Comments: 0
// Tests: 0
// TODO: Rewrite (from 2019)

Chapter 3: Patterns of behavior

Pattern #1: The gatekeeper syndrome

yaml
Symptom:
  interviewer_experience: "10 years with the same stack"
  interviewer_knowledge: "Deep but narrow"
  interviewer_fear: "Being replaced or challenged"

Behavior:
  tests_everything: true
  asks_trivial_questions: true
  focuses_on_theory: true
  ignores_practical_experience: true

Result:
  hires_junior: "Safe, no threat"
  rejects_senior: "Overqualified / Too expensive"

Reality:
  project_problems: "Persist forever"
  technical_debt: "Grows exponentially"
  team_frustration: "High"

Example conversation:

Gatekeeper: "How does HashMap work internally?"
Candidate: "Hash function, buckets, collision handling..."
Gatekeeper: "Good. And the load factor?"
Candidate: "0.75 by default, rehashing at 75% capacity..."
Gatekeeper: "Hmm... Why exactly 0.75?"
Candidate: "A balance between memory and performance..."
Gatekeeper: "And which algorithm does it use for rehashing?"
Candidate: "Um... capacity * 2..."
Gatekeeper: "❌ Insufficient knowledge of the internal implementation"

// Meanwhile in production:
// HashMap used: 5 times in the entire codebase
// HashMap performance problems: 0 (ever)
// Time lost on theory: 2 hours
// Actual problems to solve:
//   - 0% test coverage
//   - 10,000-line classes
//   - No documentation
//   - Legacy code from 2015

Pattern #2: Programming theater

yaml
Interview stage:
  we_say: "We use TDD"
  we_say: "We follow SOLID"
  we_say: "We practice Clean Code"
  we_say: "We have 80% coverage"
  we_say: "We do code reviews"

Production reality:
  tdd: false
  solid: false
  clean_code: false
  coverage: 0%
  code_reviews: "Approved without reading"

Why the theater?
  recruitment: "We must sound professional"
  candidates: "They want to hear best practices"
  everyone: "Pretends it is true"

Truth:
  nobody_believes_it: true
  everyone_plays_the_game: true
  nothing_changes: true

A real dialogue:

// Interview
Candidate: "What is your definition of done?"
Interviewer: "Tests pass, coverage >80%, code review, deployed."

// Production (week 3)
You: "Can I see the CI/CD pipeline?"
Team: "We don't have one."
You: "But how do you test?"
Team: "Manually. In production."
You: "..."
Team: "It's worked for years!"

Narrator: It had not worked for years.

Pattern #3: The AI-era paradox

javascript
// 2024 - AI everywhere

// Interview:
interviewer = "Do you use AI tools?"
candidate = "Yes, GitHub Copilot, ChatGPT..."
interviewer = "Great! The future!"

// Production:
codebase_year = 2015
last_refactoring = 2017
test_coverage = "0%"
ci_cd = false
code_reviews = "Occasionally"
documentation = "Maybe in the wiki"

// Problem:
ai_tools = "Won't fix a legacy mess"
copilot = "Suggests based on existing (bad) patterns"
chatgpt = "Can't fix 10 years of technical debt"

// Irony:
we_talk_about_ai = "At every meeting"
we_use_ai_for = "Writing commit messages"
we_ignore = "Basic software engineering"

// Result:
productivity = "Same as 2015"
code_quality = "Worse (AI amplifies bad patterns)"
technical_debt = "Growing rapidly"

A real scenario:

Manager: "Use AI to speed up development!"

Developer uses Copilot:
// Copilot suggests based on existing code
// Existing code = 0 tests, bad patterns

Result:
// AI generates code in the same bad style
// Now we have MORE bad code, faster!

Example:
// Existing code:
public void doSomething(String s, int n) { ... }

// Copilot suggestion:
public void doSomethingElse(String s2, int n2) { ... }

// Perfect! Equally bad naming, equally bad structure!
// Technical debt increased: +20%

Chapter 4: Solutions

Solution 1: Practical interviews

yaml
Instead of:
  "Explain the SOLID principles" (theory)

Try:
  "Show me your GitHub projects" (practice)
  "Let's walk through this code" (real code)
  "How would you solve X?" (practical problem)

Focus on:
  ✅ Problem-solving ability
  ✅ Communication skills
  ✅ Real experience
  ✅ Code they have written

Skip:
  ❌ Theoretical trivia
  ❌ Algorithm puzzles (unless needed)
  ❌ Naming design patterns
  ❌ Framework internals

A good interview:

Interviewer: "Here is our current problem..."
*Shows a real production problem*

Candidate: "OK, I'll try..."
*Discusses an approach, asks questions, sketches a solution*

Result:
✅ You see how they think
✅ You see how they communicate
✅ You see their experience
✅ Relevant to the actual job

Solution 2: Honest job descriptions

yaml
Bad job description:
  we_use: "TDD, SOLID, Clean Code, microservices"
  reality: "Legacy monolith, 0% coverage, no tests"
  result: "Disappointed new employees, high turnover"

Good job description:
  we_have: "A legacy codebase from 2015"
  we_need: "Help modernizing and adding tests"
  we_offer: "Freedom to improve, time to refactor"
  result: "The right expectations, a happy team"

Honest vs theatrical:

Theatrical version:
"We use cutting-edge technology, TDD, microservices..."

Honest version:
"We have a PHP monolith from 2010 that needs some love.
No tests yet. We want to change that.
If you enjoy refactoring and modernization, you'll feel at home."

Which attracts better candidates?
The honest version! People who WANT to fix things! ✅

Solution 3: Assess actual skills

yaml
Test what matters:
  ✅ Can they write working code?
  ✅ Can they read existing code?
  ✅ Can they debug problems?
  ✅ Can they learn quickly?
  ✅ Can they communicate?

Do not test:
  ❌ Memorized algorithms
  ❌ Names of design patterns
  ❌ Framework internals
  ❌ Quiz questions

Practical assessment:

java
// Provide this code:
public class OrderProcessor {
    public void process(Order order) {
        if (order.getTotal() > 1000) {
            order.setDiscount(0.1);
        }
        order.setProcessed(true);
        save(order);
    }
}

// Ask:
"Production users report that discounts are not being applied correctly.
How would you debug it?"

// Good answers:
✅ "I would add logging to see the actual values"
✅ "I would write a test to reproduce the problem"
✅ "I would check orders over 1000 in the database"
✅ "I would inspect the order.getTotal() calculation"

// Bad answers:
❌ "I would explain HashMap internals"
❌ "I would recite the SOLID principles"
❌ "I would draw a UML diagram"

Chapter 5: Real stories

Story 1: The perfect interview

Candidate: Applied to a startup
Position: Senior Java Developer

Interview (2 hours):
- 30 min: Discuss experience (real projects)
- 60 min: Pair programming on a real problem
- 30 min: Questions from both sides

Pair programming:
"Our API is slow. Here is the profiler output. Investigate."

Candidate:
✅ Analyzed the profiler
✅ Found an N+1 query problem
✅ Proposed a solution
✅ Discussed trade-offs
✅ Asked about the cache strategy

Result:
Hired! Started a week later.

Reality:
- The project WAS slow (as they said)
- They WANTED to fix it (as they said)
- Tests existed (as they said)
- Code reviews happened (as they said)

Satisfaction: 10/10 ✅

Story 2: The theater

Candidate: Applied to a corporation
Position: Java Architect

Interview (4 hours):
- 1 hour: Algorithm questions
- 1 hour: Design patterns
- 1 hour: System design
- 1 hour: Behavioral questions

Result:
Hired! Started a month later.

Reality check (week 1):
- No architecture (just a legacy monolith)
- No design patterns (just procedural code)
- No system design (one server)
- Tests: 0%
- Documentation: 0%
- Technical debt: Maximum

Actual role:
"Fix bugs in 15-year-old code."

Satisfaction: 2/10
Left after 3 months.

Story 3: Honesty

Candidate: Applied to an agency
Position: Full-stack Developer

Interview (1 hour):
- 15 min: "We have an old PHP application, no tests"
- 15 min: "We want to modernize"
- 30 min: "Can you help? Show me examples."

Candidate showed:
✅ A similar migration project
✅ Before/after code
✅ How they added tests
✅ Results (coverage, performance)

Result:
Hired! Started in 2 weeks.

Reality:
- The project WAS old PHP (as they said)
- They WANTED to modernize (as they said)
- They GAVE time to refactor (as they said)
- They VALUED improvements (as they said)

Satisfaction: 9/10 ✅
Still there after 2 years.

Chapter 6: For interviewers

Checklist

yaml
Before the interview:
  ✅ Know what you actually do (no theater)
  ✅ Know what you actually need
  ✅ Be honest in the job description
  ✅ Prepare relevant questions

During the interview:
  ✅ Focus on practical skills
  ✅ Show real problems
  ✅ Assess problem-solving
  ✅ Check cultural fit

After the interview:
  ✅ Give feedback if rejected
  ✅ Be honest about the role
  ✅ Do not sell dreams
  ✅ Set realistic expectations

Red flags that you are doing it wrong:
  ❌ You ask questions you had to Google
  ❌ You test knowledge you do not use
  ❌ You reject overqualified candidates
  ❌ You promise what you do not have

Self-check:

javascript
ask_yourself = {
    "Do we really use TDD?": false,
    "Do we really have tests?": false,
    "Do we really follow SOLID?": false,
    "Do we really do code reviews?": false
}

if (ALL_FALSE) {
    action = "Stop pretending in interviews! Be honest!"
}

better_approach = {
    "We have legacy code": true,
    "We want to improve": true,
    "We need help with it": true,
    "Are you interested?": ask_candidate
}

result = "Better matches, a happier team, less turnover"

Chapter 7: For candidates

Red flags

yaml
During the interview, watch for:
  🚩 Only theoretical questions
  🚩 No practical assessment
  🚩 Cannot show real code
  🚩 Vague about practices
  🚩 "We follow ALL best practices"
  🚩 Perfect answers to every question
  🚩 No honest challenges mentioned

Good signs:
  ✅ Practical problems
  ✅ Real code to examine
  ✅ Honest about challenges
  ✅ Specific about practices
  ✅ Open about areas for improvement
  ✅ You meet the team
  ✅ They show the real workspace

Questions to ask:

Do not ask:
❌ "Do you use TDD?" (everyone says yes)
❌ "Do you follow SOLID?" (everyone says yes)
❌ "Do you have tests?" (everyone says yes)

Ask instead:
✅ "Can I see your CI/CD pipeline?"
✅ "What is your test coverage?"
✅ "Can you show me your code?"
✅ "What is your biggest technical challenge?"
✅ "What would you improve if you had time?"
✅ "How old is your main application?"
✅ "When was the last major refactoring?"

If they cannot answer or avoid the question:
🚩 Red flag! Theater revealed!

Conclusion

The pattern:

Interview = Theater
- We ask about things we do not use
- We promise things we do not do
- We test knowledge we do not need

Reality = Chaos
- Legacy code without tests
- No best practices
- Sky-high technical debt

Result = Frustration
- Disappointed candidates
- Companies lack the right people
- Projects suffer

Solution = Honesty
- Tell the truth about the project
- Test practical skills
- Value real experience
- Give time for improvement

Golden rules:

yaml
For interviewers:
  ✅ Be honest about what you have
  ✅ Test what you actually need
  ✅ Assess practical skills
  ✅ Do not fear strong candidates

For candidates:
  ✅ Ask about real practices
  ✅ Request a code sample
  ✅ Check the actual workflow
  ✅ Trust your red flags

For companies:
  ✅ Give time for improvements
  ✅ Value pragmatism over theory
  ✅ Hire for potential
  ✅ Support learning

Final thought:

javascript
// The best interview question:
"Here is our problem. How would you solve it?"

// The best answer:
"Let's look at it together..."

// Result:
mutual_understanding = true
realistic_expectations = true
good_match = true
happy_team = true

// Bonus:
theater = false // Finally!

This article is based on real experiences from dozens of interviews on both sides of the table. Some companies do it well; others still put on a show. The choice is yours.

P.S. If an interview tests only theory, ask: “Do you use this in production?” The reaction tells you everything.

P.P.S. The best interview is pair programming on a real problem. You see skill, communication and approach. No theater.

P.P.P.S. In the AI era, practical skills matter more than ever. Theory is not enough.

All articles