0
0
LLDsystem_design~10 mins

Inheritance and interface notation in LLD - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to show that class Dog inherits from class Animal.

LLD
class Dog [1] Animal:
Drag options to blanks, or click blank then click option'
A:
B(Animal)
C( )
D[Animal]
Attempts:
3 left
💡 Hint
Common Mistakes
Using a colon instead of parentheses
Using square brackets instead of parentheses
Leaving the parentheses empty
2fill in blank
medium

Complete the code to declare that class Car implements the interface Vehicle.

LLD
class Car [1] Vehicle:
Drag options to blanks, or click blank then click option'
Aimplements
B(Vehicle)
C: Vehicle
D<Vehicle>
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses instead of the keyword
Using colon instead of 'implements'
Using angle brackets
3fill in blank
hard

Fix the error in the code to correctly show that class Bird inherits from Animal and implements Flyer.

LLD
class Bird [1] Animal, Flyer:
Drag options to blanks, or click blank then click option'
Aimplements
B<Animal, Flyer>
C(Animal, Flyer)
D: Animal, Flyer
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'implements' keyword with multiple parents
Using colon with multiple parents
Using angle brackets
4fill in blank
hard

Fill both blanks to correctly show that class SmartPhone inherits from Phone and implements Camera.

LLD
class SmartPhone [1] Phone [2] Camera:
Drag options to blanks, or click blank then click option'
A(
Bimplements
C)
D:
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'implements' keyword incorrectly
Using colon instead of parentheses
Not closing the parentheses
5fill in blank
hard

Fill both blanks to correctly declare class Tablet inherits from Device, implements TouchScreen, and is abstract.

LLD
abstract class Tablet {BLANK_1}} Device {{BLANK_2}} TouchScreen{
Drag options to blanks, or click blank then click option'
Aextends
Bimplements
C;
D{
Attempts:
3 left
💡 Hint
Common Mistakes
Using ';' instead of '{' to start class body
Mixing up 'extends' and 'implements'
Omitting the opening brace