Applied via referral.
Phone Screen:
You are given the periodic table and a word. Need to return the number of ways we can form that word using elements from the periodic table:
ex. Physics can be made in the following ways: P - H - Y - Si - C - S, P - H - Y - Si - Cs, P - H - Y - S - I - C - S, P - H - Y - S - I - Cs
Cleared it.
Loop:
Round 1 (DSA):
We are given n chess players numbered from 0 to n - 1. We are also given a list of pairs gameResults (where pair (u,v) represents u won against v). It is guaranteed that the lower ranked player will always win. Based on this information, calculate the number of players we can determine the rank of. And then get the rank of those players.
Round 2 (DSA):
You are given:
A string/array of notes to be played on a piano, where each note is represented by its position (integer) on the piano keyboard
A maximum hand span k - the maximum number of keys your hand can cover at once (or the maximum distance between the leftmost and rightmost keys you can press simultaneously)
Your hand can cover multiple keys within the span k without lifting. However, if you need to play a note that's outside your current hand position's range, you must lift your hand and reposition it.
Task: Find the minimum number of times you need to lift your hand to play all the notes in sequence.
Example:
Input: notes = [1, 3, 5, 7, 9, 11], k = 4
Output: 2
Explanation:
Position 1: Cover keys 1-5 (span=4), play notes 1, 3, 5
Lift 1: Move to cover keys 7-11, play note 7
Lift 2: Play notes 9, 11