HackTheRounds Interview Experiences

Oracle Software Engineer Interview Experience (2026) - Stock Profit, Loan EMI, Packet Repackaging, Rejected

Oracle SWE HackerRank OA and onsite breakdown: max stock profit at 10^8 scale, piecewise EMI loan comparison, power of two packet repackaging, plus LRU and topo

By Anonymous ยท 2026-04-04

Background

Oracle was the loop I took seriously only after my recruiter told me the coding rounds were not generic. I had assumed big-enterprise software companies meant a lighter bar, and that assumption cost me about a week of complacent prep. I am a new grad with an internship at a mid-size SaaS company. The coding rounds are HackerRank-flavored with a strong preference for problem-modeling questions rather than pure pattern recognition. I did not get the offer. This post is partly a post-mortem on where I lost the loop.

Timeline

OA and Coding Rounds Overview

Oracle uses HackerRank for the OA and for parts of the onsite. The platform matters because HackerRank test cases are strict about input parsing and about the exact output format. I burned submission attempts on a trailing newline in my first problem before I remembered that HackerRank counts the newline.

The three problems below are the ones I saw across my OA and my first coding round. The difficulty is medium-to-medium-plus, with one "harder to model, easy to code once you see it" at the top of the set.

Problem 1 โ€” Single-Trade Max Profit

Problem: Given daily stock prices for n days, return the maximum profit Ratan can earn from exactly one buy and one sell, where the buy must precede the sell. Return 0 if no profitable trade exists. n can go up to 10^8.

The input size is the signal. You cannot sort, you cannot do any O(n log n) trick. The only thing that fits is a single pass that tracks the running minimum price seen so far and the best profit achieved if you sold today. Update both on every day. O(n) time, O(1) space. The corner case that bit my labmate was an all-decreasing sequence where the answer must be 0, not a negative number.

I mention the input size explicitly because with n at 10^8 you also have to be careful about I/O on HackerRank. In Python, reading line-by-line times out. I used a bulk stdin read and parsed once.

Problem 2 โ€” Bank Loan Comparison

Problem: You are given two loan offers, each with a piecewise-constant annual interest rate schedule over a term of up to 50 years. Compute the total payment under each offer using the standard EMI formula and return the bank with the lower total payment.

This one is a modeling problem, not an algorithm problem. The algorithm is trivial: for each bank, walk the interest-rate segments in order, apply the EMI formula per segment to compute the monthly payment on the remaining principal, subtract the principal paid down over that segment, move to the next segment. Summing monthly payments gives the total cost.

The thing that trips candidates is the EMI formula itself. Do not derive it live. Write it down on scratch paper before the interview so you do not mis-type the exponent. Double-precision floats are fine for the stated constraints but I used high-precision decimals in my Python solution because rounding error at the segment boundary was costing me the last test case.

Problem 3 โ€” Network Flow Packet Repackaging

Problem: A server receives a stream of packets of arbitrary size. The server can only emit packets whose size is exactly a power of two. For each arriving packet, accumulate its size with any remainder from the previous packet, emit the largest power-of-two packet that fits, and carry the remainder forward. Return the maximum emitted packet size across the stream.

The key insight: you only care about the cumulative running sum and, at each step, the largest power of two that is less than or equal to the current accumulator. Walk the stream, update the accumulator with the arriving size, compute the largest power of two that fits using a bit-length primitive, subtract that from the accumulator, and track the running max.

Return type is long because values reach 10^9 per packet times 10^5 packets. I hit an integer-overflow-on-accumulate test case when I initially used a 32-bit integer. Obvious in retrospect.

Onsite Rounds (Brief)

Three one-hour rounds. Two coding rounds and one mixed coding-plus-design round where I was asked to implement an LRU Cache with O(1) get and put and then discuss how to shard it across machines for a production key-value store. The implementation was a standard doubly-linked-list plus hashmap. The discussion was where the round actually scored: consistent hashing with virtual nodes, how you handle a hot key, how you bound the staleness window.

The second coding round was "implement topological sort on a small DAG and then discuss Kahn versus DFS." I used Kahn because the follow-up on cycle detection falls out for free. The interviewer asked about what happens when new edges stream in and you want to maintain a valid ordering incrementally: you cannot, you have to recompute, but you can cache the previous result and recompute only when a new edge invalidates it.

The third round was a mixed algorithm round that started with a two-pointer problem on a histogram array (find two bars that trap the most water between them) and moved into a linked-list merge problem where the twist was that some of the input lists had overridden comparison logic per list. I had to think about which k-way merge strategy still applied when list comparators disagreed, and my answer was to merge pairwise rather than via a global heap.

Result

I did not get the offer. I think I lost points in the middle coding round where I spent too long on the loan-comparison problem and did not leave enough time for the follow-ups. The recruiter was honest about the feedback: I passed the bar on algorithmic skill but came up short on speed and communication. Oracle explicitly scores "pace" and "narrating the approach while writing," and I went heads-down on code for too long.

Tips

  1. For the single-trade stock problem, think about input size first. n at 10^8 in the Oracle problem set is a hint that I/O speed and single-pass algorithms are being graded. Do not sort. Do not use any structure with a log-factor overhead.
  2. Write the EMI formula on paper before the interview starts. The bank-loan problem is a writing-the-formula-correctly problem. I wasted four minutes deriving the formula in my head and still got the exponent wrong on the first attempt.
  3. Know power-of-two bit tricks cold. The Python `bit_length`, the Java `highestOneBit`, the C++ `__builtin_clz`. The packet-repackaging problem is trivial if you have the bit-width primitive memorized.
  4. For LRU at Oracle, be ready to shard. The coding round is the first five minutes. The discussion on sharding, hot keys, and consistent hashing is the last forty minutes. Prep the distributed-KV conversation, not just the linked-list code.
  5. Kahn's algorithm is the default. Oracle has asked topological sort in multiple cycles. Use Kahn because the streaming-edges and cycle-detection follow-ups fall out naturally. DFS post-order works but the follow-ups are harder to handle live.
  6. Talk while you code, even when you are stuck. My biggest mistake was going silent when the loan problem got hard. The interviewer scored that as "stopped communicating under pressure." Narrate your stuckness, say "I am deciding between approach A and B," and keep the interviewer in the loop even when you do not have an answer yet.

The Oracle loop is fair but not forgiving. If you have done Container With Most Water, Merge K Sorted Lists, and the LRU design problem cold, you will have the algorithmic base. The real edge comes from being fast and being able to talk about sharding and streaming extensions without hesitating. I came up short on the second half. Next cycle I will not.