REVISION AND PRACTICE

Practice questions with answers

6 min read

Try each question before reading the answer.

Q1. Which environment is described as “an exact replica of production, running on a remote machine”? Answer: The staging (pre-production) environment.

Q2. Give the three reasons the lecture offers for using a staging environment. Answer: (1) Deployment involves many activities and configurations, and doing it directly in production could crash the live system and affect users. (2) To preview new features to management, sales/marketing or clients. (3) To do performance and stress testing without affecting real users.

Q3. In the testing environment, what happens when a test fails? Answer: The defective code is removed, the failing module and its developer are identified and the developer is notified, the code is rolled back to the previous working version, and the developer fixes the bug in their working copy and recommits it for the next scheduled deployment.

Q4. What is the main advantage of blue/green deployment? Answer: Easy rollback. If the new (green) environment has problems, the router sends users back to the old (blue) environment, which still works.

Q5. What are the other names for canary deployment, and what is its drawback? Answer: Phased rollout or incremental rollout. Drawback: you must manage multiple instances (old and new versions) at once.

Q6. Name three ways of selecting users for a canary rollout. Answer: Randomly; based on user profile or demographics; based on region.

Q7. A mobile app keeps old versions running and lets users decide whether to update. Which strategy is this, and what is its drawback? Answer: Versioned deployment. Drawback: the company has to maintain multiple versions.

Q8. An IaaS provider has a server with an 8-core CPU and 32 GB RAM and slices it into 8 VMs. What does each VM get? Answer: 1 core and 4 GB of memory.

Q9. Match each option with its advantage: Bare metal, IaaS, PaaS. Answer: Bare metal → highest performance; IaaS → cheaper, no maintenance; PaaS → very easy to deploy.

Q10. What is the main disadvantage of PaaS? Answer: Lack of control over the underlying OS, hardware and configuration.

Q11. Classify each provider as IaaS or PaaS: DigitalOcean, Heroku, AWS (EC2), Google App Engine, Linode. Answer: IaaS: DigitalOcean, AWS, Linode. PaaS: Heroku, Google App Engine.

Q12. What is a “Droplet”? Answer: DigitalOcean’s name for a virtual machine.

Q13. Which two files must be prepared before deploying a Flask app to Heroku, and what does each do? Answer: requirements.txt lists the required packages and versions, which Heroku installs. The Procfile tells Heroku how to run the app (e.g. web: gunicorn app:app).

Q14. What is Gunicorn? Answer: A WSGI (Web Server Gateway Interface) server that Heroku uses to run Python web applications.

Q15. In the Heroku tutorial, which command uploads the code and triggers deployment? Answer: git push heroku master. Heroku is set up as a git remote.

Q16. List the seven best practices of continuous integration. Answer: (1) Maintain a single source repository; (2) automate the build; (3) make the build self-testing; (4) commit to the main branch every day; (5) every commit should build the main branch on an integration server; (6) fix broken builds immediately; (7) automate deployment.

Q17. Why should developers commit every day? Answer: Infrequent commits increase the chance of conflict errors. Frequent commits encourage breaking work into small chunks, keep conflicts small, and avoid a last-minute rush before releases.

Q18. How is a broken build fixed immediately? Answer: Take the system back to the last-known good build, then fix the bug.

Q19. Name two CI servers and two build tools from the lecture. Answer: CI servers: Jenkins, CruiseControl. Build tools: Ant, Gradle (Java) and “Builder” (Node.js).

Q20. State one drawback of continuous integration. Answer: The initial effort to set up processes and the integration server, and to train people.

Q21. Name the three levels at which caching can happen. Answer: Web browser cache, web server page cache, database query cache.

Q22. Why is an asynchronous task queue used for sending emails to thousands of users? Answer: Doing it inside the normal request–response cycle would make the user wait far too long and does not scale. The job is put in a queue and a pool of workers processes it in the background, outside the HTTP request–response cycle. More workers can be added when traffic is high.

Q23. What two things does an asynchronous work queue consist of? Answer: A queue of jobs (with their parameters) and a pool of workers.

Q24. What does minification do, and how is it different from compression? Answer: Minification removes spaces, tabs, extra whitespace and comments (and can shorten names) from the code itself without changing behaviour. Compression (Gzip, Brotli) encodes the files into fewer bytes for transfer, and the browser decompresses them.

Q25. According to the lecture, what happened when Google slowed search results by half a second in 2006? Answer: User requests dropped by 25%.

Q26. List four things to monitor in a live application. Answer: CPU utilisation, memory utilisation, storage (consumed vs free), and network bandwidth and latency.

Q27. What is latency? Answer: The time it takes for a user to get a response.

Q28. What does Lighthouse report on? Answer: It analyses page resources, suggests optimisations, checks SEO and accessibility, and calculates a performance score.

Q29. Define clickstream, dwell time and abandonment. Answer: Clickstream: the sequences of pages users visit, and which are most common. Dwell (think) time: how long a typical user stays on a given page. Abandonment: the percentage of users who leave a flow (e.g. a purchase) instead of completing it.

Q30. How does an analytics tool such as Google Analytics collect data? Answer: A small JavaScript snippet containing a tracking code is embedded in every page. It sends information to the analytics tool each time a page loads.

Q31. How does the lecture suggest running an A/B test, and what counts as “better”? Answer: Use a canary (phased/incremental) rollout so some users get version A and others version B, then monitor both. “Better” can mean more traffic, more dwell time, more sales or less abandonment.

YOUR STUDY PROGRESS

Finished this section? Save your progress.

Back to top ↑