PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Oracle

Solve three DSA problems: trie, window, intervals

Last updated: Mar 29, 2026

Quick Overview

This multi-part question evaluates proficiency with core data structures and algorithms — specifically trie-based string indexing and autocomplete design, sliding-window/prefix-sum optimization for maximizing a one-shot decrypted range, and interval merging — within the Coding & Algorithms domain, emphasizing practical implementation, complexity analysis and edge-case handling. It is commonly asked in technical interviews to assess the ability to design efficient data structures and linear-time algorithms, reason about time/space trade-offs and ordering constraints, and demonstrate both conceptual understanding and practical application through clear complexity analysis.

  • Medium
  • Oracle
  • Coding & Algorithms
  • Software Engineer

Solve three DSA problems: trie, window, intervals

Company: Oracle

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Onsite

1) Design and implement an autocomplete service. Support insert(word) to add a word and suggest(prefix) to return up to five existing words that start with prefix; if fewer than five exist, return all of them. Use a trie-based design; specify the ordering of suggestions (e.g., lexicographic) and the time/space complexities. 2) You are given two arrays: value[0..n-1] of integers and decrypted[0..n-1] of 0/1 flags (1 means already decrypted), plus an integer k. You may perform at most one operation: choose a contiguous subarray whose length is at most k and treat every index in that subarray as decrypted for scoring. The score is the sum of value[i] over all indices that are decrypted after the operation. Compute the maximum achievable score and provide an O(n) algorithm. 3) You are given a list of closed integer ranges [li, ri]. Merge any ranges that overlap or touch (i.e., ri >= lj - 1) and return the merged list sorted by start. Implement the function and analyze its complexity.

Quick Answer: This multi-part question evaluates proficiency with core data structures and algorithms — specifically trie-based string indexing and autocomplete design, sliding-window/prefix-sum optimization for maximizing a one-shot decrypted range, and interval merging — within the Coding & Algorithms domain, emphasizing practical implementation, complexity analysis and edge-case handling. It is commonly asked in technical interviews to assess the ability to design efficient data structures and linear-time algorithms, reason about time/space trade-offs and ordering constraints, and demonstrate both conceptual understanding and practical application through clear complexity analysis.

Related Interview Questions

  • Solve Five Coding Problems - Oracle (medium)
  • Compute letter frequencies from encoded string - Oracle (medium)
  • Count closed islands in a grid - Oracle (easy)
  • Implement in-memory data structures and booking API - Oracle (hard)
  • Implement an LRU cache - Oracle (medium)
Oracle logo
Oracle
Sep 6, 2025, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
2
0
  1. Design and implement an autocomplete service. Support insert(word) to add a word and suggest(prefix) to return up to five existing words that start with prefix; if fewer than five exist, return all of them. Use a trie-based design; specify the ordering of suggestions (e.g., lexicographic) and the time/space complexities.
  2. You are given two arrays: value[0..n-1] of integers and decrypted[0..n-1] of 0/1 flags (1 means already decrypted), plus an integer k. You may perform at most one operation: choose a contiguous subarray whose length is at most k and treat every index in that subarray as decrypted for scoring. The score is the sum of value[i] over all indices that are decrypted after the operation. Compute the maximum achievable score and provide an O(n) algorithm.
  3. You are given a list of closed integer ranges [li, ri]. Merge any ranges that overlap or touch (i.e., ri >= lj -
  4. and return the merged list sorted by start. Implement the function and analyze its complexity.

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Oracle•More Software Engineer•Oracle Software Engineer•Oracle Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.