← F5Networks Interview Insights

F5Networks·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Coding round for a Software Engineer role at F5Networks. One problem, hashtag frequency stuff, looked approachable at first but the sorting tie-breaking tripped me up a bit.

Questions Asked (1)

Q1

Given two arrays of tweets and their timestamps, plus a current time and a time window, return the top 3 most popular hashtags (tokens starting with '#') from tweets within the inclusive time range. Sort by descending count, then lexicographically ascending on ties.

Algorithms & Data Structures
Author's notes

The filtering part was fine, just check if the timestamp falls in the range and parse out tokens starting with '#'.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem constraints (array sizes, timestamp format, case sensitivity) and then propose a solution that filters tweets by the inclusive time window, tokenizes each tweet to extract hashtags, counts frequencies using a hash map, and finally sorts the hashtags by count descending and lexicographically ascending to return the top 3. Discuss time and space complexity, and consider edge cases like no hashtags or ties.

Pro tip: Demonstrate awareness of real-world data by mentioning that tweets may contain multiple hashtags, URLs, or punctuation, and that tokenization should handle these correctly; also note that sorting can be optimized with a heap if the number of unique hashtags is large.

1. Clarify requirements and constraints

Ask about input sizes, timestamp format (e.g., Unix epoch or string), whether the time window is inclusive, and if hashtags are case-sensitive. Confirm the output format (list of strings or with counts).

2. Filter tweets by time window

Iterate through the tweets and timestamps, selecting only those where the timestamp is within [current_time - window, current_time] (inclusive). If timestamps are not sorted, this is O(n).

3. Extract and count hashtags

For each selected tweet, tokenize the text (e.g., split by whitespace) and for each token starting with '#', increment its count in a hash map. Consider stripping punctuation and handling case sensitivity.

4. Sort hashtags by count and lexicographically

Sort the unique hashtags by count descending, and for ties, by lexicographic ascending order. Use a custom comparator or sort with a tuple key.

5. Return top 3 and discuss complexity

Return the first three hashtags (or fewer if not enough). Analyze time complexity: O(n + m log m) where n is number of tweets and m is number of unique hashtags; space O(m).

Key Points to Mention

  • Time window is inclusive on both ends; clarify if current_time is included.
  • Hashtag extraction: tokens starting with '#'; consider edge cases like '#' alone or multiple '#' in a token.
  • Use a hash map for counting; sorting with custom comparator for count descending and lexicographic ascending.
  • Optimization: use a min-heap of size 3 to avoid sorting all hashtags if m is large.
  • Handle ties correctly: lexicographic order is ascending (e.g., 'apple' before 'banana').
  • Discuss time and space complexity, and potential follow-ups like streaming data or large-scale processing.

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