0
0
Hadoopdata~20 mins

Application lifecycle in YARN in Hadoop - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
YARN Lifecycle Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Identify the correct sequence of YARN application lifecycle stages
Which of the following sequences correctly represents the main stages of an application lifecycle in YARN?
A3,2,1,4
B2,1,3,4
C1,3,2,4
D1,2,3,4
Attempts:
2 left
💡 Hint
Think about what happens first when you start a YARN application.
data_output
intermediate
1:00remaining
Determine the final status of a YARN application
Given the following YARN application states: SUBMITTED, ACCEPTED, RUNNING, FINISHED, FAILED, KILLED. What is the final status of an application that completed successfully?
ARUNNING
BFINISHED
CFAILED
DKILLED
Attempts:
2 left
💡 Hint
Think about what status means the application ended without errors.
Predict Output
advanced
1:30remaining
Output of YARN application state transitions in logs
What will be the output of the following pseudo-log snippet showing YARN application state transitions? ``` states = ['SUBMITTED', 'ACCEPTED', 'RUNNING', 'FINISHED'] for i, state in enumerate(states): print(f"State {i+1}: {state}") ```
Hadoop
states = ['SUBMITTED', 'ACCEPTED', 'RUNNING', 'FINISHED']
for i, state in enumerate(states):
    print(f"State {i+1}: {state}")
A
State 0: SUBMITTED
State 1: ACCEPTED
State 2: RUNNING
State 3: FINISHED
B
State 1: SUBMITTED
State 2: RUNNING
State 3: ACCEPTED
State 4: FINISHED
C
State 1: SUBMITTED
State 2: ACCEPTED
State 3: RUNNING
State 4: FINISHED
D
SUBMITTED
ACCEPTED
RUNNING
FINISHED
Attempts:
2 left
💡 Hint
Remember that enumerate starts counting from 0 by default, but the code adds 1.
🔧 Debug
advanced
1:00remaining
Identify the error in YARN application state update code
What error will the following Python code raise when simulating YARN application state updates? ``` states = ['SUBMITTED', 'ACCEPTED', 'RUNNING', 'FINISHED'] for i in range(5): print(states[i]) ```
Hadoop
states = ['SUBMITTED', 'ACCEPTED', 'RUNNING', 'FINISHED']
for i in range(5):
    print(states[i])
AIndexError: list index out of range
BTypeError: 'int' object is not iterable
CSyntaxError: invalid syntax
DNo error, prints all states
Attempts:
2 left
💡 Hint
Check the length of the list and the range used in the loop.
🚀 Application
expert
2:00remaining
Calculate total resource usage time for a YARN application
A YARN application requests 4 containers. Each container runs for 10 minutes. The application master runs for 5 minutes before containers start and 3 minutes after all containers finish. What is the total resource usage time in minutes for this application?
A48
B43
C40
D53
Attempts:
2 left
💡 Hint
Add the application master time and the total container time.