Yes, that's perfect. A heat engine absorbs heat QH from a hot reservoir. Some of it is turned into work W. The rest of it QC gets expelled to a cold reservoir. This fact is expressed in the equation QH=W+QC.
A Carnot refrigerator is a heat engine that runs backward. Instead of absorbing heat from the hot reservoir, it expels heat into the hot reservoir. Instead of expelling heat to the cold reservoir, it absorbs heat from the cold reservoir. And instead of producing work, it requires work to be done on it to move the heat from the cold to hot reservoirs.
The efficiency of a system is always output divided by input. For a heat engine, the output is work W, and the input is QH. Therefore, the efficiency is given by W/QH. Because W will always be smaller than QH, the efficiency of a heat engine will always be less than 1. Because the goal of a refrigerator is to cool off the cold reservoir, QC is the measure of its output. The input to the refrigerator is the work required to do the cooling, so the efficiency of a refrigerator is QC/W. This number is called the coefficient of performance. It's not necessarily less than 1.
So given this basic picture, can you identify which variables are given by the 18 J and 20 J figures in the problem statement?