← Harvey AI Interview Insights

Harvey AI·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Jun 2026

Summary

System design round at Harvey AI for a software engineer role. The whole thing was one big question about building a file storage service from scratch, and they wanted you to go deep on basically everything: APIs, metadata, concurrency, scaling, security. Felt like a 45-minute gauntlet.

Questions Asked (8)

Q1

Design a production-grade file storage service with addFile(path) and list(path) APIs, where each directory is capped at 5 entries and duplicate filenames are auto-renamed with OS-style suffixes. Walk through the full architecture including API layer, metadata service, and content store.

System DesignAPI & IntegrationsTechnical Trade-offs
Author's notes

This is a beast of a question.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints (e.g., scale, consistency, durability), then propose a high-level architecture with separate API, metadata, and content layers. Dive into the tricky parts: enforcing the 5-entry limit with concurrency control and implementing OS-style duplicate renaming. Finally, discuss trade-offs and potential bottlenecks.

Pro tip: Emphasize idempotency and atomicity in your API design—interviewers love hearing about how you handle retries and partial failures. Also, mention that the 5-entry limit is per directory, so you'll need a distributed lock or transactional mechanism to enforce it.

1. Clarify Requirements and Constraints

Ask about expected scale (number of files, directories, users), consistency requirements (strong vs eventual), durability, and latency. Confirm that the 5-entry limit is hard and applies to all directories.

2. High-Level Architecture

Outline the three main components: API layer (handles requests, auth, validation), metadata service (stores directory structure, file metadata, enforces limits), and content store (stores file blobs, e.g., S3 or HDFS). Explain how they interact.

3. API Design and Duplicate Handling

Define addFile(path) and list(path) semantics. For addFile, describe the duplicate renaming algorithm (e.g., file.txt -> file (1).txt) and how to make it atomic. For list, discuss pagination and consistency.

4. Metadata Service and Concurrency

Explain how to store metadata (e.g., relational DB or distributed KV store) and enforce the 5-entry limit. Discuss locking strategies (e.g., per-directory locks, optimistic concurrency) to prevent race conditions.

5. Content Store and Trade-offs

Describe blob storage, deduplication, and consistency between metadata and content. Discuss trade-offs: strong vs eventual consistency, latency vs durability, and how to handle failures (e.g., orphaned blobs).

Key Points to Mention

  • Concurrency control for enforcing the 5-entry limit (e.g., distributed locks, transactions, or serializable isolation).
  • Duplicate renaming algorithm: OS-style suffixes like 'file (1).txt', ensuring uniqueness and atomicity.
  • Metadata storage choice: relational DB for strong consistency vs NoSQL for scalability, and how it affects the design.
  • Content store: using object storage (S3) or distributed file system, with deduplication and garbage collection.
  • API idempotency and error handling: how to handle retries, partial failures, and ensure exactly-once semantics.
  • Scalability and partitioning: how to shard metadata by directory or user to avoid hotspots and support growth.

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

Q2

What metadata schema and storage backend would you choose for this service, and why relational vs NoSQL?

Data ModelingTechnical Trade-offsSystem Design
Author's notes

Went relational pretty fast.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the service's access patterns, consistency needs, and scale before proposing a schema or backend. Then compare relational and NoSQL options against those requirements, and justify your choice with concrete trade-offs. For Harvey AI, emphasize how metadata supports document ingestion, versioning, and retrieval for legal AI workloads.

Pro tip: Show that you understand the operational reality: relational databases are often the right default for metadata because of transactions and query flexibility, but you can layer a NoSQL store or search index for scale or full-text needs. Mention that schema evolution and migrations are a key part of the decision, not an afterthought.

1. Clarify requirements and access patterns

Ask about read/write ratio, query patterns (point lookups vs. complex joins vs. full-text search), consistency requirements, and expected scale. This ensures your choice is grounded in the actual service needs.

2. Propose a metadata schema

Outline core entities (e.g., documents, versions, users, permissions, tags) and their relationships. Mention fields like IDs, timestamps, ownership, and version history, and note whether the schema is fixed or evolving.

3. Compare relational vs NoSQL

Discuss relational strengths (ACID, joins, mature tooling) and NoSQL strengths (horizontal scale, flexible schema, high write throughput). Tie each to the requirements from step 1.

4. Justify your backend choice

Pick one primary store (e.g., PostgreSQL for metadata) and explain why it fits. Optionally mention complementary stores (e.g., Elasticsearch for search, S3 for blobs) and how they integrate.

5. Address trade-offs and evolution

Acknowledge downsides of your choice (e.g., scaling limits, migration complexity) and how you'd mitigate them. Show awareness of future growth and schema changes.

Key Points to Mention

  • ACID transactions and strong consistency for metadata integrity
  • Query flexibility: joins, filtering, and aggregations for complex metadata
  • Horizontal scaling and write throughput considerations
  • Schema flexibility vs. enforcement and migration strategy
  • Indexing and full-text search for document retrieval
  • Operational maturity, tooling, and team familiarity

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

Q3

How do you handle large file uploads, and what changes when files are too big to buffer in memory?

System DesignTechnical Trade-offsAPI & Integrations
Author's notes

Talked about multipart uploads and storing a reference to object storage rather than the bytes in the metadata DB.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by contrasting small vs. large file uploads: for small files, buffering in memory is fine, but for large files, you need streaming and chunking. Then walk through a scalable architecture that handles large files without exhausting memory, covering client-side chunking, server-side streaming, storage, and resumability.

Pro tip: Emphasize that the real challenge isn't just memory—it's reliability and user experience. Mention how you'd handle network failures, resume uploads, and provide progress feedback, which shows you think beyond the happy path.

1. Clarify requirements and constraints

Ask about file size limits, expected concurrency, latency requirements, and whether the upload is user-facing or machine-to-machine. This shows you tailor solutions to context.

2. Explain the naive approach and its limits

Describe how buffering the entire file in memory (e.g., reading into a byte array) works for small files but leads to OOM errors, high GC pressure, and poor scalability for large files.

3. Present a streaming/chunking architecture

Detail client-side chunking (e.g., splitting into 5-10MB parts), server-side streaming to disk or object storage (e.g., S3 multipart upload), and using streams to avoid loading the whole file into memory.

4. Address reliability and resumability

Discuss how to handle failures: retries with exponential backoff, resumable uploads via chunk checksums or upload IDs, and idempotency to avoid duplicate chunks.

5. Cover post-upload processing and trade-offs

Mention asynchronous processing (e.g., virus scan, transcoding) via queues, and trade-offs like increased complexity, latency, and storage costs versus memory efficiency.

Key Points to Mention

  • Streaming APIs (e.g., Node.js streams, Java InputStream) and backpressure to control memory usage.
  • Chunked uploads with multipart/form-data or proprietary protocols (e.g., tus, S3 multipart).
  • Using object storage (S3, GCS) for scalability and durability instead of local disk.
  • Resumable uploads: tracking uploaded chunks, using checksums, and supporting pause/resume.
  • Concurrency control: limiting parallel chunk uploads to avoid overwhelming the server or network.
  • Security considerations: validating file types, scanning for malware, and enforcing size limits.

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

Q4

How would you handle consistency, failure scenarios, and rollback in this system?

System DesignTechnical Trade-offsAlgorithms & Data Structures
Author's notes

I leaned on two-phase commit between the metadata DB and object storage, then immediately second-guessed myself out loud because 2PC across external systems is painful.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's requirements and constraints, then discuss consistency models and trade-offs. Next, outline failure scenarios and how to detect and handle them, and finally explain rollback strategies and their implications.

Pro tip: Tie your answer to Harvey AI's domain (legal AI) by emphasizing data integrity and auditability, and mention how you'd validate rollbacks with canary deployments or feature flags.

1. Clarify requirements and constraints

Ask about the system's consistency needs (strong vs. eventual), SLAs, and data criticality to frame your answer.

2. Choose a consistency model

Discuss trade-offs between strong and eventual consistency, and how to implement them (e.g., quorum reads/writes, CRDTs).

3. Design for failure scenarios

Identify potential failures (network partitions, node crashes) and propose detection and mitigation strategies (timeouts, retries, circuit breakers).

4. Plan rollback strategies

Explain how to safely roll back changes (e.g., versioned deployments, database migrations with down scripts) and ensure idempotency.

5. Validate and monitor

Describe how you'd test failure and rollback scenarios (chaos engineering) and monitor system health to ensure correctness.

Key Points to Mention

  • CAP theorem and PACELC trade-offs
  • Idempotency and exactly-once processing
  • Database transactions and isolation levels
  • Circuit breakers and retry with exponential backoff
  • Blue-green deployments and feature flags
  • Audit logs and data versioning for legal compliance

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

Q5

How would you scale this service? Talk through partitioning, sharding, and caching strategies.

System DesignTechnical Trade-offs
Author's notes

Partitioned on user ID for the metadata store, cached directory listings with a short TTL.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the service's current architecture, scale, and bottlenecks, then propose a layered scaling strategy that addresses data partitioning, sharding, and caching in order of impact. Emphasize trade-offs and iterative improvements rather than a one-size-fits-all solution.

Pro tip: Always tie your scaling choices back to the specific access patterns and SLAs of the service—interviewers at Harvey AI value pragmatic, data-driven decisions over buzzwords. Mention monitoring and the ability to roll back changes as part of your strategy.

1. Clarify requirements and current bottlenecks

Ask about expected scale, read/write ratio, latency SLAs, data size, and existing pain points to ground your answer in reality.

2. Partition data logically

Discuss how to split data by natural boundaries (e.g., tenant, user, region) to enable independent scaling and reduce contention.

3. Shard for horizontal scale

Explain sharding strategies (range, hash, consistent hashing), shard key selection, and how to handle rebalancing and hotspots.

4. Layer caching strategically

Cover client-side, CDN, application-level, and database caching, including cache invalidation, TTLs, and consistency trade-offs.

5. Iterate and monitor

Propose starting with the simplest effective changes, measuring impact, and evolving the architecture as load grows.

Key Points to Mention

  • Shard key selection and avoiding hotspots (e.g., using composite keys or hashing)
  • Consistent hashing for dynamic scaling and minimal data movement
  • Cache invalidation strategies (write-through, write-behind, TTL, event-driven)
  • Read replicas and CQRS for read-heavy workloads
  • Trade-offs between consistency, availability, and partition tolerance (CAP theorem)
  • Monitoring, alerting, and gradual rollout to mitigate risks

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

Q6

What observability, rate limiting, and quota enforcement would you build into this service?

System DesignProduct Analytics & Metrics
Author's notes

Standard stuff: request latency, error rates, queue depth for async jobs.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the service's purpose and critical user journeys, then propose a layered observability strategy covering metrics, logs, and traces with specific tools. For rate limiting and quotas, discuss algorithms, enforcement points, and how to handle multi-tenancy and fairness, ensuring alignment with business goals.

Pro tip: Tie rate limiting and quotas to business metrics like cost per query or user satisfaction, and mention how you'd use observability data to continuously tune limits. Also, highlight the importance of graceful degradation and clear communication to users when limits are hit.

1. Clarify service and requirements

Ask questions to understand the service's functionality, expected traffic, user base (e.g., multi-tenant), and business goals. Identify critical paths and potential abuse scenarios.

2. Design observability

Propose metrics (e.g., request rate, latency, error rates, resource usage), logging (structured logs with context), and tracing (distributed tracing for request flows). Mention tools like Prometheus, Grafana, ELK, Jaeger, and how to use them for alerting and dashboards.

3. Implement rate limiting

Choose algorithms (e.g., token bucket, sliding window) based on requirements. Decide enforcement points (API gateway, service mesh, application code) and discuss distributed rate limiting using Redis or similar. Consider per-user, per-IP, or per-API-key limits.

4. Enforce quotas

Define quotas (e.g., daily/monthly usage limits) and how to track them (e.g., counters in a database or Redis). Discuss enforcement, reset periods, and handling of overages (e.g., throttling, billing). Consider tiered quotas for different user plans.

5. Monitor and iterate

Explain how observability data informs tuning of rate limits and quotas. Set up alerts for anomalies, and plan for capacity planning and cost management. Emphasize feedback loops and continuous improvement.

Key Points to Mention

  • Use of metrics, logs, and traces for full observability, with specific tools like Prometheus, Grafana, and OpenTelemetry.
  • Rate limiting algorithms (token bucket, leaky bucket, sliding window) and their trade-offs.
  • Distributed rate limiting implementation using Redis or centralized data stores.
  • Quota enforcement strategies, including tracking usage, reset periods, and tiered limits.
  • Multi-tenancy considerations: per-tenant limits, fairness, and isolation.
  • Graceful degradation and user communication when limits are exceeded (e.g., 429 responses with Retry-After headers).

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

Q7

How would you approach security for this service, including authentication, authorization, path traversal protection, and encryption?

System DesignTechnical Trade-offs
Author's notes

Path traversal was the interesting bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer around the CIA triad (Confidentiality, Integrity, Availability) and defense-in-depth, covering authentication, authorization, path traversal, and encryption in a layered manner. Emphasize practical trade-offs between security, performance, and usability, and relate choices to the service's context (e.g., AI document processing at Harvey AI).

Pro tip: Demonstrate awareness of OWASP Top 10 and mention specific mitigations like using a Web Application Firewall (WAF) and regular security audits. Also, highlight the importance of logging and monitoring for security incidents.

1. Clarify Requirements and Threat Model

Ask clarifying questions about the service's data sensitivity, user roles, and compliance needs. Identify potential threats (e.g., unauthorized access, data leaks, path traversal) and prioritize based on risk.

2. Design Authentication and Authorization

Propose a robust authentication mechanism (e.g., OAuth 2.0, JWT) and fine-grained authorization (e.g., RBAC, ABAC). Discuss session management, token expiration, and secure storage of credentials.

3. Implement Path Traversal Protection

Explain input validation and sanitization techniques, such as whitelisting allowed characters, using safe APIs for file operations, and normalizing paths before access. Mention avoiding direct user input in file paths.

4. Apply Encryption and Data Protection

Cover encryption in transit (TLS 1.3) and at rest (AES-256). Discuss key management (e.g., KMS), hashing passwords with salt (bcrypt, Argon2), and encrypting sensitive fields.

5. Monitor, Log, and Iterate

Emphasize continuous monitoring, audit logging, and regular security testing (pen tests, SAST/DAST). Mention incident response and updating defenses based on new threats.

Key Points to Mention

  • Use of OAuth 2.0/OpenID Connect for authentication and JWT for stateless authorization.
  • Role-Based Access Control (RBAC) or Attribute-Based Access Control (ABAC) for fine-grained permissions.
  • Path traversal prevention via input validation, canonicalization, and chroot jails or sandboxing.
  • Encryption in transit with TLS and at rest with AES-256, plus secure key management.
  • Password hashing with bcrypt/Argon2 and salting.
  • Regular security audits, penetration testing, and adherence to OWASP guidelines.

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

Q8

Define the key SLIs and SLOs you'd set for this service.

Product Analytics & MetricsSystem Design
Author's notes

Latency SLO for metadata reads, availability target, and an upload success rate SLI.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the service's purpose and user expectations, then define SLIs that measure user-perceived performance and reliability. Set SLOs as targets for those SLIs, balancing ambition with feasibility, and explain how they drive error budgets and operational decisions.

Pro tip: Tie SLOs to business impact and user experience, not just technical metrics; for example, an AI product like Harvey should prioritize response accuracy and latency for critical queries over raw uptime.

1. Clarify Service Scope and User Expectations

Ask clarifying questions about the service's functionality, critical user journeys, and dependencies to understand what matters most to users.

2. Identify Key User-Perceived SLIs

Select a small set of SLIs that directly reflect user experience, such as latency, availability, throughput, and correctness, ensuring they are measurable and actionable.

3. Set Realistic SLO Targets

Define SLOs as target percentages or thresholds for each SLI over a window (e.g., 99.9% availability over 30 days), based on user needs and business goals.

4. Define Error Budgets and Consequences

Explain how SLOs translate into error budgets that guide release velocity and reliability investments, and what happens when budgets are exhausted.

5. Iterate and Align with Stakeholders

Emphasize that SLIs/SLOs are not static; they should be reviewed regularly with product and engineering teams to adapt to changing user needs.

Key Points to Mention

  • SLIs should measure user-perceived performance (e.g., latency of critical API calls, success rate of document analysis).
  • SLOs must be specific, measurable, and time-bound (e.g., 95% of queries under 2 seconds over a 7-day window).
  • Error budgets balance reliability with feature velocity and inform go/no-go decisions.
  • For AI services, include quality metrics like accuracy or relevance, not just uptime.
  • Avoid overcomplicating: start with a few key SLIs and refine over time.
  • Consider dependencies (e.g., third-party LLM APIs) and set SLOs accordingly.

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