FastPrepDaily Temperatures
Problems/Daily Temperatures

Daily Temperatures

Anduril logoAnduril● MediumFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Anduril full-time onsite interview. The report names Daily Temperatures. It says the interviewer asked for a brute-force way, a stack way, and a way that fills an output array. Our version is about 99% the same as the reported question.

Given an array temperatures, return an array answer where answer[i] is the number of days after day i until a strictly warmer temperature occurs. If no later day is warmer, set answer[i] to 0.

Function

dailyTemperatures(temperatures: int[]) → int[]

Examples

Example 1

temperatures = [73,74,75,71,69,72,76,73]return = [1,1,4,2,1,1,0,0]

Look at day 2, which has temperature 75. The next three days are all cooler. The first warmer day has temperature 76, four days later, so that answer is four. The last two days have no warmer day after them, so their answers are zero.

Example 2

temperatures = [30,60,90]return = [1,1,0]

The first day is followed right away by a warmer day, so its answer is one. The same is true for the second day. The last day has no day after it, so its answer is zero.

Constraints

  • 1 <= temperatures.length <= 100000.
  • -1000 <= temperatures[i] <= 1000.

More Anduril interview questions

  • Add Word and Suffix SearchONSITE INTERVIEW · Seen Aug 2026
  • Binary Tree Preorder TraversalONSITE INTERVIEW · Seen Aug 2026
  • Operator-First Array CalculatorONSITE INTERVIEW · Seen Aug 2026
  • Highlighted Context WindowsONSITE INTERVIEW · Seen Jun 2024
  • Pacific Atlantic Water FlowPHONE SCREEN · Seen Aug 2026
  • Choose the Front Football TeamPHONE SCREEN · Seen May 2026
  • Maximum Visible DronesPHONE SCREEN · Seen Jun 2024
  • Build a Sorted Circular Singly Linked ListPHONE SCREEN · Seen Feb 2024
  • Sparse Vector Dot ProductPHONE SCREEN · Seen Apr 2021

Similar questions at other companies

  • Compress Editor Actions into Operational Transform OperationsReplit · OA · PHONE SCREEN · ONSITE INTERVIEW
  • Flatten a Mixed JSON ListNike, Inc. · ONSITE INTERVIEWNike, Inc. interview questions
  • Fountain SafetyGoogle · ONSITE INTERVIEWGoogle interview questions
  • Trace Events from Stable Whole-Stack StatesAnthropic · ONSITE INTERVIEWAnthropic interview questions
  • Next Smaller Ticket PriceAmazon · ONSITE INTERVIEW
  • Next Greater Element to the RightTekion · ONSITE INTERVIEWTekion interview questions
  • Surviving Balls after Directional CollisionsSalesforce · ONSITE INTERVIEWSalesforce interview questions
  • Daily TemperatureseBay · ONSITE INTERVIEWeBay interview questions
  • Asteroid CollisionAdobe · ONSITE INTERVIEWAdobe interview questions
  • Most Frequent Call Path in Interleaved LogsRoblox · ONSITE INTERVIEWRoblox interview questions
All Anduril interview questionsSee Anduril hiring insights
Saved
class Solution {
    public int[] dailyTemperatures(int[] temperatures) {
        // Write your code here.
    }
}
Checking account…