Bird
0
0
LLDsystem_design~10 mins

Enum usage (VehicleType, SpotType) 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 declare an enum for vehicle types.

LLD
enum VehicleType { [1] }
Drag options to blanks, or click blank then click option'
Acar, bike, truck
B1, 2, 3
CCAR, BIKE, TRUCK
DVehicle, Spot, Type
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase or numeric values instead of identifiers.
2fill in blank
medium

Complete the code to declare an enum for parking spot types.

LLD
enum SpotType { [1] }
Drag options to blanks, or click blank then click option'
ASpot, Type, Vehicle
Bcompact, large, handicapped
C1, 2, 3
DCOMPACT, LARGE, HANDICAPPED
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase or numbers instead of identifiers.
3fill in blank
hard

Fix the error in the enum declaration for VehicleType.

LLD
enum VehicleType { CAR, BIKE, [1] }
Drag options to blanks, or click blank then click option'
ATRUCK
Btruck
C3
DVehicle
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase or numeric values in enum.
4fill in blank
hard

Fill both blanks to complete the enum and use it in a variable declaration.

LLD
enum SpotType { [1] }
SpotType mySpot = [2];
Drag options to blanks, or click blank then click option'
ACOMPACT, LARGE, HANDICAPPED
BCOMPACT
CSpotType.COMPACT
Dcompact
Attempts:
3 left
💡 Hint
Common Mistakes
Assigning variable without enum prefix or using lowercase values.
5fill in blank
hard

Fill all three blanks to declare VehicleType enum, assign a variable, and compare it.

LLD
enum VehicleType { [1] }
VehicleType myVehicle = [2];
if (myVehicle == [3]) {
    // park vehicle
}
Drag options to blanks, or click blank then click option'
ACAR, BIKE, TRUCK
BVehicleType.CAR
Dcar
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase or missing enum prefix in assignment or comparison.