π₯ backlog
Module-Decomposition π
01 Read about technical interviews π Clone
01 Read about technical interviews π
Coursework content
Read https://sdc.codeyourfuture.io/guides/employability/interview/technical-interview-prep/
Estimated time in hours
1
What is the purpose of this assignment?
When applying for software jobs, you will probably need to do technical interviews. You need to prepare for these, and we will have a workshop in class practicing them.
- π Priority Mandatory
- π Size Small
- π Sprint 4
- π Priority Key
- π Priority Key
- π Sprint 4
- π Size Small
- π Priority Mandatory
02 Prepare for technical interview π Clone
02 Prepare for technical interview π
Estimated time in hours
3
What is the purpose of this assignment?
When applying for software jobs, you will probably need to do technical interviews. This will help you to prepare.
Coursework content
To prepare for this, we will be doing a technical interview workshop in class. You will be interviewing someone, and they will be interviewing you.
To prepare you need to:
- Read the workshop in the day plan.
- Work out who your partner will be. The whole class should get randomly paired up. If there’s an odd number, have a volunteer pair up with someone.
- Find out from your partner if they have already solved any of the exercises. From the exercises they have not solved, you should pick one (and don’t tell them what it is).
- Follow the “Preparing to interview someone” instructions in the workshop.
You must do this before class.
- π Priority Mandatory
- π Size Medium
- π Sprint 4
- π Priority Key
- π Priority Key
- π Sprint 4
- π Size Medium
- π Priority Mandatory
03 Prep Exercises π Clone
03 Prep Exercises π
Link to the coursework
https://sdc.codeyourfuture.io/decomposition/sprints/4/prep/
Why are we doing this?
Read the prep and do all of the exercises in it.
Maximum time in hours
5
How to submit
Submit a pull request to this repo from your fork, containing a single Python file per exercise.
- π Priority Mandatory
- π Sprint 4
- π¦ Size Large
- π¦ Size Large
- π Sprint 4
- π Priority Mandatory
04 Implement laptop allocation π Clone
04 Implement laptop allocation π
In the prep, there was an exercise around finding possible laptops for a group of people.
Your exercise is to extend this to actually allocate laptops to the people.
Given these class definitions:
from dataclasses import dataclass
from enum import Enum
from typing import List
class OperatingSystem(Enum):
MACOS = "macOS"
ARCH = "Arch Linux"
UBUNTU = "Ubuntu"
@dataclass(frozen=True)
class Person:
name: str
age: int
# Sorted in order of preference, most preferred is first.
preferred_operating_system: List[OperatingSystem]
@dataclass(frozen=True)
class Laptop:
id: int
manufacturer: str
model: str
screen_size_in_inches: float
operating_system: OperatingSystem
Write a function with this signature:
def allocate_laptops(people: List[Person], laptops: List[Laptop]) -> Dict[Person, Laptop]:
Every person should be allocated exactly one laptop.
If we define “sadness” as the number of places down in someone’s ranking the operating system the ended up with (i.e. if your preferences were [UBUNTU, ARCH, MACOS]
and you were allocated a MACOS machine your sadness would be 2), we want to minimise the total sadness of all people. If we allocate someone a laptop with an operating system not in their preferred list, treat them as having a sadness of 100.
Maximum time in hours
3
How to submit
Submit a PR to this repo containing your function (and any supporting code).
- π Priority Mandatory
- π Size Medium
- π Sprint 4
- π Sprint 4
- π Size Medium
- π Priority Mandatory