This question evaluates core competencies in Java and Spring, covering data structures and collections, object-oriented design (SOLID), hash-based collections and concurrency primitives, immutability and string handling, exception handling, Spring IoC/DI and AOP, bean lifecycle and annotations, and functional collection processing via the Stream API. Commonly asked in Software Engineering Fundamentals interviews for backend Java/Spring roles, it checks both conceptual understanding and practical application by assessing architectural reasoning, concurrency and thread-safety knowledge, and familiarity with framework conventions and APIs.
You are interviewing for a backend Java/Spring role. Answer the following conceptual questions:
ArrayList
and
LinkedList
in Java in terms of internal implementation, time complexity for common operations (access, insertion, deletion), and typical use cases.
Hashtable
and
HashSet
: what does each store, how are keys/values handled, and what about thread safety?
ConcurrentHashMap
is, how it differs from
HashMap
and
Hashtable
, and in what situations you would use it.
String
,
StringBuilder
, and
StringBuffer
in Java, including mutability and thread safety, and when you would use each.
volatile
keyword in Java. What problems does it solve and what are its limitations?
synchronized
keyword) does in Java. How does it provide thread safety and what are the trade-offs?
java.util.concurrent.atomic
package: what problem does it solve, and how do classes like
AtomicInteger
and
AtomicReference
work conceptually?
@Component
,
@Service
, and
@Repository
in Spring. What do they have in common and when would you use each?
@Controller
,
@RestController
,
@Autowired
,
@Qualifier
,
@Configuration
,
@Bean
,
@Transactional
, etc.), and what are they used for?
Login required