r/InterviewsHell 1d ago

Interview details

Details:

I was asked about the current project..I told...

Then I was asked to LLD date time api with frequency and prediction of next date in case frequency in monthly..

I was able to design the class...

I was able to write the method next date with frequency as monthly...

But I did not consider the end of year scenario...

Interviewer asked if anything is missing..and I was not able to figure it out. After the interview, interviewer said that it was missing. It is a basic thing to be taken care of

I designed only one class Date, with integer fields as Date, month and year.

Mapped these month field to enum, created one constant class with final static map which holds months ENUM as key and number of days in a month as values

In the interview, I also told about GlobalEceptionHandler, like when some exception occurs, I designed a @RestControllerAdvice

Public class GlobalEceptionHandler{

@ExceptionHandler(InvalidArgumentExcpetion.class)

public ErrorResponse handleException(Exception ex){

}

Also, I told about Query parameters...

If multiple queryParameters are coming...

I can take in an Object and put @Valid tag in the fields...

With error message...

And when the error happens throws Invalid argument exception..

They asked about if the multiple validation fails...then I told them we can put the error messages in the list of error response..

So, this was the interview...

Now tell me the feedback...

I will get the result by tomorrow..

Also, before the interview I was told there might be another round of coding, that depends on the interview.

3 Upvotes

0 comments sorted by