← Meta Interview Insights

Meta·Software Engineer·Onsite - System Design / Architecture·Senior

Senior
May 2026

Summary

Meta SWE interview with a system design question about building a folder search API. Pretty open-ended, not a lot of context to go on from what was shared.

Questions Asked (1)

Q1

Design an API for searching within a folder.

API & IntegrationsSystem DesignTechnical Trade-offs
Author's notes

More open than it sounds.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: what does 'searching within a folder' mean? Is it recursive? What file types? What scale? Then propose a clean RESTful API design with endpoints, parameters, and response schemas. Discuss trade-offs like synchronous vs asynchronous, pagination, and indexing for performance.

Pro tip: Show maturity by discussing how to handle large folders and performance: mention that a naive recursive search can be slow, so consider indexing or background jobs. Also, think about security: ensure the API respects permissions and doesn't expose sensitive files.

1. Clarify Requirements

Ask questions to understand the scope: Is the search recursive? What file types? What's the expected scale (number of files, depth)? What search features (filename, content, metadata)? Who are the users and what are their permissions?

2. Define API Contract

Design the endpoint(s), HTTP methods, request parameters (e.g., query, path, recursive, fileType, page, pageSize), and response format (e.g., list of file paths with metadata). Consider using GET /folders/{folderId}/search?q=... or POST for complex queries.

3. Address Performance and Scalability

Discuss how to handle large folders: use indexing (e.g., inverted index), caching, asynchronous search with job IDs, or streaming results. Mention pagination and rate limiting to prevent abuse.

4. Handle Edge Cases and Security

Cover error handling (e.g., folder not found, permission denied), security (authentication, authorization, path traversal prevention), and consistency (e.g., eventual consistency with indexing).

5. Discuss Trade-offs and Alternatives

Compare synchronous vs asynchronous search, REST vs GraphQL, and simple vs advanced search features. Explain your choices based on the clarified requirements.

Key Points to Mention

  • RESTful design principles: resource-oriented URLs, proper HTTP methods and status codes
  • Pagination and sorting to handle large result sets efficiently
  • Indexing strategies (e.g., inverted index, full-text search) for performance
  • Security considerations: authentication, authorization, and input validation
  • Asynchronous processing for long-running searches with job status endpoints
  • Caching mechanisms to reduce load and improve response times

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.