This is an extremely common example of inheritance, and it's used all the time- not just as an interview question.
For example, say you have a class Animal that has some default behaviors (let's say eat, speak, and walk)-
public class Animal{
public void speak(){
System.out.println("The animal made a noise!");
}
public void eat(){
System.out.println("The animal ate its food.");
}
public void walk(){
System.out.println("The animal took a step.");
}
}
So far so good, right? But then you want a specific sub-type of Animal, let's say Cat, to override the behaviors for eat and speak:
public class Cat extends Animal{
public void speak(){
System.out.println("The cat meowed!");
}
public void eat(){
System.out.println("The cat ate a mouse.");
}
}
Okay, so now what would you want to happen with this:
Animal cat = new Cat();
cat.speak();
cat.walk();
cat.eat();
See, the instance of Cat IS AN Animal, but it also has its own behavior.
This is one of the most commonly used features of OOP- extending a class to change a part of its behavior. For example, the most common way to do painting is by extending JPanel and overriding the paintComponent() method- everything else stays the same, and the program treats the Object as a normal JPanel, until the painting is done- then the code in the child class is called.
This is actually a pretty decent interview question, as the only real way to understand what I'm talking about is through the experience of actually using it. And I suggest you do get some more practice before your next interview, as this is just the tip of the iceburg- we haven't touched the ability to call parent class methods from a child, or what happens when a method is static, or mixing child and parent methods, or abstract methods, or...