
UST


10+ UST Senior Software Developer Interview Questions and Answers
Q1. Middle of Linked List
Given the head node of a singly linked list, your task is to return a pointer to the middle node of the linked list.
If there are an odd number of elements, return the middle element. If t...read more
Return the middle node of a singly linked list, considering odd and even number of elements.
Traverse the linked list with two pointers, one moving twice as fast as the other
When the fast pointer reaches the end, the slow pointer will be at the middle
Return the node pointed by the slow pointer as the middle node
Lambda expressions in Java 8 are used to provide a concise way to represent a single method interface.
Lambda expressions are used to provide implementation of functional interfaces.
They enable you to treat functionality as a method argument, or code as data.
Syntax of lambda expressions is (argument) -> (body).
Example: (int a, int b) -> a + b
PUT is used to update or replace an existing resource, while POST is used to create a new resource.
PUT is idempotent, meaning multiple identical requests will have the same effect as a single request
POST is not idempotent, meaning multiple identical requests may have different effects
PUT requests are used to update an existing resource with a new representation, while POST requests are used to create a new resource
PUT requests are typically used for updating specific fields o...read more
MVC components include Model (data), View (UI), and Controller (logic) for organizing code in a software application.
Model: Represents data and business logic, interacts with the database. Example: User model storing user information.
View: Represents the UI, displays data to the user. Example: HTML/CSS templates for displaying user profile.
Controller: Handles user input, updates the model, and selects the view to display. Example: User controller handling user registration.
SOLID principles are a set of five design principles in object-oriented programming to make software designs more understandable, flexible, and maintainable.
S - Single Responsibility Principle: A class should have only one reason to change.
O - Open/Closed Principle: Software entities should be open for extension but closed for modification.
L - Liskov Substitution Principle: Objects of a superclass should be replaceable with objects of its subclasses without affecting the func...read more
Spring Boot offers basic annotations like @Controller, @RestController, @Service, @Repository, @Component.
@Controller - Used to mark a class as a Spring MVC controller.
@RestController - Combination of @Controller and @ResponseBody, used to create RESTful web services.
@Service - Used to mark a class as a service component in Spring.
@Repository - Used to mark a class as a data access component in Spring.
@Component - General-purpose stereotype annotation for any Spring-managed c...read more
N+1 SELECT problem in Hibernate occurs when a query results in N+1 database queries being executed instead of just one.
Occurs when a query fetches a collection of entities and then for each entity, another query is executed to fetch related entities individually
Can be resolved by using fetch joins or batch fetching to fetch all related entities in a single query
Example: Fetching a list of orders and then for each order, fetching the customer details separately
The @RestController annotation in Spring Boot is used to define a class as a RESTful controller.
Used to create RESTful web services in Spring Boot
Combines @Controller and @ResponseBody annotations
Eliminates the need to annotate every method with @ResponseBody
Returns data directly in the response body as JSON or XML
Hibernate provides several concurrency strategies like optimistic locking, pessimistic locking, and versioning.
Optimistic locking: Allows multiple transactions to read a row simultaneously, but only one can update it at a time.
Pessimistic locking: Locks the row for exclusive use by one transaction, preventing other transactions from accessing it.
Versioning: Uses a version number to track changes to an entity, allowing Hibernate to detect and resolve conflicts.
Q10. Fail safe fail fast Why is string immutable String buffer vs String builder Executor framework Lombok Transient Volatile Synchronized keyword Finally keyword Finalize Will finally execute if we return from try...
read moreQuestions related to Java concepts and frameworks
Fail safe fail fast - used in concurrent programming to handle exceptions and ensure thread safety
String is immutable to ensure thread safety and prevent unintended changes to the string
String buffer vs String builder - both are used to manipulate strings, but string builder is faster and not thread-safe
Executor framework - used for asynchronous task execution and thread pooling
Lombok Transient Volatile Synchronized keyword Fin...read more
Independent microservices communicate through APIs, messaging queues, or event-driven architecture.
Use RESTful APIs for synchronous communication between microservices
Implement messaging queues like RabbitMQ or Kafka for asynchronous communication
Leverage event-driven architecture with tools like Apache Kafka or AWS SNS/SQS
Consider gRPC for high-performance communication between microservices
Virtual functions in C++ allow a function to be overridden in a derived class, enabling polymorphic behavior.
Virtual functions are declared in a base class with the 'virtual' keyword.
They are meant to be overridden in derived classes to provide specific implementations.
When a virtual function is called through a base class pointer or reference, the actual function to be executed is determined at runtime based on the object's type.
Example: class Shape { virtual void draw() { ....read more
ConcurrentHashMap in Java is a thread-safe version of HashMap, allowing multiple threads to access and modify the map concurrently.
ConcurrentHashMap achieves thread-safety by dividing the map into segments, each guarded by a separate lock.
It allows multiple threads to read and write to the map concurrently, without blocking each other.
It provides better performance than synchronized HashMap for concurrent operations.
Example: ConcurrentHashMap<String, Integer> map = new Concur...read more
Routing in MVC is the process of mapping URLs to controller actions.
Routing is defined in the RouteConfig.cs file in ASP.NET MVC applications.
Routes are defined using the MapRoute method, which specifies the URL pattern and the controller and action to handle the request.
Routes are matched in the order they are defined, with the first match being used to handle the request.
Route parameters can be defined in the URL pattern and passed to the controller action as method paramet...read more
OAuth is an open standard for access delegation, commonly used for enabling secure authorization between applications.
OAuth allows a user to grant a third-party application access to their resources without sharing their credentials.
It uses tokens (access token, refresh token) to provide secure access to resources.
OAuth is commonly used in scenarios where a user wants to grant access to their social media accounts or cloud storage.
Examples of OAuth providers include Google, F...read more
Dependency injection is a design pattern where components are provided with their dependencies rather than creating them internally.
Allows for easier testing by providing mock dependencies
Promotes loose coupling between components
Improves code reusability and maintainability
Examples: Constructor injection, Setter injection, Interface injection
Hibernate caching is a mechanism used to improve the performance of applications by reducing the number of database queries.
Hibernate caching stores frequently accessed data in memory to reduce the need for repeated database queries.
There are different levels of caching in Hibernate, such as first-level cache and second-level cache.
First-level cache is associated with the Session object and is enabled by default.
Second-level cache is shared across multiple sessions and can be...read more
More about working at UST




Interview Process at UST Senior Software Developer

Top Senior Software Developer Interview Questions from Similar Companies







Reviews
Interviews
Salaries
Users/Month

