What will be the output?
nums = {1, 2, 2, 3} print(nums)
nums = {1, 2, 2, 3} print(nums)
Anonymous Quiz
43%
A) {1, 2, 2, 3}
38%
B) {1, 2, 3}
13%
C) Error
5%
D) [1, 2, 3]
๐ค5โค2
Amazon Interview Process for Data Scientist position
๐Round 1- Phone Screen round
This was a preliminary round to check my capability, projects to coding, Stats, ML, etc.
After clearing this round the technical Interview rounds started. There were 5-6 rounds (Multiple rounds in one day).
๐ ๐ฅ๐ผ๐๐ป๐ฑ ๐ฎ- ๐๐ฎ๐๐ฎ ๐ฆ๐ฐ๐ถ๐ฒ๐ป๐ฐ๐ฒ ๐๐ฟ๐ฒ๐ฎ๐ฑ๐๐ต:
In this round the interviewer tested my knowledge on different kinds of topics.
๐๐ฅ๐ผ๐๐ป๐ฑ ๐ฏ- ๐๐ฒ๐ฝ๐๐ต ๐ฅ๐ผ๐๐ป๐ฑ:
In this round the interviewers grilled deeper into 1-2 topics. I was asked questions around:
Standard ML tech, Linear Equation, Techniques, etc.
๐๐ฅ๐ผ๐๐ป๐ฑ ๐ฐ- ๐๐ผ๐ฑ๐ถ๐ป๐ด ๐ฅ๐ผ๐๐ป๐ฑ-
This was a Python coding round, which I cleared successfully.
๐๐ฅ๐ผ๐๐ป๐ฑ ๐ฑ- This was ๐๐ถ๐ฟ๐ถ๐ป๐ด ๐ ๐ฎ๐ป๐ฎ๐ด๐ฒ๐ฟ where my fitment for the team got assessed.
๐๐๐ฎ๐๐ ๐ฅ๐ผ๐๐ป๐ฑ- ๐๐ฎ๐ฟ ๐ฅ๐ฎ๐ถ๐๐ฒ๐ฟ- Very important round, I was asked heavily around Leadership principles & Employee dignity questions.
So, here are my Tips if youโre targeting any Data Science role:
-> Never make up stuff & donโt lie in your Resume.
-> Projects thoroughly study.
-> Practice SQL, DSA, Coding problem on Leetcode/Hackerank.
-> Download data from Kaggle & build EDA (Data manipulation questions are asked)
Best Data Science & Machine Learning Resources: https://topmate.io/coding/914624
ENJOY LEARNING ๐๐
๐Round 1- Phone Screen round
This was a preliminary round to check my capability, projects to coding, Stats, ML, etc.
After clearing this round the technical Interview rounds started. There were 5-6 rounds (Multiple rounds in one day).
๐ ๐ฅ๐ผ๐๐ป๐ฑ ๐ฎ- ๐๐ฎ๐๐ฎ ๐ฆ๐ฐ๐ถ๐ฒ๐ป๐ฐ๐ฒ ๐๐ฟ๐ฒ๐ฎ๐ฑ๐๐ต:
In this round the interviewer tested my knowledge on different kinds of topics.
๐๐ฅ๐ผ๐๐ป๐ฑ ๐ฏ- ๐๐ฒ๐ฝ๐๐ต ๐ฅ๐ผ๐๐ป๐ฑ:
In this round the interviewers grilled deeper into 1-2 topics. I was asked questions around:
Standard ML tech, Linear Equation, Techniques, etc.
๐๐ฅ๐ผ๐๐ป๐ฑ ๐ฐ- ๐๐ผ๐ฑ๐ถ๐ป๐ด ๐ฅ๐ผ๐๐ป๐ฑ-
This was a Python coding round, which I cleared successfully.
๐๐ฅ๐ผ๐๐ป๐ฑ ๐ฑ- This was ๐๐ถ๐ฟ๐ถ๐ป๐ด ๐ ๐ฎ๐ป๐ฎ๐ด๐ฒ๐ฟ where my fitment for the team got assessed.
๐๐๐ฎ๐๐ ๐ฅ๐ผ๐๐ป๐ฑ- ๐๐ฎ๐ฟ ๐ฅ๐ฎ๐ถ๐๐ฒ๐ฟ- Very important round, I was asked heavily around Leadership principles & Employee dignity questions.
So, here are my Tips if youโre targeting any Data Science role:
-> Never make up stuff & donโt lie in your Resume.
-> Projects thoroughly study.
-> Practice SQL, DSA, Coding problem on Leetcode/Hackerank.
-> Download data from Kaggle & build EDA (Data manipulation questions are asked)
Best Data Science & Machine Learning Resources: https://topmate.io/coding/914624
ENJOY LEARNING ๐๐
โค7
โ
Python Loops (for & while)
Loops help repeat tasks automatically โ very important for data processing and automation.
๐น 1. What are Loops?
Loops repeat a block of code multiple times.
๐ Used in:
โ Data cleaning
โ Data analysis
โ Machine learning
โ Automation
๐ฅ 2. for Loop (Most Used) โญ
Used to iterate over a sequence (list, string, range).
โ Basic Syntax
๐ range(5) โ generates numbers from 0 to 4.
โ Loop Through List (Very Important)
๐ฅ 3. while Loop
Runs until condition becomes False.
โ Syntax
๐ Important: Update condition to avoid infinite loop.
๐น 4. Loop Control Statements (Very Important)
โ break โ stop loop
โ continue โ skip current iteration
๐ฏ Todayโs Goal
โ Use for loop
โ Use while loop
โ Understand break & continue
Double Tap โฅ๏ธ For More
Loops help repeat tasks automatically โ very important for data processing and automation.
๐น 1. What are Loops?
Loops repeat a block of code multiple times.
๐ Used in:
โ Data cleaning
โ Data analysis
โ Machine learning
โ Automation
๐ฅ 2. for Loop (Most Used) โญ
Used to iterate over a sequence (list, string, range).
โ Basic Syntax
for variable in sequence:โ Example โ Print Numbers
# code
for i in range(5):Output: 0 1 2 3 4
print(i)
๐ range(5) โ generates numbers from 0 to 4.
โ Loop Through List (Very Important)
numbers = [10, 20, 30]๐ Used heavily in data science.
for num in numbers:
print(num)
๐ฅ 3. while Loop
Runs until condition becomes False.
โ Syntax
while condition:โ Example
# code
x = 1Output: 1 2 3 4 5
while x <= 5:
print(x)
x += 1
๐ Important: Update condition to avoid infinite loop.
๐น 4. Loop Control Statements (Very Important)
โ break โ stop loop
for i in range(5):Output: 0 1 2
if i == 3:
break
print(i)
โ continue โ skip current iteration
for i in range(5):Output: 0 1 2 4
if i == 3:
continue
print(i)
๐ฏ Todayโs Goal
โ Use for loop
โ Use while loop
โ Understand break & continue
Double Tap โฅ๏ธ For More
โค16๐1
Which loop is mostly used to iterate over a list or sequence in Python?
Anonymous Quiz
18%
A) while loop
14%
B) do-while loop
66%
C) for loop
2%
D) repeat loop
โค3
Which statement stops a loop immediately?
Anonymous Quiz
4%
A) stop
9%
B) exit
86%
C) break
1%
D) continue
โค2
What does continue do in a loop?
Anonymous Quiz
6%
A) Stops the loop completely
78%
B) Skips current iteration
15%
C) Restarts program
1%
D) Ends program
โค5
What happens if we donโt update the condition inside a while loop?
Anonymous Quiz
10%
A) Syntax error
18%
B) Program stops automatically
68%
C) Infinite loop
5%
D) Nothing happens
โค2
Which function generates a sequence of numbers for looping?
Anonymous Quiz
19%
A) loop()
55%
B) range()
11%
C) generate()
14%
D) sequence()
โค2
โ
Python Functions ๐โ๏ธ
Functions are very important in data science. They help you write reusable, clean, and modular code.
๐น 1. What is a Function?
A function is a block of code that performs a specific task.
๐ Instead of writing the same code again and again, we create a function.
๐ฅ 2. Creating a Function
โ Basic Syntax
โ Example
Output: Hello Deepak
๐น 3. Function with Parameters
Parameters allow input to functions.
# Output: Hello Rahul
๐น 4. Function with Return Value (Very Important โญ)
Instead of printing, functions can return values.
# Output: 8
๐ return sends value back.
๐น 5. Default Parameters
๐น 6. Why Functions Matter in Data Science?
โ Data cleaning functions
โ Feature engineering functions
โ Reusable ML pipelines
โ Code organization
๐ฏ Todayโs Goal
โ Understand def
โ Use parameters
โ Use return
โ Call functions properly
Double Tap โฅ๏ธ For More
Functions are very important in data science. They help you write reusable, clean, and modular code.
๐น 1. What is a Function?
A function is a block of code that performs a specific task.
๐ Instead of writing the same code again and again, we create a function.
๐ฅ 2. Creating a Function
โ Basic Syntax
def function_name():
# code
โ Example
def greet():
print("Hello Deepak")
greet()
Output: Hello Deepak
๐น 3. Function with Parameters
Parameters allow input to functions.
def greet(name):
print("Hello", name)
greet("Rahul")
# Output: Hello Rahul
๐น 4. Function with Return Value (Very Important โญ)
Instead of printing, functions can return values.
def add(a, b):
return a + b
result = add(5, 3)
print(result)
# Output: 8
๐ return sends value back.
๐น 5. Default Parameters
def greet(name="Guest"):
print("Hello", name)
greet()
greet("Amit")
๐น 6. Why Functions Matter in Data Science?
โ Data cleaning functions
โ Feature engineering functions
โ Reusable ML pipelines
โ Code organization
๐ฏ Todayโs Goal
โ Understand def
โ Use parameters
โ Use return
โ Call functions properly
Double Tap โฅ๏ธ For More
โค25๐1
๐ Machine Learning Cheat Sheet ๐
1. Key Concepts:
- Supervised Learning: Learn from labeled data (e.g., classification, regression).
- Unsupervised Learning: Discover patterns in unlabeled data (e.g., clustering, dimensionality reduction).
- Reinforcement Learning: Learn by interacting with an environment to maximize reward.
2. Common Algorithms:
- Linear Regression: Predict continuous values.
- Logistic Regression: Binary classification.
- Decision Trees: Simple, interpretable model for classification and regression.
- Random Forests: Ensemble method for improved accuracy.
- Support Vector Machines: Effective for high-dimensional spaces.
- K-Nearest Neighbors: Instance-based learning for classification/regression.
- K-Means: Clustering algorithm.
- Principal Component Analysis(PCA)
3. Performance Metrics:
- Classification: Accuracy, Precision, Recall, F1-Score, ROC-AUC.
- Regression: Mean Absolute Error (MAE), Mean Squared Error (MSE), R^2 Score.
4. Data Preprocessing:
- Normalization: Scale features to a standard range.
- Standardization: Transform features to have zero mean and unit variance.
- Imputation: Handle missing data.
- Encoding: Convert categorical data into numerical format.
5. Model Evaluation:
- Cross-Validation: Ensure model generalization.
- Train-Test Split: Divide data to evaluate model performance.
6. Libraries:
- Python: Scikit-Learn, TensorFlow, Keras, PyTorch, Pandas, Numpy, Matplotlib.
- R: caret, randomForest, e1071, ggplot2.
7. Tips for Success:
- Feature Engineering: Enhance data quality and relevance.
- Hyperparameter Tuning: Optimize model parameters (Grid Search, Random Search).
- Model Interpretability: Use tools like SHAP and LIME.
- Continuous Learning: Stay updated with the latest research and trends.
๐ Dive into Machine Learning and transform data into insights! ๐
Best Data Science & Machine Learning Resources: https://topmate.io/coding/914624
All the best ๐๐
1. Key Concepts:
- Supervised Learning: Learn from labeled data (e.g., classification, regression).
- Unsupervised Learning: Discover patterns in unlabeled data (e.g., clustering, dimensionality reduction).
- Reinforcement Learning: Learn by interacting with an environment to maximize reward.
2. Common Algorithms:
- Linear Regression: Predict continuous values.
- Logistic Regression: Binary classification.
- Decision Trees: Simple, interpretable model for classification and regression.
- Random Forests: Ensemble method for improved accuracy.
- Support Vector Machines: Effective for high-dimensional spaces.
- K-Nearest Neighbors: Instance-based learning for classification/regression.
- K-Means: Clustering algorithm.
- Principal Component Analysis(PCA)
3. Performance Metrics:
- Classification: Accuracy, Precision, Recall, F1-Score, ROC-AUC.
- Regression: Mean Absolute Error (MAE), Mean Squared Error (MSE), R^2 Score.
4. Data Preprocessing:
- Normalization: Scale features to a standard range.
- Standardization: Transform features to have zero mean and unit variance.
- Imputation: Handle missing data.
- Encoding: Convert categorical data into numerical format.
5. Model Evaluation:
- Cross-Validation: Ensure model generalization.
- Train-Test Split: Divide data to evaluate model performance.
6. Libraries:
- Python: Scikit-Learn, TensorFlow, Keras, PyTorch, Pandas, Numpy, Matplotlib.
- R: caret, randomForest, e1071, ggplot2.
7. Tips for Success:
- Feature Engineering: Enhance data quality and relevance.
- Hyperparameter Tuning: Optimize model parameters (Grid Search, Random Search).
- Model Interpretability: Use tools like SHAP and LIME.
- Continuous Learning: Stay updated with the latest research and trends.
๐ Dive into Machine Learning and transform data into insights! ๐
Best Data Science & Machine Learning Resources: https://topmate.io/coding/914624
All the best ๐๐
โค8
โ
Conditional Statements (ifโelse) ๐โก
Conditional statements allow programs to make decisions based on conditions.
๐ Used heavily in:
โ Data filtering
โ Business rules
โ Machine learning logic
๐น 1. if Statement
Used to execute code when a condition is True.
โ Syntax
Example
# Output: You can vote
๐น 2. ifโelse Statement
Used when there are two possible outcomes.
Syntax
Example
๐น 3. ifโelifโelse Statement
Used when there are multiple conditions.
Syntax
Example
๐น 4. Nested if Statement
An if statement inside another if.
๐น 5. Short if (Ternary Operator)
๐ฏ Todayโs Goal
โ Understand if
โ Use ifโelse
โ Use elif for multiple conditions
โ Learn nested conditions
๐ Conditional logic is used in data filtering and decision models.
Double Tap โฅ๏ธ For More
Conditional statements allow programs to make decisions based on conditions.
๐ Used heavily in:
โ Data filtering
โ Business rules
โ Machine learning logic
๐น 1. if Statement
Used to execute code when a condition is True.
โ Syntax
if condition:
# code
Example
age = 20
if age >= 18:
print("You can vote")
# Output: You can vote
๐น 2. ifโelse Statement
Used when there are two possible outcomes.
Syntax
if condition:
# code if true
else:
# code if false
Example
age = 16
if age >= 18:
print("Eligible to vote")
else:
print("Not eligible")
๐น 3. ifโelifโelse Statement
Used when there are multiple conditions.
Syntax
if condition1:
# code
elif condition2:
# code
else:
# code
Example
marks = 75
if marks >= 90:
print("Grade A")
elif marks >= 60:
print("Grade B")
else:
print("Grade C")
๐น 4. Nested if Statement
An if statement inside another if.
age = 20
citizen = True
if age >= 18:
if citizen:
print("Eligible to vote")
๐น 5. Short if (Ternary Operator)
age = 20
print("Adult") if age >= 18 else print("Minor")
๐ฏ Todayโs Goal
โ Understand if
โ Use ifโelse
โ Use elif for multiple conditions
โ Learn nested conditions
๐ Conditional logic is used in data filtering and decision models.
Double Tap โฅ๏ธ For More
โค16๐1
Which keyword is used to check a condition in Python?
Anonymous Quiz
9%
A) check
82%
B) if
4%
C) when
4%
D) condition
โค3
What will be the output?
x = 10 if x > 5: print("Yes") else: print("No")
x = 10 if x > 5: print("Yes") else: print("No")
Anonymous Quiz
89%
Yes
11%
No
โค3
Which keyword is used to check multiple conditions?
Anonymous Quiz
13%
A) elseif
60%
B) elif
23%
C) else if
4%
D) multiple
โค3
๐น Q4. What will be the output?
x = 7 if x > 10: print("A") elif x > 5: print("B") else: print("C")
x = 7 if x > 10: print("A") elif x > 5: print("B") else: print("C")
Anonymous Quiz
13%
A
75%
B
10%
C
2%
D
โค2
What will be the output?
age = 16 print("Adult") if age >= 18 else print("Minor")
age = 16 print("Adult") if age >= 18 else print("Minor")
Anonymous Quiz
24%
Adult
76%
Minor
โค5๐1
Now, let's move to the next topic of Data Science Roadmap:
โ Python Dictionaries ๐
Dictionaries are one of the most important data structures in Python, especially in data science and real-world datasets. They store data in keyโvalue pairs.
๐น 1. What is a Dictionary?
A dictionary stores data in key:value format.
โ Example:
Output:
โ Uses curly brackets {}
๐น 2. Access Dictionary Values
Use the key to access values.
Output:
๐น 3. Add New Elements
Output:
๐น 4. Modify Values
๐น 5. Remove Elements
๐น 6. Important Dictionary Methods
โญ
โ Get Method:
Output:
โ Keys Method:
Output:
โ Values Method:
Output:
โ Items Method:
Output:
๐น 7. Loop Through Dictionary
Output:
name Rahul
age 22
๐ฏ Todayโs Goal
โ Understand keyโvalue pairs
โ Access dictionary values
โ Add or update data
โ Loop through dictionary
๐ Dictionaries are widely used in APIs, JSON data, and machine learning datasets.
Double Tap โฅ๏ธ For More
โ Python Dictionaries ๐
Dictionaries are one of the most important data structures in Python, especially in data science and real-world datasets. They store data in keyโvalue pairs.
๐น 1. What is a Dictionary?
A dictionary stores data in key:value format.
โ Example:
student = { "name": "Rahul", "age": 22, "course": "Data Science" }
print(student)
Output:
{'name': 'Rahul', 'age': 22, 'course': 'Data Science'}โ Uses curly brackets {}
๐น 2. Access Dictionary Values
Use the key to access values.
student = { "name": "Rahul", "age": 22 }
print(student["name"])
Output:
Rahul๐น 3. Add New Elements
student = { "name": "Rahul", "age": 22 }
student["city"] = "Delhi"
print(student)
Output:
{'name': 'Rahul', 'age': 22, 'city': 'Delhi'}๐น 4. Modify Values
student["age"] = 23
๐น 5. Remove Elements
student.pop("age")
๐น 6. Important Dictionary Methods
โญ
โ Get Method:
print(student.get("name"))
Output:
Rahulโ Keys Method:
print(student.keys())
Output:
dict_keys(['name', 'age'])โ Values Method:
print(student.values())
Output:
dict_values(['Rahul', 22])โ Items Method:
print(student.items())
Output:
dict_items([('name', 'Rahul'), ('age', 22)])๐น 7. Loop Through Dictionary
student = { "name": "Rahul", "age": 22 }
for key, value in student.items():
print(key, value)
Output:
name Rahul
age 22
๐ฏ Todayโs Goal
โ Understand keyโvalue pairs
โ Access dictionary values
โ Add or update data
โ Loop through dictionary
๐ Dictionaries are widely used in APIs, JSON data, and machine learning datasets.
Double Tap โฅ๏ธ For More
โค21๐ฅฐ1
Which symbol is used to create a dictionary in Python?
Anonymous Quiz
18%
A) []
9%
B) ()
71%
C) {}
3%
D) <>
โค2๐ข1
What will be the output?
student = { "name": "Rahul", "age": 22 } print(student["name"])
student = { "name": "Rahul", "age": 22 } print(student["name"])
Anonymous Quiz
82%
A) Rahul
9%
B) name
3%
C) 22
7%
D) Error
โค2
Which method returns all keys of a dictionary?
Anonymous Quiz
14%
A) values()
14%
B) items()
61%
C) keys()
11%
D) get()
โค1