public int detachWagonFromLeft() if (deque.isEmpty()) return -1; // Required by grader return deque.removeFirst();
This is TestDome's favorite object-oriented design question. It checks whether you understand tight coupling vs. loose coupling. class AlertService private MapAlertDAO storage = new MapAlertDAO(); // Hard dependency // ... testdome java questions and answers
This is the "Hello World" of TestDome Java. It tests collections, sorting, and null-awareness. // Fails hidden test for null arrays public static String[] uniqueNames(String[] arr1, String[] arr2) Set<String> set = new HashSet<>(); for (String s : arr1) set.add(s); for (String s : arr2) set.add(s); return set.toArray(new String[0]); // Not sorted! public int detachWagonFromLeft() if (deque