I'm just from a Microsoft interview it was 3 rounds. I did well in leetcode style DSA and system design, but completely bombed in the OOD question round.
Any books or resources to learn how to implement and practice proper OOD question?
The question was easy, problem was I didn't know it was coming 😭😭
Problem;
Object Oriented Design -
Design a coffee maker machine class There is a coffee maker with a screen. We need to add three ingredients into the machine: coffee beans, water and milk.
There are three types of drinks we can make, below are the default recipes:
Espresso: cost 3 coffee beans and 1 water
Americano: cost 2 coffee beans and 3 water
Latte: cost 2 coffee beans, 2 milk and 2 water
When a user comes, on the screen we show available drinks. After the user chooses a drink, the user will be able to customize the amount of ingredients. (For example, after choosing Espresso, the user can change from default to 4 coffee beans and 1 water)
The admin is able to refill the ingredients. The admin and the users interact with the machine via the screen. In the future, we might can support more drink types.
Please design a class with public APIs to represent the coffee maker, which will be called by the screen.
How do I study for Object oriented design for interviews. Leetcode doesn’t have those explore cards for this topic. I got asked a basic question like this in an interview and I wasn’t expecting it.
It was like, how would you generalize this. The answer was to design a class. I choked hard. Ima web developer going for software engineer roles
If you give me a leetcode problem I can more or less figure out a solution, but that's just a small closed-environment method. I don't understand how to make software, and also don't understand how to use objects. I understand what an object is conceptually, it is blueprint of something that we define using the class structure, but I don't understand how to use it in practice. I know we can give this object a bunch of features that we call state/attributes (example: color, top speed, max health) these are basically like NOUNS, and we can also give this object functions/actions (example: run, punch, fly), this is basically like VERBS. But I have no idea how to combine or use objects, attributes, and functions together to make a full program. I'm struggling to understand how you guys actually make software using these concepts? Also other things that confuse me, when and why do we use an initializer method and when and why do we use a main method?
How do you use classes, objects, attributes, functions together to make software?
What's a good practice project that uses all of this?