← Harvey Interview Insights

Harvey·Backend Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Apr 2026

Summary

System design round at Harvey for a backend role. The whole thing centered on building a secure document vault, which sounds straightforward until you get into the weeds on auth, chunked uploads, and integrity verification. Pretty thorough for a single question.

Questions Asked (5)

Q1

Design a secure cloud-based document vault where authenticated users can upload, store, and retrieve sensitive files with strict authorization controls.

System DesignAPI & IntegrationsData Modeling
Author's notes

This was the anchor question for the whole session.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying functional and non-functional requirements, especially around security, compliance, and scale. Then propose a high-level architecture that separates authentication, authorization, storage, and metadata services, and dive into data modeling, API design, and security controls. Finally, discuss trade-offs and potential improvements.

Pro tip: Emphasize defense-in-depth: combine encryption at rest and in transit, fine-grained authorization (e.g., ABAC), and audit logging. Also, mention how you would handle key management and rotation, as this is often overlooked.

1. Clarify Requirements

Ask about expected scale, file types/sizes, compliance needs (e.g., HIPAA, GDPR), and authorization granularity. Confirm non-functional requirements like latency, durability, and availability.

2. High-Level Architecture

Outline components: API gateway, authentication service (e.g., OAuth2/OIDC), authorization service, metadata database, blob storage (e.g., S3 with SSE), and key management service. Explain how they interact.

3. Data Model & API Design

Define entities: User, Document, Permission, AuditLog. Design RESTful APIs for upload, download, list, and share, including authorization checks. Consider using signed URLs for direct upload/download to reduce server load.

4. Security Controls

Detail encryption at rest (per-file keys, envelope encryption) and in transit (TLS). Implement fine-grained authorization (RBAC/ABAC), audit logging, and secure key management (e.g., AWS KMS). Discuss threat models and mitigations.

5. Trade-offs & Scalability

Discuss trade-offs: consistency vs. availability, cost vs. performance. Explain how to scale (sharding, caching, CDN) and handle failures (retries, idempotency). Mention monitoring and alerting.

Key Points to Mention

  • Authentication vs. authorization: use OAuth2/OIDC for authn, and a policy engine (e.g., OPA) for authz.
  • Encryption: TLS for data in transit, AES-256 for data at rest, envelope encryption with KMS for key management.
  • Access control models: RBAC for roles, ABAC for fine-grained policies based on attributes.
  • Audit logging: immutable logs for all access and modifications, with alerting on suspicious activity.
  • Storage optimization: use object storage with lifecycle policies, deduplication, and versioning.
  • API security: rate limiting, input validation, and signed URLs to prevent unauthorized access.

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

Q2

How would you scale this system as the number of files and user traffic grows significantly?

System DesignTechnical Trade-offs
Author's notes

Talked through horizontal scaling for the API tier, sharding metadata by user or document ID, and offloading storage to object storage.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the current architecture and scale assumptions (file sizes, read/write ratio, user concurrency). Then propose a layered scaling strategy: separate metadata from file storage, introduce horizontal scaling for each component, and use caching and CDNs for hot data. Finally, discuss trade-offs and how you'd measure success.

Pro tip: Show you understand that scaling isn't just about adding servers—it's about identifying bottlenecks and making deliberate trade-offs. Mention that you'd start with profiling and metrics to find the actual constraints before optimizing.

1. Clarify requirements and current architecture

Ask about the current system design, expected growth (files, users, traffic), and performance goals. This ensures your answer is tailored and not generic.

2. Identify bottlenecks and scaling dimensions

Break down the system into components (storage, metadata DB, API servers, network) and discuss which will hit limits first as files and traffic grow.

3. Propose scaling strategies per component

For each bottleneck, suggest horizontal scaling (sharding, replication), caching, CDNs, and asynchronous processing. Explain how they address the specific growth.

4. Discuss trade-offs and implementation considerations

Compare options like SQL vs NoSQL, consistency vs availability, and cost vs performance. Mention migration paths and potential risks.

5. Define metrics and iterative approach

Explain how you'd measure success (latency, throughput, cost) and iterate. Emphasize starting with monitoring and gradual rollout.

Key Points to Mention

  • Separation of metadata and file storage (e.g., using object storage like S3 for files and a database for metadata)
  • Horizontal scaling of API servers with load balancers and stateless design
  • Database scaling techniques: sharding, replication, read replicas, and choosing the right database (SQL vs NoSQL)
  • Caching strategies: CDN for static files, Redis/Memcached for hot metadata
  • Asynchronous processing and queues for background tasks like file processing or indexing
  • Trade-offs: consistency vs availability, cost implications, and operational complexity

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

Q3

How would you design the access control and permission model for this system?

System DesignTechnical Trade-offsAPI & Integrations
Author's notes

This is where I felt most pressure.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's requirements and constraints, then propose a role-based access control (RBAC) model with fine-grained permissions, and discuss trade-offs between simplicity and flexibility. Emphasize how the design supports scalability, security, and maintainability.

Pro tip: Demonstrate awareness of real-world challenges like permission inheritance, audit logging, and the principle of least privilege, and suggest starting with a simple model that can evolve.

1. Clarify Requirements

Ask questions to understand the system's users, resources, and access patterns, including any compliance or multi-tenancy needs.

2. Choose an Access Control Model

Propose RBAC as a baseline, and mention alternatives like ABAC or ReBAC if fine-grained or relationship-based access is needed.

3. Define Roles and Permissions

Outline how roles map to permissions, how permissions are assigned to resources, and how inheritance and hierarchies work.

4. Address Enforcement and Integration

Explain where enforcement happens (e.g., API gateway, service layer) and how it integrates with authentication (e.g., JWT, OAuth).

5. Discuss Trade-offs and Evolution

Compare simplicity vs. flexibility, performance implications, and how the model can evolve with changing requirements.

Key Points to Mention

  • Role-Based Access Control (RBAC) and its variants
  • Principle of Least Privilege
  • Permission inheritance and role hierarchies
  • Audit logging and monitoring for security
  • Integration with authentication protocols (OAuth, JWT)
  • Scalability and performance considerations

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

Q4

How would you handle uploading very large files in this system?

System DesignTechnical Trade-offs
Author's notes

Chunked uploads, presigned URLs, reassembly on completion.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: file size, expected concurrency, and use case (e.g., document upload for legal analysis). Then propose a chunked, resumable upload architecture using pre-signed URLs to object storage, with a backend service to coordinate and validate chunks. Discuss trade-offs between simplicity and scalability, and how to handle failures and cleanup.

Pro tip: Emphasize idempotency and resumability: clients should be able to retry chunks without duplicating data, and the system should track upload state to allow resuming after network failures. This shows you've thought about real-world reliability, not just the happy path.

1. Clarify requirements and constraints

Ask about file sizes, upload frequency, latency requirements, and whether files need processing after upload. This ensures your design fits the actual use case.

2. Choose an upload strategy

Decide between direct-to-storage (e.g., S3 pre-signed URLs) vs. proxying through your servers. Direct-to-storage is usually better for large files to avoid overloading your backend.

3. Design chunking and resumability

Break files into chunks, upload them in parallel or sequentially, and track progress. Use a unique upload ID and store chunk metadata to enable resuming after failures.

4. Handle validation and finalization

After all chunks are uploaded, validate integrity (e.g., checksums), assemble the file if needed, and trigger any post-processing (e.g., virus scan, indexing).

5. Address failure modes and cleanup

Discuss retries, timeouts, orphaned chunk cleanup, and how to handle partial uploads. Mention monitoring and alerting for failed uploads.

Key Points to Mention

  • Pre-signed URLs for direct client-to-storage uploads, reducing backend load
  • Chunked uploads with resumability and idempotency (e.g., using S3 Multipart Upload)
  • Concurrency control and rate limiting to avoid overwhelming storage or backend
  • Integrity checks (checksums, ETags) and validation before finalizing
  • Cleanup of incomplete uploads and lifecycle policies for orphaned chunks
  • Trade-offs: complexity vs. performance, cost implications of storage and data transfer

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

Q5

When files are uploaded to object storage in chunks using presigned URLs, how do you verify that each chunk actually belongs to the intended file and was uploaded by the authorized user, rather than being arbitrary or malicious data?

System DesignTechnical Trade-offsAPI & Integrations
Author's notes

Genuinely the hardest part of the interview.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the threat model: the main risks are unauthorized uploads, chunk tampering, and cross-file chunk injection. Then explain how to bind each presigned URL to a specific file ID, chunk index, and user session, and how to verify integrity and ownership at finalization using checksums and metadata.

Pro tip: Mention that presigned URLs should be short-lived and scoped to a single chunk with a unique upload ID, and that you should validate the final assembled file's checksum against a client-provided manifest to detect any tampering.

1. Define the threat model

Identify potential attacks: unauthorized users uploading chunks, chunks being swapped between files, and malicious data injection. This sets the stage for the security controls.

2. Bind presigned URLs to context

Generate presigned URLs that include the file ID, chunk index, and user ID in the signature or as enforced metadata, so each URL is only valid for a specific chunk of a specific file by a specific user.

3. Enforce per-chunk validation

Upon upload, validate that the chunk's metadata (e.g., checksum, size) matches expectations, and store chunks in a temporary location keyed by file ID and chunk index.

4. Verify integrity at finalization

When all chunks are uploaded, assemble the file and compute its checksum, comparing it to a client-provided manifest checksum to ensure no chunk was tampered with or swapped.

5. Audit and cleanup

Log all upload activities for auditing, and implement expiration and cleanup for incomplete uploads to prevent resource leaks and abuse.

Key Points to Mention

  • Use of presigned URLs with short expiration and scoped permissions (e.g., AWS S3 presigned URLs with conditions).
  • Including a unique upload ID and chunk index in the URL path or query parameters, validated server-side.
  • Client-side checksum generation (e.g., SHA-256) and server-side verification during assembly.
  • Storing chunk metadata (user ID, file ID, chunk index) in a database to track upload progress and ownership.
  • Implementing idempotency and retry logic to handle network failures without compromising security.
  • Using server-side encryption and access controls to protect data at rest and in transit.

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