---
# System prepended metadata

title: Practice Interview Session 1

---

# Practice Interview Session 1


Given an array of domains and subdomains, find the count of each domain split by a period `.`

Example: 

```python
counts = [
     "60,mail.yahoo.com",
     "10,mobile.sports.yahoo.com",
     "40,sports.yahoo.com",
     "300,yahoo.com"
]

# your_function(counts) returns ->

{
'com': 410, 
'mail.yahoo.com': 60, 
'yahoo.com': 410, 
'mobile.sports.yahoo.com': 10, 
'sports.yahoo.com': 50
}
```
Make sure to practice the **[UMPIRE method](https://hackmd.io/@zXKevDKYS9a3T9goj4clQA/S1CaDzIiV?type=view)**!

:::spoiler

1. **Understand**

Ask clarifying questions and use examples to understand what the interviewer wants out of this problem
Choose a “happy path” test input, different than the one provided, and a few edge case inputs. Verify that you and the interviewer are aligned on the expected inputs and outputs.

2. **Match**

See if this problem matches a problem category (e.g. Strings/Arrays) and strategies or patterns within the category

3. **Plan**

Sketch visualizations and write pseudocode
Walk through a high level implementation with an existing diagram

4. **Implement**

Implement the solution (make sure to know what level of detail the interviewer wants)

5. **Review**

Re-check that your algorithm solves the problem by running through important examples
Go through it as if you are debugging it, assuming there is a bug

6. **Evaluate**

Finish by giving space and run-time complexity
Discuss any pros and cons of the solution
:::


### Lets get to it!

Fork the repl on your own repl and create a multiplayer session with your teammate :)

<iframe height="800px" width="100%" src="https://repl.it/@membriux/codepath-practice-session1?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe>
