You're designing a RESTful API for a social media platform. How would you handle pagination for retrieving a large number of user posts efficiently?
- Combine offset-based pagination with filtering options for more granular control over result sets.
- Implement cursor-based pagination using a timestamp or unique identifier.
- Use page-based pagination with a limit and offset parameters.
- Utilize token-based pagination by returning a token for the next page of results.
Cursor-based pagination using a timestamp or unique identifier is efficient for handling large datasets as it ensures stable pagination results even if items are added or removed. It also reduces the chances of duplicate or missing data during pagination.
Loading...
Related Quiz
- What is the difference between a singly linked list and a doubly linked list?
- Explain the role of the "C" in ACID properties and its significance in database transactions.
- Which SDLC model is best suited for large projects with uncertain or evolving requirements?
- Memory ___________ is a technique used to rearrange memory contents to place all free memory together.
- In a scenario where a website's DNS records are incorrect, causing it to be unreachable, how would you troubleshoot and resolve this issue?