SmithRx software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
blocks of N integers representing the heights of blocks arranged in a row, numbered from 0 to N - 1. Two frogs start...Input: Arraycreate_vpc_config that takes the necessary parameters and returns a configuration dictionary representing the VPC setup.def create_vpc_config(vpc_name: str, cidr_block: str, public_subnet: str, private_subnet: str, security_group: List[str]) -> Dict[str, Any]:create_vpc_config( "HealthcareVPC", "10.0.0.0/16", "10.0.1.0/24", "10.0.2.0/24", ["allow_http", "allow_db"]) { "VpcName": "HealthcareVPC", "CIDRBlock": "10.0.0.0/16", "PublicSubnet": "10.0.1.0/24", "PrivateSubnet": "10.0.2.0/24", "SecurityGroupRules": ["allow_http", "allow_db"] } create_vpc_config( "PatientPortalVPC", "192.168.0.0/16", "192.168.1.0/24", "192.168.2.0/24", ["allow_https", "allow_ssh"]) { "VpcName": "PatientPortalVPC", "CIDRBlock": "192.168.0.0/16", "PublicSubnet": "192.168.1.0/24", "PrivateSubnet": "192.168.2.0/24", "SecurityGroupRules": ["allow_https", "allow_ssh"] } vpc_name is a string of up to 100 characters. cidr_block follows the CIDR notation rules. public_subnet and private_subnet must be within the range of cidr_block. security_group is a list of strings with a maximum length of 10 items.medications prescribed, write a function to determine the most frequently prescribed medication. If there are ties, return any of the most frequent medications.def most_frequent_medication(medications: List[str]) -> str:['DrugA', 'DrugB', 'DrugA', 'DrugC', 'DrugB', 'DrugA'] 'DrugA' DrugA appears 3 times, more than any other medication.['DrugX', 'DrugY', 'DrugZ', 'DrugY', 'DrugZ', 'DrugZ'] 'DrugZ' DrugZ appears 3 times, which is more than DrugY and DrugX.1 <= len(medications) <= 10000medications[i] is a string representing the name of a medication.def lowest_common_ancestor(root: Optional[TreeNode], p: TreeNode, q: TreeNode) -> Optional[TreeNode]:root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 1 3 root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 4 5 TreeNode values are in the range [0, 10^9].x available IP addresses means a CIDR block of x size in practice.def calculate_subnets(cidr: str) -> int: "10.0.0.0/16" 256 10.0.0.0/16 provides 2^(32-16) = 65536 IP addresses, which can be divided into 256 subnets of 256 IPs each."192.168.1.0/24" 1 192.168.1.0/24 provides 256 IP addresses which can only form 1 subnet./16.type (a string representing the type of component, e.g., 'subnet', 'route table'), id (a unique identifier), and status (a string representing the operational status, e.g., 'active', 'inactive'). Write a function that takes in this list of components and returns a summary of each component type showing the total count and the list of active IDs for that type.def analyze_vpc(components: List[Dict[str, Union[str, bool]]]) -> Dict[str, Dict[str, Union[int, List[str]]]]: is unique and contains alphanumeric characters.PrescriptionTracker that will manage patient prescriptions. Each patient can have multiple prescriptions, and each prescription contains details including the medicationName, dosage, refillDate, and a patientId. The class should support adding new prescriptions and retrieving a list of prescriptions for a given patient ID.def add_prescription(self, patient_id: str, medication_name: str, dosage: str, refill_date: str) -> None: def get_prescriptions(self, patient_id: str) -> List[Dict[str, str]]:patient_id, medication_name, and dosage are strings with a maximum length of 100 characters. refill_date is a string in YYYY-MM-DD format. Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free