Blue Yonder
Acuity Knowledge Partners Interview Questions and Answers
Q1. What is pessimistic locking and optimistic locking?
Pessimistic locking is when a resource is locked for a long time, while optimistic locking is when a resource is locked only when it is being modified.
Pessimistic locking involves locking a resource for a long time to prevent other users from accessing it.
Optimistic locking involves locking a resource only when it is being modified, allowing other users to access it in the meantime.
Pessimistic locking is useful when conflicts are likely to occur, while optimistic locking is u...read more
Q2. Check whether two strings are anagrams of each other
Check if two strings are anagrams of each other
Create a character count array for both strings
Compare the character count arrays
If they are equal, the strings are anagrams
Q3. List some REST endpoints for a ticket booking system
REST endpoints for a ticket booking system
GET /events - get list of available events
GET /events/{id} - get details of a specific event
POST /events/{id}/tickets - book tickets for an event
GET /bookings - get list of all bookings
GET /bookings/{id} - get details of a specific booking
PUT /bookings/{id} - update a booking
DELETE /bookings/{id} - cancel a booking
Q4. Java performance and query optimization in oracle
Java performance and query optimization in Oracle
Use prepared statements to avoid SQL injection and improve performance
Use indexes to speed up query execution
Avoid using SELECT * and only select necessary columns
Use connection pooling to reuse database connections
Use caching to reduce database round trips
Tune database parameters like buffer cache and shared pool size
Use profiling tools to identify performance bottlenecks
Q5. Make a Java class immutable
To make a Java class immutable, use final keyword and initialize all fields in constructor.
Use final keyword for class and all fields
Initialize all fields in constructor
Do not provide setter methods
Make sure to return a new instance in any method that modifies the state
Q6. Design for shorten url
Shorten URL design involves generating a unique short code for a long URL to save space and improve usability.
Use a hashing algorithm to generate a unique short code for each URL
Store the mapping between short code and long URL in a database
Redirect users to the long URL when they access the short URL
Consider adding expiration time for short URLs to prevent abuse
Provide analytics to track usage of short URLs
Top Lead Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month