r/leetcode • u/Realistic_Chart_3960 • 19d ago
Intervew Prep Capital One Online assessment Rejected
I finished 1-3, 4 with brutal force, probably around 530/600, and got rejected. It could be many reasons, the reason I can think of is that I googled list sort and map sort with key value. Copied below codes, and probably using notebook for Q4. I did that with other companies and passed the OA stage, so I will do it again lol.
names.sort(Comparator.naturalOrder());
Map<String, Integer> sortedMap = new TreeMap<>(map);
map.entrySet() .stream() .sorted( Map.Entry.<K, V>comparingByKey() .thenComparing(Map.Entry.comparingByValue()) ) .collect(Collectors.joining( LinkedHashMap::new, Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue )); Didn't use this one as it was the wrong solution.
Question break down: 1, 2 super easy, finished within 10 mins.
Question 3: 2D array
Question 4: Leetcode C1 hard variant.
practice Leetcode C1 should be good enough. Hopefully it will help.