← Verkada Interview Insights

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

SeniorPrefer not to say
May 2026

Summary

System design round at Verkada focused entirely on building an access-control service for cameras, users, and nested groups. Pretty deep dive, lots of follow-ups on things I thought I'd covered.

Questions Asked (7)

Q1

Design an access-control service that manages users, cameras, and nested groups, and can answer queries like 'does user U have access to camera C?' and 'which users have access to all cameras?'

System DesignData ModelingTechnical Trade-offs
Author's notes

This is the whole interview basically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then model the core entities (users, cameras, groups) and their relationships, focusing on how nested groups affect access. Propose a data model and access-check algorithm, discuss trade-offs (e.g., precomputed vs. on-the-fly), and address the reverse query (users with access to all cameras) with an efficient approach.

Pro tip: Emphasize that access control is a graph problem: nested groups form a DAG, and you need to handle cycles and inheritance carefully. Also, mention that the reverse query is essentially a set intersection problem, which can be optimized with precomputation or indexing.

1. Clarify requirements and scale

Ask about expected number of users, cameras, groups, query volume, and latency requirements. Clarify whether access is granted via direct assignment, group membership, or both, and whether groups can be nested arbitrarily.

2. Design data model

Define entities: User, Camera, Group, and relationships: user-group membership, group-group nesting (DAG), and access grants (user/group to camera). Consider using adjacency lists or closure tables for efficient traversal.

3. Access check algorithm

For 'does user U have access to camera C?', traverse the group hierarchy from U's groups (including nested) and check if any group has access to C. Discuss caching or precomputation for performance.

4. Reverse query algorithm

For 'which users have access to all cameras?', compute the intersection of user sets that have access to each camera. Discuss efficient set intersection using precomputed indexes or bitsets.

5. Discuss trade-offs and scalability

Compare on-the-fly traversal vs. precomputed access lists (materialized views). Address consistency, update propagation, and handling large-scale graphs (e.g., sharding, caching).

Key Points to Mention

  • Graph traversal for nested groups (DFS/BFS) and cycle detection
  • Data modeling: adjacency list vs. closure table for group hierarchy
  • Precomputation vs. on-the-fly access checks and their trade-offs
  • Efficient set intersection for reverse queries (e.g., bitsets, inverted indexes)
  • Caching strategies and invalidation on permission changes
  • Scalability considerations: sharding, read replicas, and handling hot spots

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

Q2

How would you handle cycle prevention in group hierarchies?

Algorithms & Data StructuresSystem Design
Author's notes

I said check for cycles on write using a DFS before committing the edge.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: whether the hierarchy is a tree or DAG, and whether cycles are prevented at write time or detected later. Then propose a concrete algorithm (e.g., DFS with visited states or union-find) and discuss trade-offs like performance, concurrency, and data integrity.

Pro tip: Mention that cycle prevention should be enforced at the database level (e.g., using a recursive CTE or a closure table) to avoid race conditions, and that application-level checks alone are insufficient under concurrency.

1. Clarify the data model and requirements

Ask whether the hierarchy is a tree (single parent) or a DAG (multiple parents), and whether cycles must be prevented on every write or can be detected asynchronously. Also clarify expected scale and concurrency.

2. Choose a cycle detection algorithm

For a tree, a simple parent-pointer walk with a visited set works. For a DAG, use DFS with three-color marking (white/gray/black) or union-find for incremental edge additions. Explain the time and space complexity.

3. Address concurrency and atomicity

Propose enforcing the check within a transaction or using database constraints (e.g., a recursive CTE in a CHECK or a trigger) to prevent race conditions. Discuss optimistic vs. pessimistic locking.

4. Discuss trade-offs and alternatives

Compare performance of different approaches (e.g., DFS per write vs. maintaining a closure table) and mention when to use each. Consider read-heavy vs. write-heavy workloads.

5. Summarize and mention edge cases

Conclude with a recommended solution and note edge cases like self-references, deep hierarchies, and batch updates. Mention monitoring and repair strategies for existing cycles.

Key Points to Mention

  • DFS with visited states (white/gray/black) for cycle detection in a directed graph
  • Union-find (disjoint set) for incremental edge additions and cycle prevention
  • Database-level enforcement using recursive CTEs or triggers to avoid race conditions
  • Closure table or materialized path for efficient ancestor queries and cycle checks
  • Transaction isolation levels and locking strategies for concurrent writes
  • Handling self-references and batch updates, and strategies for repairing existing cycles

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

Q3

Walk through your approach to precomputing transitive group memberships versus doing on-demand graph traversal. What are the tradeoffs?

Technical Trade-offsSystem Design
Author's notes

Precomputing felt obviously better for read-heavy access checks but then they asked about incremental updates when a group changes.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the access patterns and scale (read/write ratio, graph size, query latency requirements) before comparing precomputation vs on-demand traversal. Then walk through the tradeoffs in terms of latency, storage, consistency, and operational complexity, and propose a hybrid or adaptive strategy based on the specific use case.

Pro tip: Mention that the right answer often depends on the read/write ratio and the acceptable staleness of results—showing you can quantify the tradeoff (e.g., precompute for hot paths, traverse for cold or deep queries) demonstrates senior-level judgment.

1. Clarify requirements and constraints

Ask about graph size, update frequency, query patterns (depth, frequency), latency SLAs, and consistency needs. This grounds the tradeoff discussion in real numbers.

2. Describe precomputation approach

Explain how you would precompute transitive closures (e.g., materialized views, denormalized tables) and the costs: storage blowup (O(n^2) worst case), write amplification, and staleness.

3. Describe on-demand traversal approach

Explain graph traversal (BFS/DFS) at query time, its costs: higher latency for deep graphs, CPU/memory per query, but always fresh and no storage overhead.

4. Compare tradeoffs explicitly

Contrast latency vs storage, read vs write performance, consistency vs freshness, and operational complexity. Use concrete examples or estimates.

5. Propose a hybrid or adaptive solution

Suggest caching hot results, precomputing for shallow depths or frequent queries, and falling back to traversal for deep or rare queries. Mention monitoring and invalidation strategies.

Key Points to Mention

  • Read/write ratio and query latency requirements drive the decision
  • Storage cost and write amplification of precomputed transitive closures
  • Staleness and consistency challenges with precomputation (invalidation, eventual consistency)
  • Query-time traversal latency and resource usage for deep or complex graphs
  • Hybrid approaches: caching, materialized views for hot paths, lazy precomputation
  • Operational complexity: maintenance, monitoring, and failure modes of each approach

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

Q4

How would you propagate authorization changes consistently across the system when a group membership is updated?

System DesignAPI & Integrations
Author's notes

Talked about event-driven propagation with a message queue and eventual consistency.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scope: which systems consume authorization decisions (APIs, caches, services, UI) and what consistency guarantees are needed. Then propose a publish-subscribe or event-driven mechanism where group membership changes emit events that trigger cache invalidation and policy re-evaluation across all consumers, with idempotency and versioning to handle ordering and duplicates.

Pro tip: Emphasize the trade-off between strong and eventual consistency: for most authorization systems, eventual consistency with a short propagation delay is acceptable, but you must bound that delay and provide a way to detect and reconcile drift. Mentioning a reconciliation job or audit log shows operational maturity.

1. Clarify requirements and scope

Ask about the number of services, expected propagation latency, consistency requirements (strong vs eventual), and failure modes. Identify all authorization consumers: API gateways, microservices, caches, and client-side UI.

2. Design the change propagation mechanism

Propose an event-driven approach: when group membership changes, publish an event to a message bus (e.g., Kafka, SNS/SQS). Subscribers (authorization services, caches) consume the event and invalidate or update their local state.

3. Ensure correctness and idempotency

Include a version or timestamp in events to handle out-of-order delivery, and make consumers idempotent. Use a centralized authorization service (e.g., policy decision point) as the source of truth to avoid divergent logic.

4. Handle failures and reconciliation

Implement retries with dead-letter queues for failed event processing. Periodically run a reconciliation job that compares cached permissions with the source of truth and corrects drift.

5. Monitor and bound propagation delay

Add metrics and alerts for event processing latency and cache staleness. Define an SLO for propagation delay and ensure the system meets it, with fallbacks (e.g., bypass cache on critical operations) if needed.

Key Points to Mention

  • Event-driven architecture with a message bus for decoupled propagation
  • Cache invalidation strategies (TTL, explicit invalidation, write-through)
  • Idempotency and event versioning to handle duplicates and ordering
  • Centralized policy decision point (PDP) as the source of truth
  • Reconciliation jobs and audit logs to detect and fix drift
  • Trade-offs between strong and eventual consistency, and bounding propagation delay

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

Q5

What indexing and caching strategies would you use to make access-check queries fast?

System DesignTechnical Trade-offs
Author's notes

Went with a read-through cache keyed on user-camera pairs with TTL-based invalidation, plus a secondary index on group membership tables.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the access-check query pattern and scale (e.g., read-heavy, low-latency, high cardinality of users/resources). Then propose a layered strategy: indexing for efficient lookups, caching for hot data, and invalidation for consistency, while discussing trade-offs like staleness vs. latency.

Pro tip: Emphasize that caching access decisions requires careful invalidation on permission changes; mention using a versioned cache key or short TTLs to bound staleness, and consider negative caching for denied checks to prevent repeated expensive lookups.

1. Clarify requirements and access patterns

Ask about query volume, latency SLOs, data size, and how often permissions change. This determines whether to optimize for reads, writes, or both.

2. Design indexes for access-check queries

Propose composite indexes on (user_id, resource_id) or (resource_id, user_id) depending on query direction, and consider covering indexes to avoid table lookups. Mention partitioning for large datasets.

3. Layer caching with appropriate granularity

Cache at multiple levels: in-process (e.g., LRU) for hottest checks, distributed cache (e.g., Redis) for shared decisions, and possibly a read-through cache for user-role mappings. Discuss cache key design and negative caching.

4. Address invalidation and consistency

Explain strategies like TTL-based expiry, event-driven invalidation on permission changes, and versioned cache keys. Discuss trade-offs between staleness and performance, and how to handle cache misses gracefully.

5. Evaluate trade-offs and alternatives

Compare with precomputed materialized views or denormalized permission tables. Discuss monitoring cache hit rates and index usage, and when to consider a dedicated authorization service (e.g., Zanzibar-style).

Key Points to Mention

  • Composite indexes on (user_id, resource_id) and covering indexes to avoid extra lookups
  • Multi-level caching: in-process LRU, distributed Redis, with negative caching for denied checks
  • Cache invalidation via TTLs, event-driven updates, or versioned keys to bound staleness
  • Trade-offs between consistency and latency, and how to handle cache misses (e.g., singleflight)
  • Partitioning or sharding for large permission tables to keep index size manageable
  • Monitoring cache hit rate and index performance to validate the strategy

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

Q6

How would you approach sharding and scaling this service as the number of users and cameras grows?

System DesignTechnical Trade-offs
Author's notes

Sharded by user ID for the membership store, but then they pointed out that camera-centric queries cross shard boundaries.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the service's current architecture and data model, then identify bottlenecks as users and cameras grow. Propose a sharding strategy based on natural partitioning (e.g., by customer or camera), and discuss scaling reads/writes, storage, and handling hot shards. Emphasize trade-offs and operational complexity.

Pro tip: Highlight the importance of choosing a shard key that avoids hotspots and supports future growth, and mention how you'd handle rebalancing and failure recovery. Showing awareness of operational burden (e.g., monitoring, backups) sets you apart.

1. Understand current architecture and growth drivers

Ask about the existing system design, data flow, and what 'scaling' means (users, cameras, video storage, queries). Identify the main bottlenecks (e.g., database writes, storage, bandwidth).

2. Choose a sharding key and strategy

Propose sharding by customer/tenant or camera ID to distribute load evenly. Discuss trade-offs: tenant-based simplifies isolation but may cause hotspots; camera-based distributes better but complicates cross-camera queries.

3. Scale each component (storage, compute, network)

Address scaling of video storage (e.g., object storage with tiering), metadata databases (sharded SQL/NoSQL), and streaming/processing (horizontal scaling with load balancers). Mention caching and CDNs for video playback.

4. Handle hot shards and rebalancing

Explain how to detect and mitigate hot shards (e.g., splitting shards, consistent hashing, dynamic rebalancing). Discuss automation and monitoring to maintain balance as usage patterns change.

5. Discuss trade-offs and operational considerations

Summarize trade-offs: complexity vs. scalability, consistency vs. availability, cost. Mention operational aspects: deployment, monitoring, backups, and disaster recovery for a sharded system.

Key Points to Mention

  • Shard key selection (e.g., customer ID, camera ID) and its impact on data distribution and query patterns
  • Horizontal scaling of stateless services and database sharding/replication
  • Storage scaling strategies for video data (object storage, tiering, retention policies)
  • Handling hot shards and rebalancing (consistent hashing, dynamic shard splitting)
  • Caching and CDN for video streaming to reduce backend load
  • Trade-offs: consistency vs. availability, operational complexity, cost

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

Q7

How would you design the auditing layer to track who had access to what camera and when?

System DesignData Modeling
Author's notes

Append-only audit log, time-stamped events for every membership change, separate read path from the main access-check service.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: what events need auditing (view, export, share), retention period, and compliance needs. Then propose a high-level architecture with an append-only audit log, capturing immutable events with actor, camera, action, timestamp, and context. Discuss data modeling, storage choices, and how to ensure reliability and query performance.

Pro tip: Emphasize that audit logs must be tamper-evident and immutable, and mention partitioning by time and camera for efficient queries—this shows you understand real-world operational needs.

1. Clarify requirements

Ask about the scope of auditing (e.g., live view, playback, export), retention period, compliance standards (e.g., GDPR, HIPAA), and expected query patterns.

2. Define the event schema

Specify the fields to capture: actor (user/service), action, resource (camera ID), timestamp, source IP, and outcome. Consider including a request ID for traceability.

3. Design storage and write path

Propose an append-only, immutable log (e.g., using a write-once store or blockchain-like hash chaining). Discuss partitioning by time and camera for scalability.

4. Address query and access

Explain how to efficiently query logs (e.g., indexing by actor, camera, time) and how to secure access to the audit logs themselves (e.g., role-based access, encryption).

5. Handle reliability and retention

Discuss ensuring no events are lost (e.g., async logging with retries, dead-letter queues) and implementing retention policies with archival and deletion.

Key Points to Mention

  • Immutable, append-only audit log with tamper-evident features (e.g., hash chaining)
  • Event schema including actor, action, resource, timestamp, and context
  • Partitioning and indexing strategy for efficient queries at scale
  • Asynchronous logging with guaranteed delivery (e.g., message queue, retries)
  • Retention and archival policies to meet compliance and cost constraints
  • Access control and encryption for the audit logs themselves

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