Welcome to the Interview Questions Project repository! This project aims to be a comprehensive resource for technical interviews.
IMPORTANT> The tools you'll use in these exercises have a -h or --help command you can leverage if you are unsure how to proceed.
- kubernetes cluster (k3d,minikube,etc..)
- container runtime (docker,containerd,podman)
- helm
- git
- python
API KEY: 3b93dbe006af066f0a0db26c13d3a15c
API DOCS:
- Setup a new python virtual enviroment and activate it
- Within the virtual environment, install the package requirements file
python/requirements - Set up an environment variable
OW_APIwith the API KEY above as the value - Execute the
python/weather.pyscript and resolve any errors- Errors are printed to stdout as stack traces
- The script produces a blank output when there are no errors
- You may use print statements for debugging and/or refer to the API docs
- Add a new, optional command line argument
--unitsto the script for unit of measurement- View the api docs for units
- Use the same default specified in the API docs
- Add the new argument as a parse arg after the existing two (e.g.
--zip,--country)
- Update endpoint url located in the
get_daily_weatherfunction to include units using the parse arg created in the previous step - Create a new function
get_weather_stringthat returns a string containing the following data fields:temp,temp_min,temp_max,wind speed, andweather description- This function should leverage the response in
get_daily_weather - View the API docs for the response JSON
- Only include the first weather description
- You may modify
get_daily_weatherif necessary
- This function should leverage the response in
- Call the new function and print out the result
- View the Dockerfile in
images/nginx-http - Create a file
hello.txtwith the contents "Hello World!" - Place the new file within the
/nginx/filesdirectory - Build the Dockerfile and tag image as
nginx:nightcrawler - Run docker image exposing port 8080
- Access http server on localhost and view your
hello.txtfile
Service Docs: https://kubernetes.io/docs/concepts/services-networking/service/
- Resolve issues with helm chart, there are multiple problems to fix
- Add a NodePort service manifest to helm chart that will expose the nginx deployment
- Name the service the same name as the deployment
- Deploy the helm chart and curl the service
- Create pod with name nginx in the namespace
interviewusing imagenginx:latest - Check the logs of the pod
Init Container Docs: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
- Create a deployment manifest with the name httpd use the container
httpd:latest - Add an init container to the manifest that uses the
busyboximage toecho hello world
- Create a branch
- Commit changes to branch
- Run
git logto check the commit history