Google Interview Question for Software Engineers
- 1of 5 votes
In school a student gets rewarded if he has an attendance record without being absent for more than once or being late for 3 times continuously.- aonecoding March 22, 2017 in United States
Given a student's attendance record represented by a string with 3 possible characters 'L'(Late), 'A'(Absent), 'O' (On time),
check whether the student qualifies for the reward.
@INPUT (String) "OLLAOOOLLO"
@RETURN (Boolean) False
The student does not qualify for reward because "LLA" means he was late for 3 times in a row.
@INPUT (String) "OLLOAOLLO"
@RETURN (Boolean) True
If known the length of the attendance string is n, how many possible ways there is to attend school and make sure you get the reward.
| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm
Interview Type: In-Person
Open Chat in New Window