Evaluate Nested AND/OR Filter Conditions for a View

Last updated: November 29, 2026

Quick Overview

A view's filter is a tree of conditions and groups, where each group combines children with AND or OR and each condition applies an operator (is, contains, greater than, is empty and so on) to a field. Return the ids of records that pass the filter.

Airtable
Coding & Algorithms
Software Engineer
Airtable
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


A view's filter is a tree of conditions and groups, where each group combines children with AND or OR and each condition applies an operator (is, contains, greater than, is empty and so on) to a field. Return the ids of records that pass the filter.

Airtable views support nested condition groups, and the same filter logic powers automations and interface pages. The interviewer checks recursive thinking, an extensible operator table, and careful semantics for blanks and multi-value fields.

What the Interviewer Expects
  • Represent the filter as a recursive tree
  • Short-circuit AND and OR evaluation
  • Dispatch operators through a table rather than a long if chain
  • Define behavior for blank values on comparisons
  • Handle multi-select fields in contains
Key Topics to Cover
Recursion
Tree evaluation
Predicate design
Short-circuiting
Null semantics
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you turn this tree into a query against an index instead of scanning every record?
  • How would you validate that an operator is legal for the field type when the filter is saved?
  • How would you evaluate 'is within the past week' for date fields across time zones?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Nodes are either {conjunction, conditions} or {field, op, value}. Comparisons against blank values are false (a blank Points cell is neither above nor below 4). contains checks membership for mu...

High-Level Design

A recursive matches(record, node) function: groups use Python's all and any, which short-circuit, and leaves look up a lambda in an operator table. Adding a new operator is a single dictionary e...


Submit Your Answer
Markdown supported

Related Questions