They asked me to design a restaurant reservation system (classes and methods). also write algorithm to decide if a binary tree is mirrored. Also order set B according to the order of set A, where A is a superset of B.
Sigiloso
Order set: int currentIndexInSetB = 0; iterate over setA in order { if (setB.contains(elementFromA) { swap(equivalentElementInB,elementAtCurrentIndexInB) currentIndexInSetB++; } } //assume both sets are passed as array. Then to use setB.contains method can create a setB via arrayB->arraylistB-> setB. This Preprocessing Increases space complexity, but allows for decreased time complexity