Parking places design I got a question:
Design a parking system. There are 3 types of parking spaces: big, medium and small.
Implement ParkingSystem class(int big, int medium, int small). Constructor takes a number of places of types. So ParkingSystem(1,2,3) means there are 1 big place, 2 medium and 3 small.
Add method addCar(int carType) - carType takes one of three values [1,2,3] which represents big car, medium car and small car.
Method should check if there is a place for a car of such size or bigger, if yes then it parks the car in this place and returns true, else false.
For now there is no method to free parking space (when a car is leaving) but it can be added in future.
Example:

ParkingSystem ps = new ParkingSystem(1, 2, 3); // creates parking with 1 big place, 2 medium and 3 small
ps.addCar(2); //true, medium car takes medium place
ps.addCar(2); //true, medium car takes medium place
ps.addCar(2); //true, medium car takes big place
ps.addCar(1); //false, no place for big car

I wrote:
public class ParkingSystem {
    private int big;
    private int medium;
    private int small;

    public ParkingSystem(int big, int medium, int small) {
        this.big = big;
        this.medium = medium;
        this.small = small;
    }

    public boolean addCar(int car) {
        if (car == 1 &amp;&amp; isPlaceForBigCar()) {
            return parkBigCar();
        } else if (car == 2 &amp;&amp; isPlaceForMediumCar()) {
            return parkMediumCar();
        } else if (car == 3 &amp;&amp; isPlaceForSmallCar()) {
            return parkSmallCar();
        }
        return false;
    }

    private boolean parkBigCar() {
        this.big--;
        return true;
    }

    private boolean parkMediumCar() {
        if (medium &gt; 0) {
            this.medium--;
        } else if (big &gt; 0) {
            this.big--;
        }
        return true;
    }

    private boolean parkSmallCar() {
        if (small &gt; 0) {
            this.small--;
        } else if (medium &gt; 0) {
            this.medium--;
        } else if (big &gt; 0) {
            this.big--;
        }
        return true;
    }

    private boolean isPlaceForBigCar() {
        return this.big &gt; 0;
    }

    private boolean isPlaceForMediumCar() {
        return (this.big &gt; 0 || this.medium &gt; 0);
    }

    private boolean isPlaceForSmallCar() {
        return (this.big &gt; 0 || this.medium &gt; 0 || this.small &gt; 0);
    }
}

so it seems to be a little better than the worst solution but I believe there is still a lot to improve. Should I use strategy pattern to park cars or is there even better solution?
Main/Test class:
public class Main {
    public static void main(String[] args) {
        ParkingSystem ps = new ParkingSystem(1, 2, 3); // creates parking with 1 big place, 2 medium and 3 small
        System.out.println(ps.addCar(2)); //true, medium car takes medium place
        System.out.println(ps.addCar(2)); //true, medium car takes medium place
        System.out.println(ps.addCar(2)); //true, medium car takes big place
        System.out.println(ps.addCar(1)); //false, no place for big car
    }
}
this.
There's a lot of this. references in your code.  Typically in Java you only use this. where you need to in order to disambiguate variables.  Consider removing them as they're only adding noise to your code.
always True
Your park methods all return boolean, even though they all always return true. If you want to maintain the same approach, consider changing them to void.
That said, I'd be tempted to merge the isPlaceFor and park logic together into a single tryPark method that checks if it can park and parks it if it can.  This seems like a connected operation.  Are you ever likely to want to know if you can park there without actually parking the car?
Naming / Constants
You fields are big,medium,small.  You use them to track the available spaces of that size, consider being a bit more verbose with the field names to make the meaning clearer.  It'll help when you add maxAvailableBigSpaces for example.
I'd also consider adding constants for the CAR sizes.  Whilst it may be obvious at the moment that 3 is a small car, it may not be as obvious in a week/months time.
delegating
When you park a small car, you're effectively checking for the small space, and if it's not there, trying to park it as a medium car, which if it's not possible you then try to park as a large car.  You could match this approach in your code, which simplifies the logic in each stage and removes some of your duplicate checks.
switch
Combining some of the above together and using a switch expression rather than the if/elseif/else combo means that you could end up with some code more like this:
public class ParkingSystem {
    private static final int BIG_CAR = 1;
    private static final int MEDIUM_CAR = 2;
    private static final int SMALL_CAR = 3;
    private int availableBigSpaces;
    private int availableMediumSpaces;
    private int availableSmallSpaces;
    
    public ParkingSystem(int bigSpaces, int mediumSpaces, int smallSpaces) {
        availableBigSpaces = bigSpaces;
        availableMediumSpaces = mediumSpaces;
        availableSmallSpaces = smallSpaces;
    }

    public boolean addCar(int car) {
        return switch (car) {
            case BIG_CAR -&gt; tryParkBig();
            case MEDIUM_CAR -&gt; tryParkMedium();
            case SMALL_CAR -&gt; tryParkSmall();
            default -&gt; false;
        };
    }

    private boolean tryParkBig() {
        if(availableBigSpaces &gt; 0) {
            availableBigSpaces--;
            return true;
        }
        return false;
    }

    private boolean tryParkMedium() {
        if (availableMediumSpaces &gt; 0) {
            availableMediumSpaces--;
            return true;
        }
        return tryParkBig();
    }

    private boolean tryParkSmall() {
        if (availableSmallSpaces &gt; 0) {
            availableSmallSpaces--;
            return true;
        }
        return tryParkMedium();
    }
}

A simple array approach
An alternate approach, which is more concise, however I don't think is as clear to follow, would be to use the ordering of the car sizes and an array to handle the allocation.
public class ParkingSystem {
    private int availableSpaces[] = new int[3];

    public ParkingSystem(int bigSpaces, int mediumSpaces, int smallSpaces) {
        availableSpaces[2]=smallSpaces;
        availableSpaces[1]=mediumSpaces;
        availableSpaces[0]=bigSpaces;
    }

    public boolean addCar(int car) {
        if(car &gt; 3) return false;
        for(var spaceToCheck = car-1;spaceToCheck&gt;=0;spaceToCheck--) {
            if(availableSpaces[spaceToCheck] &gt; 0) {
                availableSpaces[spaceToCheck]--;
                return true;
            }
        }
        return false;
    }
}