Salesforce logo

Salesforce DevOps Engineer Coding Questions

31 practice questions for Salesforce DevOps Engineer interviews

Salesforce DevOps engineer interviews cover CI/CD pipelines, infrastructure as code, container orchestration, monitoring, and incident response procedures.

All Roles Software Engineer Backend Engineer Frontend Engineer Full Stack Engineer Mobile Engineer Data Engineer Data Scientist ML Engineer DevOps Engineer DevOps Engineer Product Manager SRE Security Engineer Engineering Manager Data Analyst UX/UI Designer QA Engineer

No verified questions yet for Salesforce.

coding Hard ci cd #1

1. [OA] Docker Image Optimization — Optimize Dockerfiles for Salesforce services

As Salesforce continues to scale, optimizing Docker images not only reduces deployment time but also conserves resources. A refined Docker image can significantly impact CI/CD processes.
Problem statement: Write a Python function to optimize a given Dockerfile by removing unused layers, minimizing the final image size, and ensuring best practices are followed. The function should also highlight areas for further improvements.
- Method: optimize_dockerfile(dockerfile: str) -> str — Takes a Dockerfile as a string, optimizes it and returns the optimized Dockerfile as a string.
Example 1:
Input: FROM python:3.8
RUN pip install --no-cache-dir -r requirements.txt

Output: FROM python:3.8
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

Explanation: Merges RUN commands to minimize layers.
Constraints:
- Dockerfile will contain a maximum of 150 lines.
- Follow best practices for reducing image size.
coding Hard infra #2

2. [OA] Terraform State Management — Manage shared Terraform state for Salesforce environments

In Salesforce, managing infrastructure as code is crucial for deployment consistency. You must ensure that Terraform state files are managed effectively to avoid conflicts.
Problem statement: Create a Python script to manage Terraform state files across multiple Salesforce environments. The script must handle functionality to init, apply, and destroy the state, while ensuring no conflicting changes occur.
- Method: init() -> None — Initializes Terraform working directory.
- Method: apply() -> str — Applies the Terraform configuration and returns the output state.
- Method: destroy() -> str — Destroys the configured infrastructure and returns confirmation message.
Example 1:
Input: apply()
Output: Terraform applied successfully
Explanation: Applies the Terraform configuration and returns success message.
Constraints:
- The script must handle at least 10,000 resources.
- Each environment is treated as a separate directory.
- Handle conflicts on concurrent executions gracefully.

Related Salesforce DevOps Engineer interview prep

Start practicing Salesforce questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free