














































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This practice exam assesses knowledge of Cloud Foundry’s application lifecycle, buildpacks, deployment models, and cloud-native architecture principles. Candidates solve tasks involving application pushing, service binding, troubleshooting logs, scaling strategies, routing rules, and health-check configurations. It simulates real developer workflows including blue-green deployments, manifest optimization, and microservices design patterns. The exam challenges learners to optimize app performance, use the CF CLI efficiently, and diagnose common operational issues.
Typology: Exams
1 / 86
This page cannot be seen from the preview
Don't miss anything!















































































Question 1. Which component is responsible for staging an application’s source code into a droplet? A) Router B) Diego Cell C) Buildpack D) Loggregator Answer: C Explanation: Buildpacks detect the language/framework, compile the code, and produce a droplet that Diego Cells run. Question 2. When you want to use a custom buildpack stored in a Git repository, which cf push option should you specify? A) - b B) - p C) - s D) - i Answer: A Explanation: The -b flag lets you point to a custom buildpack URL or path. Question 3. How can you ensure an app uses Ruby 2.7.2 when the default buildpack provides 2.6.x? A) Set BUILDPACK_URL environment variable B) Add ruby_version: 2.7.2 to manifest.yml under buildpack C) Include a .ruby-version file in the app root D) Use cf set-buildpack command Answer: C
Explanation: The presence of a .ruby-version file tells the Ruby buildpack which version to install. Question 4. Which of the following statements about buildpack release notes is true? A) They are only relevant for system-provided buildpacks. B) Ignoring them can lead to runtime crashes after a platform upgrade. C) They affect only the stack, not the application. D) They are automatically applied to all apps without testing. Answer: B Explanation: Release notes may introduce breaking changes; skipping review can cause app instability. Question 5. What does the “stack” represent in Cloud Foundry terminology? A) The set of services bound to an app B) The operating system and base filesystem the app runs on C) The collection of routes mapped to an app D) The version of the CLI used to push the app Answer: B Explanation: A stack is the underlying OS image (e.g., cflinuxfs3) that Diego Cells use to run containers. Question 6. How can you change an existing app to use the “cflinuxfs4” stack? A) cf set-stack APP_NAME cflinuxfs4 B) cf push APP_NAME - s cflinuxfs4 C) Edit the manifest and run cf restage D) Both B and C are correct
D) cf services APP_NAME Answer: B Explanation: cf app shows instance statuses, including health indicators. Question 10. In a manifest file, how do you declare two applications to be pushed together? A) List them under a single applications: key with separate entries B) Create two separate manifest files and run cf push twice C) Use the multiple-apps flag in the manifest D) It is not possible; only one app per manifest is allowed Answer: A Explanation: The applications: array can contain multiple app definitions. Question 11. Which manifest property sets environment variables for an app? A) env B) variables C) settings D) config Answer: A Explanation: The env: section defines key/value pairs injected as environment variables. Question 12. How do you enable container‑to‑container (C2C) networking between two apps in the same space? A) Bind both apps to the same route B) Set allow_external_traffic to true in the manifest
C) Ensure the space’s “container networking” feature is enabled and the apps share the same internal domain D) Use cf map-route with the --c2c flag Answer: C Explanation: C2C networking is automatically available within a space when the feature is enabled. Question 13. Which CLI command creates an application security group that permits outbound traffic to any destination on port 443? A) cf create-security-group ASG_NAME json_file B) cf set-security-group ASG_NAME --protocol tcp --port 443 C) cf create-asg ASG_NAME --allow 0.0.0.0/0: D) cf create-security-group ASG_NAME - p 443 - d tcp Answer: A Explanation: You provide a JSON file defining the rules; cf create-security-group registers the ASG. Question 14. According to the Twelve‑Factor App methodology, where should configuration that varies between environments be stored? A) In the code repository as constants B) In environment variables C) In a shared database table D) In a config file checked into version control Answer: B Explanation: Factor III recommends storing config in env vars for portability and separation.
Answer: A Explanation: cf restart stops and starts the app but does not trigger the buildpack staging step. Question 18. When should you use cf restage instead of cf restart? A) After changing environment variables that affect buildpack behavior B) When you want to increase the number of instances C) To delete the app’s routes D) To change the app’s memory limit Answer: A Explanation: Restaging re‑runs the buildpack, necessary when build‑time configuration changes. Question 19. Which cf scale options adjust vertical resources? A) - i and - k B) - m and - k C) - m and - i D) - k only Answer: B Explanation: -m changes memory, -k changes disk quota – both vertical scaling. Question 20. What is the effect of scaling an app horizontally with cf scale - i 5? A) Increases each instance’s memory to 5 GB B) Deploys five new instances of the app C) Sets the instance count to 5, distributing load across them D) Limits the app to 5 concurrent requests Answer: C
Explanation: -i sets the number of instances; the platform schedules them across cells. Question 21. Which command shows detailed health and resource usage for a specific app instance? A) cf app APP_NAME --guid B) cf ssh APP_NAME - c "top" C) cf events APP_NAME D) cf app APP_NAME --instance INDEX Answer: D Explanation: Adding --instance displays info for that particular instance. Question 22. How do you run a one‑off database migration task for an app called “myapp”? A) cf run-task myapp "rake db:migrate" --name migrate B) cf exec-task myapp "rake db:migrate" C) cf task-run myapp "rake db:migrate" D) cf ssh myapp - c "rake db:migrate" Answer: A Explanation: cf run-task schedules a task; --name gives it an identifier. Question 23. Which CLI command is used to install the Cloud Foundry CLI on a Linux system? A) apt-get install cf-cli B) curl - L "https://packages.cloudfoundry.org/stable?release=linux64-binary&source=github" | tar - zx C) brew install cf-cli D) cf install-cli
D) Space is a synonym for Org Answer: B Explanation: An Org groups related resources; Spaces isolate teams or stages within an Org. Question 27. How can you switch your CLI session to the “dev” space within the “myorg” organization? A) cf set-space dev --org myorg B) cf target - o myorg - s dev C) cf login - o myorg - s dev D) Both B and C are valid Answer: D Explanation: Both cf target and cf login accept -o and -s flags to set Org and Space. Question 28. Which environment variable contains the JSON representation of bound service credentials? A) VCAP_APPLICATION B) VCAP_SERVICES C) CF_SERVICES D) SERVICE_BINDINGS Answer: B Explanation: VCAP_SERVICES holds service instance details injected by the platform. Question 29. After adding a new environment variable to an app, which action is required for the app to see it? A) cf push – f manifest.yml B) cf restart APP_NAME
C) cf restage APP_NAME D) Either B or C, depending on whether the variable affects buildpacks Answer: D Explanation: If the variable influences buildpack behavior, restage is needed; otherwise, restart suffices. Question 30. Which command provides help documentation for a specific cf subcommand, such as push? A) cf help push B) cf push --help C) cf docs push D) Both A and B are correct Answer: D Explanation: Both cf help push and cf push --help display usage information. Question 31. How can you directly query the Cloud Controller API to list all organizations? A) cf orgs --api B) cf curl /v3/organizations C) cf get /organizations D) cf api /v3/organizations Answer: B Explanation: cf curl forwards the HTTP request to the Cloud Controller. Question 32. Which component aggregates logs and metrics from all app instances? A) Router
B) Space Developer C) Space Auditor D) Org Auditor Answer: A Explanation: Org Managers have permissions to manage spaces, users, and org‑level resources. Question 36. A user with the “Space Developer” role can: A) View service instances but not bind them B) Create, bind, and unbind services to apps in that space C) Delete the space itself D) Modify organization quotas Answer: B Explanation: Space Developers have full app and service management rights within their space. Question 37. Which CLI command creates an application security group named “asg‑outbound” using a JSON definition file? A) cf create-asg asg-outbound asg.json B) cf create-security-group asg-outbound asg.json C) cf asg-create asg-outbound asg.json D) cf security-group-create asg-outbound asg.json Answer: B Explanation: cf create-security-group registers the ASG with the provided JSON rules. Question 38. How do you bind an existing ASG to a specific space? A) cf bind-security-group ASG_NAME SPACE_NAME ORG_NAME
B) cf set-security-group ASG_NAME --space SPACE_NAME C) cf bind-asg ASG_NAME SPACE_NAME ORG_NAME D) cf bind-security-group ASG_NAME ORG_NAME SPACE_NAME Answer: A Explanation: The command order is cf bind-security-group <ASG> <SPACE> <ORG>. Question 39. Which command creates a new route for the domain “example.com” and maps it to app “myapp”? A) cf create-route myorg dev example.com --hostname myapp B) cf map-route myapp example.com --hostname myapp C) cf add-route myapp example.com --host myapp D) cf route-create myapp example.com --host myapp Answer: B Explanation: cf map-route attaches an existing or new route to the app. Question 40. What happens when you attempt to map a route that already exists and is bound to another app in the same space? A) The command fails with a “route conflict” error B) The route is automatically shared between both apps (route sharing) C) The existing binding is overwritten silently D) Cloud Foundry creates a duplicate route with a numeric suffix Answer: A Explanation: Route conflicts arise when a route is already bound; you must unmap or use a unique hostname. Question 41. To delete a route that is no longer needed, which command is appropriate?
Question 44. Which command lists all TCP routes currently defined in the platform? A) cf tcp-routes B) cf router-tcp-routes C) cf routes --protocol tcp D) cf curl /v3/tcp_routes Answer: D Explanation: TCP routes are exposed via the Cloud Controller API; cf curl can retrieve them. Question 45. What is the primary advantage of TCP routing over HTTP routing? A) Automatic SSL termination B) Ability to forward raw TCP traffic for non‑HTTP services (e.g., databases) C) Built‑in load balancing for WebSockets D) Simpler route configuration Answer: B Explanation: TCP routing enables non‑HTTP protocols to be exposed through the Gorouter. Question 46. Which command displays the services available in the marketplace? A) cf services --all B) cf marketplace C) cf list-services D) cf service‑list Answer: B Explanation: cf marketplace shows service offerings and plans.
Question 47. When you create a managed service instance, where are its credentials stored for the bound app? A) In the app’s environment variable VCAP_SERVICES B) In a file on the Diego Cell C) In the Cloud Controller database only D) In the user’s local .cf directory Answer: A Explanation: The platform injects service credentials into VCAP_SERVICES. Question 48. What is the difference between a Service Binding and a Service Key? A) Bindings are for apps; keys are for external tools or scripts B) Bindings provide read‑only credentials, keys provide full access C) Service Keys are deprecated and replaced by bindings D) There is no functional difference; they are aliases Answer: A Explanation: Bindings associate credentials with an app; Service Keys generate credentials that can be used outside the platform. Question 49. Which command generates a service key named “readonly‑key” for a service instance “mydb”? A) cf create-service-key mydb readonly-key B) cf service-key-create mydb readonly-key C) cf create-key mydb readonly-key D) cf service-key mydb readonly-key --create Answer: A Explanation: cf create-service-key creates a non‑binding credential set.
Explanation: Space‑scoped brokers are registered at the space level, isolating service offerings. Question 53. Which command opens an interactive SSH session into a running app container named “myapp”? A) cf ssh myapp B) cf console myapp C) cf access myapp --ssh D) cf connect myapp Answer: A Explanation: cf ssh provides a secure shell into the container. Question 54. What security consideration should you keep in mind when using cf ssh? A) SSH keys are stored in plain text on the Diego Cell B) All SSH sessions are logged and can be audited via the Loggregator C) SSH disables the app’s health checks while connected D) SSH bypasses the platform’s outbound security groups Answer: B Explanation: SSH activity is emitted to the log stream, allowing audit and compliance. Question 55. An app fails to connect to a bound PostgreSQL service, timing out. Which step is most likely missing? A) Adding the service’s hostname to /etc/hosts inside the container B) Binding the service to the app C) Restarting the app after binding D) Enabling outbound traffic to the service’s IP via an Application Security Group
Answer: D Explanation: By default, outbound traffic may be restricted; an ASG must allow the service’s address. Question 56. When diagnosing a route collision error during cf push, which command can help you see existing routes in the space? A) cf routes B) cf apps --routes C) cf curl /v3/routes D) Both A and C are useful Answer: D Explanation: cf routes lists routes; the API call via cf curl provides detailed JSON. Question 57. An application repeatedly crashes with “Out of memory” messages in the logs. Which immediate action can reduce memory usage? A) Increase the app’s instance count B) Reduce the memory limit using cf scale - m 256M C) Add more disk quota with -k D) Restart the app to clear caches Answer: B Explanation: Lowering the memory limit forces the app to use less heap; however, the typical fix is to increase memory, but the question asks for immediate reduction, so B is correct. Question 58. How can you enable detailed API request tracing for a cf push operation? A) Set environment variable CF_TRACE=true before running the command B) Use the flag --trace with cf push