My favorite part of an interview, to the surprise of no one that knows me here, is: OOP Theory and Design

This is the sixth thread of the series: Interview Preparation!

🧵THREAD🧵
First, you need to get comfortable with the basics & Principles of OOP:

- Object, Message, Methods
- References, State, Properties
- Encapsulation, scope, interfaces
- Classes & Constructors
- Inheritance
- Diagrams

I got you covered for these topics


⬇️
- Interfaces vs Abstract classes:

Interfaces are contracts, define boundaries, help you design to extend, and not modify

Abstract classes are "incomplete" classes, and therefore they can't be instantiated. You need to derive from them and complete its definition

⬇️
- Polymorphism: You should code a solution that uses polymorphism.

It is basically the possibility to treat several objects of different types via 1 interface.

A key idea is that the benefits of the polymorphism is perceived by the user that generalizes the usage.

⬇️
Another two key topics borderline with FP are mutability and Working with collections.

For collections you want to be comfortable using:
- filter, map, reduce,
- forEach, find, forAll, any

Or whatever equivalents there are in your preferred language.

⬇️
Practice, practice practice!

Search for exercise online, or imagine your own scenarios:
- How would you model a supermarket?
- What about a Factory?
- And a shopping cart?

Try things out and design solutions following design principles!

⬇️
Then I would recommend you to read some books or material related to:

- Design patterns (I have content coming your way 4 this)
- Refactoring
- Testing

There is always a couple of questions regarding those 3 topics!

⬇️
"Design patterns are solutions for repetitive problems we find while developing software.
Each pattern has a name for reference, the problem for which it should be applied, and a high-level solution"

Clear and short definition

You can read more here:
https://www.codejourneyclub.com/design-patterns-the-holy-grail/

⬇️
For refactoring the idea is to change the design and implementation without modifying the functionality

Then why change it?
To make it cleaner, more scalable, more extensible & overall to improve the quality

A trigger for refactoring are code smells:
https://www.codejourneyclub.com/does-your-code-smell/

⬇️
Regarding testing, you should learn about:

- Manual vs Automated testing
- Unit tests
- Integration tests
- Test coverage
- Mocks & Stubs
- Assertions
- Frameworks

And much more!

I recommend you to follow @dmokafa & @macerub, both amazing at this!

⬇️
That will be all for this thread, we covered from the very basics and fundamentals to some complex topics of OOP and design principles!

Thank you for reading, sorry for taking 2 gap days, and I will see you tomorrow for some Backend & SQL!

⬇️
You can follow @MattCodeJourney.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: