Forum

Posted by Sylvia, April 20, 2022, 9:39 p.m.

Question 92

  • Write a query to return the acceptance rate for the first week of 2021 (2021-01-01 - 2021-01-07)

I thought the friend request has to be accepted within the seven-day window. In an interview, should I ask the interviewer for clarification on "the acceptance rate", either it is referring to a request that eventually gets accepted OR it is a request that gets accepted within the same timeframe?

Answers

Hey Sylvia,

The friend request doesn't have to be the same day. Think about this, you send me a friend request last night, I saw it this morning and accepted it, which is totally legit.

If the question is asking the 'same day acceptance' rate, then it has to be the same day.

But you have to be careful about the same-day acceptance rate definition (if you sent me at 23:59:59 and I accepted it 2 mins later, it won't count as same day), instead, a better metric would be the acceptance rate within 24 hours (after sending) or within one week (after sending).

It's always a good idea to clarify the requirements with the interviewer before diving into your solution, but before you ask, use your common sense, otherwise the interviewer may have some doubts about your product/business sense or lack of an understanding of their products or business.

-Leon

 

A side note here is that interviewers do often find it appropriate to discuss edge cases / etc (ie, perhaps verifying that the data is all within the same timezone, or does it need to be adjusted accordingly first, etc). 

Mike, April 21, 2022, 12:53 p.m.
SQLPad user avatar

Leon (949)

April 21, 2022, 12:13 p.m.