Citicorp
Smifs Interview Questions and Answers
Q1. 1. What are the Java 8 Features you've worked with?
Java 8 introduced several new features including lambda expressions, functional interfaces, and streams.
Lambda expressions allow for more concise and functional programming style.
Functional interfaces enable the use of lambda expressions.
Streams provide a powerful way to process collections of data in a functional manner.
Default methods in interfaces allow for adding new methods to existing interfaces without breaking compatibility.
Optional class helps to handle null values m...read more
Q2. How will you handle an out-of-memory exception?
Handle out-of-memory exception by analyzing heap dump and optimizing code.
Analyze heap dump to identify memory leaks
Optimize code to reduce memory usage
Increase heap size if necessary
Use memory profiling tools like JProfiler or VisualVM
Avoid creating unnecessary objects
Use caching to reduce object creation
Implement garbage collection strategies
Q3. Difference between shallow and deep comparision in Strings with code example.
Shallow and deep comparison in Strings with code example
Shallow comparison checks if two String variables refer to the same object in memory
Deep comparison checks if two String variables have the same sequence of characters
Shallow comparison can be done using the '==' operator
Deep comparison can be done using the 'equals()' method
Example: String str1 = 'hello'; String str2 = 'hello'; str1 == str2; //shallow comparison returns true
Example: String str1 = 'hello'; String str2 = ...read more
Q4. Flow of a String Boot Application
A Spring Boot application follows a predefined flow of execution.
Application starts with main() method
Spring Application Context is initialized
Beans are created and dependencies are injected
Application starts serving requests
Requests are handled by Controllers and Services
Responses are returned to the client
Q5. what are the oops concepts
Object-oriented programming concepts that help in organizing and designing code for reusability and maintainability.
Encapsulation: Bundling data and methods that operate on the data into a single unit (class).
Inheritance: Allowing a class to inherit properties and behavior from another class.
Polymorphism: Ability of objects to take on multiple forms or types.
Abstraction: Hiding the implementation details and showing only the necessary features of an object.
Q6. What is lambda expressions
Lambda expressions are anonymous functions that allow you to pass behavior as an argument to a method.
Lambda expressions are used to provide a concise way to represent behavior as data.
They are commonly used in functional programming and can be used to implement functional interfaces.
Lambda expressions can be used to iterate through collections using the forEach method.
Q7. What Java memory model
The Java memory model defines how threads interact through memory when accessing shared data.
Defines the rules for reading and writing to shared variables in a multithreaded environment
Ensures visibility of changes made by one thread to other threads
Specifies the order in which operations are executed and how they are synchronized
Q8. What is stream api
Stream API is a feature in Java that allows processing collections of objects in a functional style.
Stream API provides a way to perform operations on collections like filter, map, reduce, etc.
It supports functional programming paradigms like lambda expressions.
Example: List
names = Arrays.asList("Alice", "Bob", "Charlie"); Stream stream = names.stream();
Interview Process at Smifs
Top Senior Java Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month