Skip to content
$ lynuxpro

INTERVIEW PREP

Interview questions

570 questions from real DevOps, SRE, platform engineering and MLOps interviews, with the answer an interviewer wants to hear. Try answering out loud first, then open the model answer.

Showing 31–45 of 192 questions

31.How do you test code that calls AWS?MidPython for DevOps

Mock the client in unit tests or use moto to fake AWS. Keep real-cloud tests few, slow and separate.

32.What does a --dry-run flag do, and why add it?MidPython for DevOps

It shows what the tool would change without changing anything. People can check the result first, so a mistake costs nothing.

33.Why use a digest instead of a tag for production images?MidJFrog Artifactory & Nexus

A tag can be moved to a different image. A digest is a fingerprint of the content, so it always means exactly one image.

34.What is dependency confusion and how do you prevent it?MidJFrog Artifactory & Nexus

An attacker publishes a public package with the same name as your private one, hoping tools install it. Prevent it with scoped names, and by making the virtual repository look in your local repository first.

35.What is build info in JFrog?MidJFrog Artifactory & Nexus

A record of one build: the files it produced, the libraries it used, the environment and the Git commit. It lets you trace a file in production back to its source and promote a whole build.

36.How do you give permissions in Artifactory?MidJFrog Artifactory & Nexus

Put users in groups, then create permission targets that give a group actions such as read or deploy on chosen repositories. Use limited, expiring tokens for machines and turn off anonymous access.

37.What is promotion?MidJFrog Artifactory & Nexus

Copying or moving a tested artifact from a dev repository to a prod repository. The file is never rebuilt, so production gets exactly what was tested.

38.What are properties and AQL?MidJFrog Artifactory & Nexus

Properties are key and value labels on files, such as status=approved. AQL is a query language that finds files by repository, date, size and properties.

39.How does Nexus compare to Artifactory?MidJFrog Artifactory & Nexus

They do the same job. Nexus calls local, remote and virtual repositories hosted, proxy and group. Artifactory has stronger build info, promotion and replication features. Nexus has a free community edition.

40.Why does a Maven deploy of an existing release fail?MidJFrog Artifactory & Nexus

Release versions must never change, so users without overwrite permission get 403 Forbidden. Publish a new version number instead of overwriting.

41.How do you write the address of a Docker image in Artifactory?MidJFrog Artifactory & Nexus

With the repository path method it is HOST/REPOSITORY/IMAGE:TAG, for example repo.example.com/docker-dev-local/shop-api:1.4.2. Sub-domain and port methods also exist, but need extra DNS or ports.

42.Your merge request pipeline is missing some jobs. What is the most likely cause?MidGitLab CI/CD

Jobs without rules don't run in merge request pipelines (their old default only covers branches and tags). Add rules to them, for example rules: - when: on_success, or rules that match merge_request_event. Also check workflow: rules, which can filter out the whole pipeline.

43.How do you stop getting two pipelines (branch and merge request) for one push?MidGitLab CI/CD

Use workflow: rules. Run a pipeline for merge request events, skip branch pipelines when the branch has an open MR ($CI_OPEN_MERGE_REQUESTS), and keep branch pipelines otherwise. GitLab ships this as the Workflows/MergeRequest-Pipelines template.

44.What does needs do, and when would you use it?MidGitLab CI/CD

needs lets a job start as soon as the jobs it lists are done, instead of waiting for whole earlier stages. needs: [] starts a job right away. Use it to run tests and lint at the same time as the build, which can cut pipeline time a lot. Jobs only download artifacts from the jobs they need.

45.A job is stuck in pending. How do you debug it?MidGitLab CI/CD

Check: does any online runner have all of the job's tags? Is the job untagged while no runner takes untagged jobs? Is the only matching runner protected while this is a feature branch? Is the runner offline or paused (gitlab-runner status, Settings > CI/CD > Runners)? Or are all runners simply busy?