0
0
Android Kotlinmobile~20 mins

CI/CD with GitHub Actions in Android Kotlin - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
GitHub Actions Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
GitHub Actions Workflow Trigger Output
You have a GitHub Actions workflow configured to trigger on push events to the main branch only. What will happen if you push a commit to a branch named feature/login?
AThe workflow will not run because the push is not to the main branch.
BThe workflow will run because all push events trigger it.
CThe workflow will run only if the commit message contains 'deploy'.
DThe workflow will run but only after a manual approval.
Attempts:
2 left
💡 Hint
Check the event trigger conditions in the workflow YAML.
Configuration
intermediate
2:00remaining
Correct Syntax for a Job in GitHub Actions
Which of the following YAML snippets correctly defines a job named build that runs on Ubuntu latest and executes a step to print 'Hello World'?
A
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Print greeting
        run: echo "Hello World"
B
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Print greeting
        command: echo "Hello World"
C
jobs:
  build:
    runs_on: ubuntu-latest
    steps:
      - name: Print greeting
        run: echo "Hello World"
D
jobs:
  build:
    runs-on: ubuntu-latest
    step:
      - name: Print greeting
        run: echo "Hello World"
Attempts:
2 left
💡 Hint
Check the exact keys required for jobs and steps in GitHub Actions YAML.
🔀 Workflow
advanced
2:30remaining
Sequential Job Execution in GitHub Actions
You want to create a workflow with two jobs: build and test. The test job should run only after build completes successfully. Which configuration achieves this?
A
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - run: echo Build
  test:
    runs-on: ubuntu-latest
    steps:
      - run: echo Test
B
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - run: echo Build
  test:
    runs-on: ubuntu-latest
    depends_on: build
    steps:
      - run: echo Test
C
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - run: echo Build
  test:
    runs-on: ubuntu-latest
    after: build
    steps:
      - run: echo Test
D
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - run: echo Build
  test:
    runs-on: ubuntu-latest
    needs: build
    steps:
      - run: echo Test
Attempts:
2 left
💡 Hint
Look for the keyword that defines job dependencies in GitHub Actions.
Troubleshoot
advanced
2:30remaining
Diagnosing a Failed GitHub Actions Workflow
A GitHub Actions workflow fails with the error: Permission denied (publickey) when trying to push to the repository. What is the most likely cause?
AThe runner machine does not have internet access.
BThe workflow YAML syntax is incorrect causing authentication failure.
CThe workflow is missing a valid SSH key or token with push permissions.
DThe repository is archived and cannot accept pushes.
Attempts:
2 left
💡 Hint
Consider what is needed for GitHub Actions to push code back to the repo.
Best Practice
expert
3:00remaining
Optimizing CI/CD Workflow for Android Kotlin Project
Which practice best improves build speed and efficiency in a GitHub Actions workflow for an Android Kotlin project?
ARun all tests and builds on every push to any branch without caching.
BCache Gradle dependencies and build outputs between workflow runs.
CUse a self-hosted runner with minimal resources to save costs.
DTrigger workflows only manually to avoid unnecessary runs.
Attempts:
2 left
💡 Hint
Think about how to avoid downloading dependencies every time.