How many tweets should we fetch at a time?

Q: How many tweets should we fetch at a time?

  1. For the API definitions, you'd never take timestamp from the client for a normal CRUD operation, as client timestamps cannot be trusted.

Also, considering the user is logged in (eg. a server side valid session exists for the user), the API call would not contain the logged in user id. The authentication/authorization on server side would happen via session cookie/JWT etc.

I think the api could be called by any user for any other user (remember that the profile is public). So, the api need to have a userId parameter sent by the client. Also, if there was a feature of private profile/tweets then the sessionId could be fetched from the cookies to fetch only permissible tweets for the logged in user.

Click here to start solving coding interview questions