FastPrepLongest All-Present Attendance Streak
Problems/Longest All-Present Attendance Streak

Longest All-Present Attendance Streak

Oracle logoOracle● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Oracle phone screen. A report names this well-known task. We chose the function signature, a fixed order for the output, and the input limits. Our version is about 98% the same as the reported question.

You are given daily attendance records in attendance. Each string represents one day, each position represents the same employee across all days, 'Y' means present, and 'N' means absent.

Return the maximum number of consecutive days on which every employee was present. A day qualifies only when every character in its record is 'Y'. Return 0 when no day qualifies.

Function

longestAllPresentStreak(attendance: String[]) → int

Examples

Example 1

attendance = ["YYY","YYY","YNY","YYY"]return = 2

The first two days form the longest all-present streak.

Example 2

attendance = ["NN","YN","NY"]return = 0

Every day has at least one absence.

Example 3

attendance = ["Y","Y","Y"]return = 3

All three days qualify.

Constraints

  • 1 <= attendance.length <= 10^5.
  • 1 <= attendance[i].length <= 100.
  • All strings have the same length and contain only 'Y' and 'N'.

Source note: Author-written prompt excerpt retained for source fidelity.

More Oracle Phone Screen questions

  • Remove Parentheses from a Plus-Minus ExpressionPHONE SCREEN · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · Seen Oct 2026
  • Shortest Window by Distinct-Value SumPHONE SCREEN · Seen Oct 2026
  • Detect a Cycle in a Directed GraphPHONE SCREEN · Seen Oct 2026
  • Time-Based Key-Value StorePHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Remove Adjacent Duplicates in String IIPHONE SCREEN · Seen Oct 2026
  • Sum Root-to-Leaf Binary NumbersPHONE SCREEN · Seen Oct 2026
  • Next PermutationPHONE SCREEN · Seen Sep 2026
  • Valid ParenthesesPHONE SCREEN · Seen Sep 2026
  • Valid Parenthesis StringPHONE SCREEN · Seen Sep 2026

Similar questions at other companies

  • Search and Format ContactsAdyen · PHONE SCREENAdyen interview questions
  • Detect a Straight FlushTemu · PHONE SCREENTemu interview questions
  • Longest Common PrefixKotak Mahindra Bank · PHONE SCREEN · ONSITE INTERVIEWKotak Mahindra Bank interview questions
  • Shared Courses for Every Pair of StudentsCrunchyroll · PHONE SCREENCrunchyroll interview questions
  • Single-Condition Product FilterCrowdstrike · PHONE SCREENCrowdstrike interview questions
  • Match a Variadic Function SignatureConfluent · PHONE SCREENConfluent interview questions
  • Parse and Sort Integer DataLegora · PHONE SCREEN
  • Convert an Entry List to a MapEPAM · PHONE SCREENEPAM interview questions
  • Most Frequent NameAmazon · PHONE SCREEN
  • Process Refunds with Bounded RetriesMercor · PHONE SCREENMercor interview questions

Oracle interview experiences

  • Oracle SWE Onsite Interview Experience: 1 Experience
All Oracle interview questionsSee Oracle hiring insights
Saved
class Solution {
    public int longestAllPresentStreak(String[] attendance) {
        // Write your solution here.
    }
}
Checking account…