← h2 Interview Insights

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

SeniorPrefer not to say
Jun 2026

Summary

System design round at h2 for a software engineer role, and they threw a genuinely meaty problem at me: build a full annotation workflow engine from scratch. Claude was permitted, which helped, but the scope was still a lot to cover in one sitting.

Questions Asked (4)

Q1

Design an annotation workflow engine that supports dual-review pipelines, conflict resolution via adjudication, revision loops, and a full analytics layer. Define the data model, state machine, APIs, and assignment strategies.

System DesignData ModelingAPI & Integrations
Author's notes

This was a single question that ate the entire session.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then define the core entities and state machine before designing APIs and assignment strategies. Emphasize modularity, idempotency, and analytics hooks to ensure the system is extensible and observable.

Pro tip: Design the state machine to be event-driven and store all transitions as immutable events; this simplifies audit, analytics, and conflict resolution. Also, consider using a separate analytics store (e.g., columnar DB) to avoid impacting transactional performance.

1. Clarify Requirements and Scale

Ask about expected volume (tasks, annotators), latency requirements, and whether the system needs to support real-time collaboration. This will guide decisions on data storage, consistency, and API design.

2. Define Data Model and State Machine

Identify core entities: Task, Annotation, Review, Adjudication, User, and Project. Define states for tasks (e.g., Created, Assigned, Annotated, InReview, Adjudicated, Completed) and transitions, ensuring support for revision loops and dual-review.

3. Design APIs and Assignment Strategies

Outline RESTful or RPC APIs for task management, annotation submission, review, and adjudication. Discuss assignment strategies (e.g., round-robin, skill-based, load balancing) and how to handle conflicts and revisions.

4. Incorporate Analytics and Observability

Describe how to capture metrics (e.g., throughput, quality, agreement) via event streams or change data capture. Propose a separate analytics layer to avoid impacting the transactional system.

5. Address Scalability and Trade-offs

Discuss scaling the state machine and assignment logic (e.g., sharding by project, using queues). Highlight trade-offs between consistency and availability, and how to ensure idempotency and exactly-once processing.

Key Points to Mention

  • Event sourcing for state transitions to enable audit, replay, and analytics
  • Idempotent APIs to handle retries and ensure exactly-once processing
  • Conflict resolution via adjudication with clear escalation paths
  • Assignment strategies that consider annotator expertise and workload
  • Separation of transactional and analytical data stores for performance
  • Support for revision loops with versioning of annotations

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

Q2

How would you handle idempotency in the annotation submission and adjudication APIs, especially under retries or duplicate requests?

API & IntegrationsTechnical Trade-offs
Author's notes

They pushed on this after I sketched the API surface.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining idempotency and why it matters for annotation submission and adjudication APIs, especially under retries. Then outline a concrete strategy using idempotency keys, deduplication, and transactional guarantees, and discuss trade-offs like storage overhead and latency. Finally, mention how you would test and monitor idempotency in production.

Pro tip: Emphasize that idempotency is not just about preventing duplicates but also about ensuring consistent state transitions, especially in adjudication where multiple reviewers might act concurrently. Mention using database constraints or conditional writes to enforce idempotency at the data layer, which is more reliable than application-level checks alone.

1. Clarify requirements and failure modes

Identify the specific scenarios where idempotency is needed: client retries, network timeouts, duplicate submissions, and concurrent adjudication actions. Discuss the impact of duplicates on data integrity and user experience.

2. Design idempotency mechanism

Propose using client-generated idempotency keys (e.g., UUIDs) for each request, stored server-side with a unique constraint. For adjudication, consider using a combination of annotation ID, reviewer ID, and action as a natural key.

3. Implement storage and lookup

Store idempotency keys in a fast, persistent store (e.g., Redis or a database table) with a TTL. On request, check if the key exists; if so, return the stored response; otherwise, process and store the result atomically.

4. Handle concurrency and consistency

Use database transactions or conditional writes (e.g., INSERT ... ON CONFLICT DO NOTHING) to prevent race conditions. For adjudication, ensure that state transitions are atomic and that duplicate actions are ignored or return the current state.

5. Test, monitor, and iterate

Write tests simulating retries and concurrent requests. Monitor for duplicate key violations and idempotency key collisions. Consider logging and alerting on idempotency key reuse with different payloads.

Key Points to Mention

  • Idempotency keys: client-generated unique identifiers for each request, stored server-side to detect duplicates.
  • Database constraints: unique indexes on idempotency keys or natural keys to enforce idempotency at the data layer.
  • Transactional guarantees: using ACID transactions or conditional writes to ensure atomicity and consistency.
  • Concurrency control: handling simultaneous requests with locking or optimistic concurrency control.
  • Trade-offs: storage overhead, latency, and complexity vs. data integrity and user experience.
  • Testing and monitoring: simulating retries, concurrent requests, and monitoring for duplicate key violations.

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

Q3

How would you extend this system to support new pipeline shapes beyond dual-review, such as triple-review or consensus-based voting?

System DesignAdaptability & AmbiguityTechnical Trade-offs
Author's notes

Extensibility question.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by abstracting the current dual-review logic into a configurable pipeline where the number of reviewers and decision rule are parameters. Then describe how to implement different shapes like triple-review and consensus voting by plugging in new decision strategies. Finally, discuss trade-offs around latency, cost, and consistency, and how to test and roll out changes safely.

Pro tip: Emphasize that the core challenge is not just adding more reviewers but defining clear, testable decision rules and handling partial failures gracefully. Mention that you'd start with a simple extension (e.g., triple-review as a special case) to validate the abstraction before tackling more complex consensus algorithms.

1. Identify current assumptions and constraints

Analyze the existing dual-review system to pinpoint hardcoded assumptions (e.g., exactly two reviewers, simple majority) and non-functional requirements like latency and consistency.

2. Abstract the pipeline into configurable components

Propose a design where the number of reviewers, their roles, and the decision aggregation logic are configurable, possibly using a strategy pattern or rule engine.

3. Design decision strategies for new shapes

Outline how to implement triple-review (e.g., majority or unanimous) and consensus-based voting (e.g., weighted voting, quorum) as pluggable strategies.

4. Address trade-offs and failure modes

Discuss trade-offs in latency, cost, and complexity, and how to handle reviewer unavailability, ties, or conflicting outcomes.

5. Plan for testing and incremental rollout

Describe how to validate new pipeline shapes with unit and integration tests, and how to roll out changes gradually using feature flags or canary deployments.

Key Points to Mention

  • Abstraction of review logic into configurable components (e.g., strategy pattern, pipeline configuration)
  • Definition of decision rules: majority, unanimous, weighted, quorum, etc.
  • Handling edge cases: ties, abstentions, reviewer failures, timeouts
  • Trade-offs: increased latency and cost vs. improved accuracy or fairness
  • Testing strategies: unit tests for decision logic, integration tests for pipeline, simulation of edge cases
  • Incremental rollout: feature flags, A/B testing, monitoring for regressions

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

Q4

How would the system scale to handle large item volumes and many concurrent annotators without bottlenecks in queue management or assignment?

System DesignTechnical Trade-offs
Author's notes

Blanked for a second here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale (item volume, annotator count, throughput) and then propose a horizontally scalable architecture with partitioned queues and a distributed assignment service. Discuss trade-offs between consistency, latency, and cost, and explain how you would monitor and auto-scale each component.

Pro tip: Emphasize idempotency and exactly-once processing in assignment to avoid duplicate work, and mention using a consistent hashing ring for partition assignment to minimize rebalancing when scaling.

1. Clarify requirements and scale

Ask about expected item volume, number of concurrent annotators, throughput, and latency SLAs to ground the design in concrete numbers.

2. Design scalable queueing

Propose partitioning the work queue (e.g., by item type or hash) and using a distributed message broker like Kafka or SQS to avoid single-point bottlenecks.

3. Implement distributed assignment

Use a stateless assignment service with a consistent hashing ring or a coordination service like ZooKeeper/etcd to assign items to annotators without central contention.

4. Address consistency and fault tolerance

Ensure idempotent assignment, handle annotator failures with timeouts and re-queueing, and use optimistic locking or versioning to prevent duplicate assignments.

5. Monitor, auto-scale, and optimize

Instrument queue depth, assignment latency, and annotator utilization; auto-scale consumers and assignment workers; and consider caching or batching for high throughput.

Key Points to Mention

  • Partitioned queues (e.g., Kafka topics with multiple partitions) to parallelize consumption
  • Consistent hashing for even distribution and minimal rebalancing when scaling annotators
  • Idempotent assignment and exactly-once processing semantics to avoid duplicate work
  • Use of a distributed coordination service (ZooKeeper, etcd) for leader election and state management
  • Backpressure and rate limiting to prevent overload during spikes
  • Monitoring and auto-scaling based on queue depth and annotator load

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