UBS
Radisson Hotels Interview Questions and Answers
Q1. Where we store the object of string
Objects of String are stored in the String Pool in Java.
String objects are stored in the String Pool, a special memory area in Java heap memory.
String literals are automatically stored in the String Pool.
String objects created using the new keyword are not stored in the String Pool.
String.intern() method can be used to store a String object in the String Pool.
Q2. What is query parameters and path param
Query parameters are used to pass data to a web server through the URL, while path parameters are part of the URL itself.
Query parameters are key-value pairs added to the end of a URL after a '?'
Path parameters are variables within the URL path itself, denoted by curly braces {}
Example of query parameter: www.example.com/api/users?id=123
Example of path parameter: www.example.com/api/users/{userId}
Q3. What is bean in springboot
A bean in Spring Boot is a Java object that is instantiated, assembled, and managed by the Spring IoC container.
Beans are defined in the Spring configuration file or using annotations like @Component, @Service, @Repository, etc.
Beans are singleton by default but can be scoped as prototype, request, session, etc.
Beans are injected into other beans using dependency injection.
Example: @Component annotation is used to define a bean in Spring Boot.
Q4. Difference between HashMap and ConcurentHashMap
HashMap is not thread-safe while ConcurrentHashMap is thread-safe.
HashMap is not thread-safe and can cause ConcurrentModificationException if modified while iterating.
ConcurrentHashMap allows concurrent modifications without causing any exception.
ConcurrentHashMap achieves thread-safety by dividing the map into segments and locking only a portion of the map during updates.
ConcurrentHashMap is suitable for high-concurrency scenarios where multiple threads are accessing and mod...read more
Q5. Diff between exception and error
Exceptions are recoverable errors that can be handled in code, while errors are unrecoverable issues that usually result in program termination.
Exceptions are checked at compile time, while errors are unchecked.
Exceptions are subclasses of Throwable, while errors are subclasses of Error.
Examples of exceptions include FileNotFoundException, NullPointerException, while examples of errors include OutOfMemoryError, StackOverflowError.
Q6. Java 8 new features
Java 8 introduced several new features including lambda expressions, streams, functional interfaces, and default methods.
Lambda expressions allow you to write code in a more concise and readable way.
Streams provide a way to work with sequences of elements and perform operations on them.
Functional interfaces are interfaces with a single abstract method, which can be implemented using lambda expressions.
Default methods allow interfaces to have method implementations.
Some other ...read more
Interview Process at Radisson Hotels
Top Java Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month