← HarveyAI Interview Insights

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

SeniorPrefer not to say
Apr 2026

Summary

System design round at HarveyAI focused almost entirely on building a Google Drive-style service, but the real meat was the access control layer. Dense interview, lots of follow-ups, left feeling like I covered maybe 70% of what they wanted.

Questions Asked (6)

Q1

Design the file and folder data model for a cloud storage service, including how parent-child relationships and permission inheritance work.

System DesignData ModelingTechnical Trade-offs
Author's notes

I went straight to a tree structure with a parent_id foreign key and spent too long on the basic hierarchy before they nudged me toward permissions.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then propose a normalized schema with a nodes table for files and folders, using a parent_id foreign key to represent hierarchy. Explain how permission inheritance works by traversing ancestors or using materialized paths, and discuss trade-offs between simplicity and performance for operations like listing, moving, and permission checks.

Pro tip: Mention that permission inheritance can be optimized with a closure table or path enumeration to avoid recursive queries, and highlight the need for efficient permission checks at scale, possibly with caching or denormalization.

1. Clarify Requirements and Scale

Ask about expected scale (number of users, files, depth of hierarchy), read/write patterns, and consistency requirements. This informs schema and indexing choices.

2. Design Core Schema

Propose a nodes table with id, name, type (file/folder), parent_id, owner_id, and timestamps. Use a self-referential foreign key for parent-child relationships.

3. Model Permissions and Inheritance

Introduce a permissions table linking users/groups to nodes with roles (e.g., read, write, admin). Explain that permissions inherit down the tree unless overridden.

4. Optimize for Hierarchy Operations

Discuss techniques like materialized paths, closure tables, or nested sets to efficiently query descendants, ancestors, and inherited permissions.

5. Address Trade-offs and Scalability

Compare normalization vs. denormalization, recursive CTEs vs. precomputed paths, and caching strategies for permission checks. Mention sharding or partitioning if needed.

Key Points to Mention

  • Self-referential parent_id for hierarchy with indexing on parent_id
  • Permission inheritance via ancestor traversal or materialized path
  • Use of closure table or path enumeration for efficient descendant queries
  • Caching inherited permissions to avoid recursive checks on every access
  • Handling moves/renames efficiently (e.g., updating paths or closure table)
  • Trade-offs between consistency and performance in permission propagation

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

Q2

Walk through the sharing model: different permission levels like owner, editor, commenter, and viewer, and how sharing works across users, groups, links, and domains.

System DesignData ModelingAPI & Integrations
Author's notes

This part felt more comfortable.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the core entities (users, groups, links, domains) and the permission hierarchy (owner > editor > commenter > viewer). Then explain how permissions are resolved when multiple sources apply, emphasizing the principle of least privilege and explicit overrides. Finally, discuss the data model and API design that supports efficient permission checks and sharing operations.

Pro tip: Mention that permission checks should be centralized in a single authorization service to avoid inconsistencies, and that you'd use bitwise flags or a similar compact representation for permission levels to enable fast checks and easy extensibility.

1. Define Permission Levels

Clearly outline the four permission levels (owner, editor, commenter, viewer) and what actions each allows. Explain that owner has full control including sharing and deletion, editor can modify content, commenter can add comments but not edit, and viewer can only read.

2. Identify Sharing Targets

Describe the different entities that can be granted permissions: individual users, groups, public links, and entire domains. Explain how each target type is represented in the data model and how permissions are assigned to them.

3. Design Permission Resolution

Explain how to resolve permissions when a user is affected by multiple grants (e.g., direct user grant, group membership, domain-wide grant). Describe the precedence rules, such as explicit user grant overriding group grant, and how to handle conflicts (e.g., most permissive wins or most restrictive wins).

4. Model Data and APIs

Outline the database schema for storing permissions (e.g., a permissions table with resource_id, grantee_type, grantee_id, permission_level) and the API endpoints for sharing (e.g., POST /resources/{id}/share with grantee and permission). Mention the need for efficient queries to check permissions.

5. Handle Edge Cases and Security

Discuss edge cases like link expiration, domain verification, permission inheritance for nested resources, and revocation. Emphasize security considerations such as avoiding privilege escalation and ensuring audit logs.

Key Points to Mention

  • Permission hierarchy and inheritance (e.g., owner implies all lower permissions)
  • Group membership and nested groups: how permissions propagate and potential performance implications
  • Public link sharing: token-based access, optional expiration, and password protection
  • Domain-wide sharing: verification of domain ownership and automatic grants to domain users
  • Permission resolution algorithm: combining multiple grants, precedence rules, and caching strategies
  • API design for sharing: endpoints for granting, revoking, and listing permissions, with proper authorization checks

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

Q3

How do you handle permission propagation when a parent folder's ACL changes, especially when a child has an explicit override?

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

Probably the hardest part of the whole interview.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the ACL model (e.g., inheritance, explicit deny/allow, precedence rules) and the desired semantics for propagation. Then describe a recursive or iterative algorithm that updates inherited permissions while preserving explicit overrides, and discuss trade-offs like performance, consistency, and conflict resolution.

Pro tip: Mention that explicit overrides should take precedence, but also consider how to handle conflicts when a parent's ACL change would otherwise remove access—sometimes you need to re-evaluate effective permissions or notify stakeholders.

1. Clarify ACL Model and Requirements

Ask about the ACL system: inheritance rules, explicit vs inherited permissions, deny/allow precedence, and whether changes should be atomic or eventual. Confirm the expected behavior for child overrides.

2. Design Propagation Algorithm

Propose a traversal (DFS/BFS) that updates inherited permissions on children, skipping or merging with explicit overrides. Consider whether to recompute effective permissions or store deltas.

3. Handle Conflicts and Overrides

Explain how to resolve conflicts: explicit overrides win, but if a parent change would revoke access, decide whether to keep the override, flag it, or require manual review. Discuss deny vs allow precedence.

4. Address Performance and Scalability

Discuss optimizations: lazy propagation, caching effective permissions, batching updates, or using a permission graph. Mention trade-offs between consistency and latency.

5. Consider Edge Cases and Consistency

Cover edge cases: deep hierarchies, concurrent modifications, circular references, and rollback. Explain how to ensure atomicity or eventual consistency.

Key Points to Mention

  • Inheritance models: explicit vs inherited permissions, and how they combine (e.g., union, intersection, deny-overrides).
  • Precedence rules: explicit overrides typically take precedence, but deny may trump allow depending on the system.
  • Algorithm choices: recursive traversal vs iterative with stack/queue, and how to avoid infinite loops.
  • Performance optimizations: lazy evaluation, caching, incremental updates, and batching.
  • Consistency guarantees: atomic transactions vs eventual consistency, and handling concurrent ACL changes.
  • Trade-offs: simplicity vs efficiency, strict inheritance vs flexible overrides, and user experience implications.

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

Q4

How would you evaluate access control checks at low latency and scale? What does a denormalized permission cache or a relationship-tuple-based system look like here?

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

This is where I leaned hardest on what I knew.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the access control model (e.g., RBAC, ABAC, ReBAC) and the latency/scale requirements. Then compare denormalized permission caches and relationship-tuple-based systems (like Zanzibar) in terms of data structures, consistency, and performance. Finally, discuss trade-offs and propose a hybrid approach if appropriate.

Pro tip: Emphasize that access control is a read-heavy, latency-sensitive problem, so caching and precomputation are key. Mention that relationship-tuple systems like Zanzibar use graph traversal with memoization to achieve low latency at scale.

1. Clarify requirements and constraints

Ask about the access control model, expected QPS, latency SLA, consistency requirements, and scale of users/resources.

2. Describe denormalized permission cache

Explain how permissions can be precomputed and stored in a fast key-value store (e.g., Redis) with a key like user:resource, and how invalidation works on policy changes.

3. Describe relationship-tuple-based system

Explain the Zanzibar model: tuples like (object, relation, user), stored in a graph database, with recursive expansion and memoization to answer queries.

4. Compare trade-offs

Discuss latency, consistency, scalability, and complexity: caches are fast but can be stale; tuple systems are flexible but may have higher latency due to graph traversal.

5. Propose a hybrid or optimized solution

Suggest combining both: use tuple system as source of truth and cache computed permissions with short TTL or event-driven invalidation for low latency.

Key Points to Mention

  • Zanzibar-style relationship tuples and graph traversal
  • Denormalized permission caches (e.g., Redis) with key-value lookups
  • Cache invalidation strategies (TTL, event-driven, versioning)
  • Consistency vs. latency trade-offs (eventual consistency, read-your-writes)
  • Scalability techniques: sharding, replication, memoization
  • Hybrid approaches: cache-aside with tuple store as source of truth

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

Q5

How would you design the audit logging system for file access and permission changes?

System DesignData Modeling
Author's notes

Shorter discussion on this one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: what events need to be logged, who needs access, retention policies, and compliance needs. Then propose a high-level architecture that captures events, stores them immutably, and provides efficient querying and alerting. Finally, dive into data modeling, scalability, and security considerations.

Pro tip: Emphasize that audit logs must be tamper-evident and immutable; suggest using append-only storage with cryptographic hashing or a ledger database. Also, discuss how to handle high write throughput without impacting primary application performance, e.g., via asynchronous logging.

1. Clarify Requirements

Ask about the scope: which events (file access, permission changes), volume, retention period, compliance standards (e.g., SOC2, GDPR), and who will consume the logs (admins, auditors, automated systems).

2. High-Level Architecture

Propose a pipeline: event producers (file service, auth service) -> message queue (e.g., Kafka) -> log processor -> storage (e.g., append-only DB, data lake) -> query/alerting interface. Ensure decoupling for scalability and fault tolerance.

3. Data Model

Define the schema for audit events: timestamp, user ID, action type, resource ID, old/new permissions, IP, user agent, status, etc. Consider indexing for efficient queries (e.g., by user, resource, time).

4. Storage & Retention

Choose storage that supports immutability (e.g., WORM storage, blockchain-like hash chain) and scalability. Implement retention policies (e.g., hot storage for recent, cold for archival) and ensure compliance with legal holds.

5. Security & Access Control

Ensure logs are encrypted at rest and in transit, and access is restricted via RBAC. Implement tamper detection (e.g., checksums, digital signatures) and audit the auditors.

Key Points to Mention

  • Immutability and tamper-evidence: use append-only storage, cryptographic hashing, or write-once-read-many (WORM) storage.
  • Scalability: handle high write volume with asynchronous logging, partitioning, and horizontal scaling.
  • Data modeling: include all relevant fields (who, what, when, where, old/new values) and design indexes for common queries.
  • Retention and compliance: define retention periods, support legal holds, and ensure GDPR/SOC2 compliance.
  • Query and alerting: provide APIs or dashboards for searching logs and set up real-time alerts for suspicious activities.
  • Performance impact: minimize overhead on primary systems by using non-blocking logging and separate storage.

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

Q6

Briefly cover how you'd handle file storage, client sync, and conflict resolution.

System DesignTechnical Trade-offs
Author's notes

They explicitly said 'briefly' and I still rambled for four minutes.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (file types, size, sync frequency, offline support) and then propose a high-level architecture that separates storage (e.g., object storage with metadata DB) from sync (e.g., delta sync with versioning) and conflict resolution (e.g., last-write-wins with vector clocks or CRDTs). Emphasize trade-offs between consistency, latency, and complexity, and tie choices back to HarveyAI's domain (legal AI) where data integrity and auditability are critical.

Pro tip: Mention that conflict resolution should be domain-specific: for legal documents, you might prefer manual merge or version branching over automatic LWW to avoid data loss. Also, highlight the importance of idempotent operations and client-side retries for reliability.

1. Clarify requirements and constraints

Ask about file types, sizes, expected sync frequency, offline support, and consistency needs. This shows you don't jump to solutions without understanding the problem.

2. Design storage layer

Propose using object storage (e.g., S3) for blobs and a metadata database (e.g., PostgreSQL) for file info, versioning, and permissions. Discuss encryption, durability, and access control.

3. Design client sync mechanism

Outline a sync protocol: clients track local changes, send deltas to server, and receive updates via push (WebSocket) or pull (polling). Use version vectors or timestamps to detect changes.

4. Handle conflict resolution

Explain strategies: last-write-wins (simple but lossy), operational transforms (for text), or CRDTs (for automatic merge). For legal docs, consider manual resolution or version branching.

5. Discuss trade-offs and scalability

Compare consistency vs. availability, latency vs. bandwidth, and complexity vs. correctness. Mention how the design scales with number of users and file sizes.

Key Points to Mention

  • Object storage (e.g., S3) for blobs, metadata DB for file info and versioning
  • Delta sync to minimize bandwidth, with client-side change tracking
  • Conflict detection using version vectors or timestamps
  • Conflict resolution strategies: LWW, CRDTs, OT, or manual merge
  • Idempotent operations and retry logic for reliability
  • Security: encryption at rest/in transit, access control, audit logs

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