← AT&T Interview Insights

AT&T·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Technical phone screen for a software engineer role, just one coding question around text search and indexing. Pretty focused session, no behavioral stuff at all.

Questions Asked (1)

Q1

Given a dictionary mapping integer indices to sentence strings and a single query word, return a sorted list of the indices where that word appears. Matching should be case-insensitive and word-boundary aware.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

My first instinct was just to loop through every sentence and split on whitespace, which works fine for one query.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify requirements and edge cases (e.g., punctuation, case sensitivity, multiple occurrences). Then, outline an efficient algorithm using tokenization and a hash map to map words to indices, and finally discuss trade-offs between preprocessing and on-the-fly search.

Pro tip: Mention that you would preprocess the dictionary once to build an inverted index if queries are frequent, but for a single query, a linear scan with tokenization is simpler and sufficient. This shows you consider scalability and practical constraints.

1. Clarify Requirements

Ask about input constraints, definition of 'word' (e.g., punctuation handling), and whether the dictionary is static or dynamic. Confirm output format and sorting order.

2. Choose Data Structures

Decide between a simple linear scan with tokenization or building an inverted index. Consider time/space trade-offs based on query frequency and dictionary size.

3. Design Algorithm

Outline steps: tokenize each sentence into words (case-insensitive, word-boundary aware), check for query match, collect indices, then sort. Discuss regex vs. split-based tokenization.

4. Analyze Complexity

State time and space complexity for your approach. For linear scan: O(N*L) where N is number of sentences and L is average length. For inverted index: O(1) query after O(N*L) preprocessing.

5. Discuss Edge Cases and Trade-offs

Cover edge cases like empty dictionary, no matches, punctuation, and case variations. Discuss trade-offs between preprocessing and on-the-fly search, and scalability for large datasets.

Key Points to Mention

  • Case-insensitive matching: convert both query and sentence words to lowercase.
  • Word-boundary awareness: use regex with word boundaries (\b) or tokenization to avoid partial matches.
  • Efficient data structures: hash map for inverted index if multiple queries, or simple list for single query.
  • Sorting: collect indices and sort them, or iterate in sorted order if dictionary keys are sorted.
  • Complexity analysis: time and space for chosen approach.
  • Scalability: consider preprocessing for frequent queries vs. on-the-fly for one-off queries.

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