31. Tell me about a time you faced a problem with multiple solutions.
Use STAR to structure your answer: briefly explain the Situation and Task, make Action the most detailed part, and finish with the Result. For example, describe a problem where several technical solutions were possible, explain how you compared their risks and benefits, involved the right people, chose the most practical option, and verified that the decision solved the problem.
In my last role, I worked on a Java service that returned data for an important application screen. The response had become slow because the service was repeatedly reading and processing the same information. We had several possible solutions, including adding a cache, changing the database query, and moving part of the processing to an asynchronous flow.
I was responsible for finding a solution that improved the response time without adding unnecessary complexity or creating problems with stale data. I also needed to explain the tradeoffs clearly so the team could make a practical decision.
I first measured where the time was being spent instead of choosing a solution based on assumptions. I reviewed the Java code, database calls, and request flow and found that most of the delay came from an expensive database query that was executed repeatedly for data that changed infrequently. I then compared the three main options. Improving the query would reduce some cost and keep the design simple, but it would not remove repeated reads. Moving the work to an asynchronous flow could improve the user response, but it would add more components and make error handling more complicated. A cache could remove most repeated reads, but I needed to consider data freshness and cache invalidation. I discussed these tradeoffs with the team and proposed first improving the query and then adding a small application cache only for the data that was safe to reuse. I chose this approach because it addressed the root cause while keeping the design understandable. I added clear expiration rules so old data would not remain indefinitely, handled cache misses by reading from the database, and kept the database as the source of truth. I also added tests for both cached and uncached paths and reviewed the behavior with the team before releasing the change.
The service became noticeably more responsive and placed less repeated load on the database. The solution was also simple enough for the team to maintain without introducing a more complex asynchronous design. I learned that when several solutions are available, I should first understand the real bottleneck, compare the tradeoffs against the actual requirements, and choose the simplest option that solves the problem reliably.
Interviewers ask this question to understand how a candidate makes decisions when there is no single obvious answer. A strong response shows that the candidate gathers evidence, compares tradeoffs, considers risks and maintainability, communicates with others, and makes a reasoned decision instead of choosing the first available solution.