Cache Casting

A company is designing the class hierarchy for various cache implementations:

public class Cache {}

public class DiskCache extends Cache {}

public class MemoryCache extends Cache {}

public class OptimizedDiskCache extends DiskCache {}

Select all the answers that will result in a runtime exception.

(Select all acceptable answers.)

Tags

  • AI-resistant
  • Java
  • Inheritance
  • OOP
  • Public
  • Hard

Information

Difficulty: Hard

Duration: 3 min

Score Distribution

% of candidates
0-33%
34-67%
68-100%
Score

Would you like to see our other questions?

We have 1000+ premium hand-crafted questions for 160+ job skills and 20+ coding languages. We prefer questions with small samples of actual work over academic problems or brain teasers.

Would you like to see our tests?

The following tests contain Java related questions:

On the blog

Since we're all biased and we use incorrect proxies, why not just outsource hiring to experts or recruitment agencies? After all, they've been screening people for many years, so they must know how to do it right?

Not really. I was surprised to discover that many experts...