← Airtable Interview Insights

Airtable·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Got an OOD problem at Airtable for a software engineer role, basically a connection pool implementation exercise. Pretty focused on object design and resource management concepts rather than raw algorithms.

Questions Asked (1)

Q1

You're given three classes: DBConnection (with initialize, query, and close methods that you cannot modify), PoolConnection, and ConnectionPool. Implement PoolConnection's constructor, query, and close methods, plus ConnectionPool's get_connection method. ConnectionPool is initialized with a max connection count. get_connection should return a PoolConnection, or None if the active connection count already hits the max. PoolConnection.query should delegate to the underlying DBConnection, and PoolConnection.close should return the connection back to the pool so it can be reused rather than destroyed.

System DesignTechnical Trade-offsAPI & Integrations
Author's notes

The reuse-on-close part is where I had to slow down and think.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints, then outline the design of ConnectionPool and PoolConnection, emphasizing the delegation and reuse patterns. Implement the methods with thread safety in mind, and discuss potential edge cases and trade-offs.

Pro tip: Mention that you would use a thread-safe data structure like a synchronized queue or a mutex-protected list to manage available connections, and consider using a semaphore to enforce the max connection limit.

1. Clarify requirements and constraints

Ask questions to confirm the expected behavior, such as whether the pool should create connections lazily or eagerly, and whether thread safety is required.

2. Design the ConnectionPool and PoolConnection classes

Define the fields: ConnectionPool holds max_connections, a collection of available connections, and a count of active connections. PoolConnection wraps a DBConnection and a reference to the pool.

3. Implement ConnectionPool.get_connection

Check if active connections < max_connections. If so, create a new DBConnection (or reuse an available one), wrap it in a PoolConnection, increment active count, and return it. Otherwise, return None.

4. Implement PoolConnection.query and close

query delegates to the underlying DBConnection's query method. close returns the connection to the pool's available list and decrements the active count, making it available for reuse.

5. Discuss edge cases and trade-offs

Consider thread safety, connection timeouts, and whether to block when max connections are reached. Mention potential improvements like connection validation or dynamic pool sizing.

Key Points to Mention

  • Thread safety: use locks or concurrent data structures to protect shared state.
  • Connection reuse: close should not destroy the connection but return it to the pool.
  • Max connection limit: enforce strictly to avoid resource exhaustion.
  • Delegation: PoolConnection.query simply calls DBConnection.query.
  • Resource management: ensure connections are properly closed when the pool is shut down.
  • Potential blocking behavior: decide whether get_connection should block or return None when pool is full.

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