Data Analyst Interview Resources – Telegram
Data Analyst Interview Resources
52K subscribers
257 photos
1 video
53 files
321 links
Join our telegram channel to learn how data analysis can reveal fascinating patterns, trends, and stories hidden within the numbers! 📊

For ads & suggestions: @love_data
Download Telegram
📖 SQL Short Notes 📝 Beginner To Advance
3👍1
Complete SQL Topics for Data Analysts 😄👇

1. Introduction to SQL:
- Basic syntax and structure
- Understanding databases and tables

2. Querying Data:
- SELECT statement
- Filtering data using WHERE clause
- Sorting data with ORDER BY

3. Joins:
- INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN
- Combining data from multiple tables

4. Aggregation Functions:
- GROUP BY
- Aggregate functions like COUNT, SUM, AVG, MAX, MIN

5. Subqueries:
- Using subqueries in SELECT, WHERE, and HAVING clauses

6. Data Modification:
- INSERT, UPDATE, DELETE statements
- Transactions and Rollback

7. Data Types and Constraints:
- Understanding various data types (e.g., INT, VARCHAR)
- Using constraints (e.g., PRIMARY KEY, FOREIGN KEY)

8. Indexes:
- Creating and managing indexes for performance optimization

9. Views:
- Creating and using views for simplified querying

10. Stored Procedures and Functions:
- Writing and executing stored procedures
- Creating and using functions

11. Normalization:
- Understanding database normalization concepts

12. Data Import and Export:
- Importing and exporting data using SQL

13. Window Functions:
- ROW_NUMBER(), RANK(), DENSE_RANK(), and others

14. Advanced Filtering:
- Using CASE statements for conditional logic

15. Advanced Join Techniques:
- Self-joins and other advanced join scenarios

16. Analytical Functions:
- LAG(), LEAD(), OVER() for advanced analytics

17. Working with Dates and Times:
- Date and time functions and formatting

18. Performance Tuning:
- Query optimization strategies

19. Security:
- Understanding SQL injection and best practices for security

20. Handling NULL Values:
- Dealing with NULL values in queries

Ensure hands-on practice on these topics to strengthen your SQL skills.

Since SQL is one of the most essential skill for data analysts, I have decided to teach each topic daily in this channel for free. Like this post if you want me to continue this SQL series 👍♥️

Share with credits: https://news.1rj.ru/str/sqlspecialist

Hope it helps :)
👍3
Here's Part 4 of the phone interview series for data analysts:

𝐂𝐚𝐧 𝐲𝐨𝐮 𝐝𝐞𝐬𝐜𝐫𝐢𝐛𝐞 𝐚 𝐭𝐢𝐦𝐞 𝐰𝐡𝐞𝐧 𝐲𝐨𝐮 𝐟𝐚𝐜𝐞𝐝 𝐚 𝐜𝐡𝐚𝐥𝐥𝐞𝐧𝐠𝐞 𝐢𝐧 𝐚𝐧𝐚𝐥𝐲𝐳𝐢𝐧𝐠 𝐝𝐚𝐭𝐚 𝐚𝐧𝐝 𝐡𝐨𝐰 𝐲𝐨𝐮 𝐨𝐯𝐞𝐫𝐜𝐚𝐦𝐞 𝐢𝐭?

𝐇𝐑: [Your Name], can you describe a time when you faced a challenge in analyzing data and how you overcame it?

[Your Name]: Certainly. One challenging situation I encountered was during my internship at [Internship Company]. I was tasked with analyzing sales data to forecast future sales trends, but the data we had was incomplete and contained numerous inconsistencies.

𝐇𝐑: That sounds difficult. How did you approach this challenge?

[Your Name]: First, I conducted a thorough assessment of the data to understand the extent of the issues. I identified gaps, missing values, and inconsistencies. Realizing that the data needed significant cleaning, I developed a plan to address these issues systematically.

𝐇𝐑: What specific steps did you take to clean and prepare the data?

[Your Name]: I started by addressing the missing values. For numerical data, I used imputation techniques such as mean or median imputation where appropriate. For categorical data, I used the most frequent category or created a new category for missing values. I also removed any duplicate entries and corrected errors based on cross-references with other data sources.

To ensure the cleaned data was reliable, I performed data validation checks. This involved verifying the consistency of the data across different time periods and segments. I also consulted with the sales team to understand any anomalies and incorporate their insights into the data cleaning process.

𝐇𝐑: Once the data was cleaned, how did you proceed with the analysis?

[Your Name]: With the cleaned data, I conducted exploratory data analysis to identify trends and patterns. I used statistical techniques to smooth out short-term fluctuations and highlight long-term trends.

For the sales forecasting, I applied time series analysis techniques such as ARIMA (AutoRegressive Integrated Moving Average) models. I split the data into training and testing sets to validate the model’s accuracy. After fine-tuning the model, I was able to generate reliable forecasts for future sales trends.

𝐇𝐑: How did you present your findings and ensure they were actionable?

[Your Name]: I created a detailed report and a set of interactive dashboards using Tableau. These visualizations highlighted key trends, forecasted sales figures, and potential growth areas. I also included a section on the data cleaning process and the assumptions made during the analysis to provide full transparency.

I presented the findings to the sales team and senior management. During the presentation, I emphasized the implications of the forecast and offered recommendations based on the analysis. The clear visualization and actionable insights helped the team make informed decisions on inventory management and marketing strategies.

𝐇𝐑: That’s an impressive way to handle a challenging situation. It seems like your structured approach and attention to detail were crucial.

[Your Name]: Thank you! I believe that thorough data preparation and clear communication are key to overcoming challenges in data analysis.

Share with credits: https://news.1rj.ru/str/jobs_SQL

Like this post if you want me to continue this 👍❤️
👍21
Python Programming Interview Questions for Entry Level Data Analyst

1. What is Python, and why is it popular in data analysis?

2. Differentiate between Python 2 and Python 3.

3. Explain the importance of libraries like NumPy and Pandas in data analysis.

4. How do you read and write data from/to files using Python?

5. Discuss the role of Matplotlib and Seaborn in data visualization with Python.

6. What are list comprehensions, and how do you use them in Python?

7. Explain the concept of object-oriented programming (OOP) in Python.


8. Discuss the significance of libraries like SciPy and Scikit-learn in data analysis.

9. How do you handle missing or NaN values in a DataFrame using Pandas?

10. Explain the difference between loc and iloc in Pandas DataFrame indexing.

11. Discuss the purpose and usage of lambda functions in Python.

12. What are Python decorators, and how do they work?

13. How do you handle categorical data in Python using the Pandas library?

14. Explain the concept of data normalization and its importance in data preprocessing.

15. Discuss the role of regular expressions (regex) in data cleaning with Python.

16. What are Python virtual environments, and why are they useful?

17. How do you handle outliers in a dataset using Python?

18. Explain the usage of the map and filter functions in Python.

19. Discuss the concept of recursion in Python programming.

20. How do you perform data analysis and visualization using Jupyter Notebooks?

Python Interview Q&A: https://topmate.io/coding/898340

Like for more ❤️

ENJOY LEARNING 👍👍
2👍1
Do not wait till you've mastered SQL till you apply to your first Data Analyst Job.

You can do both at the same time.
👍4👏1
𝗔𝗰𝗲 𝗬𝗼𝘂𝗿 𝗗𝗮𝘁𝗮 𝗔𝗻𝗮𝗹𝘆𝘀𝘁 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄 𝘄𝗶𝘁𝗵 𝗧𝗵𝗲𝘀𝗲 𝗠𝘂𝘀𝘁-𝗞𝗻𝗼𝘄 𝗤𝘂𝗲𝘀𝘁𝗶𝗼𝗻𝘀! 🔥

Are you preparing for a 𝗗𝗮𝘁𝗮 𝗔𝗻𝗮𝗹𝘆𝘀𝘁 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄? Hiring managers don’t just want to hear your answers—they want to know if you truly understand data.

Here are 𝗳𝗿𝗲𝗾𝘂𝗲𝗻𝘁𝗹𝘆 𝗮𝘀𝗸𝗲𝗱 𝗾𝘂𝗲𝘀𝘁𝗶𝗼𝗻𝘀 (and what they really mean):

📌 "𝗧𝗲𝗹𝗹 𝗺𝗲 𝗮𝗯𝗼𝘂𝘁 𝘆𝗼𝘂𝗿𝘀𝗲𝗹𝗳."

🔍 What they’re really asking: Are you relevant for this role?

Keep it concise—highlight your experience, tools (SQL, Power BI, etc.), and a key impact you made.

📌 "𝗛𝗼𝘄 𝗱𝗼 𝘆𝗼𝘂 𝗵𝗮𝗻𝗱𝗹𝗲 𝗺𝗲𝘀𝘀𝘆 𝗱𝗮𝘁𝗮?"

🔍 What they’re really asking: Do you panic when you see missing values?

Show your structured approach—identify issues, clean with Pandas/SQL, and document your process.

📌 "𝗛𝗼𝘄 𝗱𝗼 𝘆𝗼𝘂 𝗮𝗽𝗽𝗿𝗼𝗮𝗰𝗵 𝗮 𝗱𝗮𝘁𝗮 𝗮𝗻𝗮𝗹𝘆𝘀𝗶𝘀 𝗽𝗿𝗼𝗷𝗲𝗰𝘁?"

🔍 What they’re really asking: Do you have a methodology, or do you just wing it?

Use a structured approach: Define business needs → Clean & explore data → Generate insights → Present effectively.

📌 "𝗖𝗮𝗻 𝘆𝗼𝘂 𝗲𝘅𝗽𝗹𝗮𝗶𝗻 𝗮 𝗰𝗼𝗺𝗽𝗹𝗲𝘅 𝗰𝗼𝗻𝗰𝗲𝗽𝘁 𝘁𝗼 𝗮 𝗻𝗼𝗻-𝘁𝗲𝗰𝗵𝗻𝗶𝗰𝗮𝗹
𝘀𝘁𝗮𝗸𝗲𝗵𝗼𝗹𝗱𝗲𝗿?"

🔍 What they’re really asking: Can you simplify data without oversimplifying?

Use storytelling—focus on actionable insights rather than jargon.

📌 "𝗧𝗲𝗹𝗹 𝗺𝗲 𝗮𝗯𝗼𝘂𝘁 𝗮 𝘁𝗶𝗺𝗲 𝘆𝗼𝘂 𝗺𝗮𝗱𝗲 𝗮 𝗺𝗶𝘀𝘁𝗮𝗸𝗲."

🔍 What they’re really asking: Can you learn from failure?

Own your mistake, explain how you fixed it, and share what you do differently now.

💡 𝗣𝗿𝗼 𝗧𝗶𝗽: The best candidates don’t just answer questions—they tell stories that demonstrate problem-solving, clarity, and impact.

🔄 Save this for later & share with someone preparing for interviews!
👍21
1. What is a Self-Join?

A self-join is a type of join that can be used to connect two tables. As a result, it is a unary relationship. Each row of the table is attached to itself and all other rows of the same table in a self-join. As a result, a self-join is mostly used to combine and compare rows from the same database table.


2. What is OLTP?

OLTP, or online transactional processing, allows huge groups of people to execute massive amounts of database transactions in real time, usually via the internet. A database transaction occurs when data in a database is changed, inserted, deleted, or queried.


3. What is the difference between joining and blending in Tableau?

Joining term is used when you are combining data from the same source, for example, worksheet in an Excel file or tables in Oracle databaseWhile blending requires two completely defined data sources in your report.


4. How to prevent someone from copying the cell from your worksheet in excel?

If you want to protect your worksheet from being copied, go into Menu bar > Review > Protect sheet > Password.

By entering password you can prevent your worksheet from getting copied.


5. What are the different integrity rules present in the DBMS?

The different integrity rules present in DBMS are as follows:
Entity Integrity: This rule states that the value of the primary key can never be NULL. So, all the tuples in the column identified as the primary key should have a value.
Referential Integrity: This rule states that either the value of the foreign key is NULL or it should be the primary key of any other relation.
👍4
Choosing the Right Chart Type

Selecting the appropriate chart can make or break your data storytelling. Here's a quick guide to help you choose the perfect visualization:

↳ 𝐁𝐚𝐫 𝐂𝐡𝐚𝐫𝐭𝐬: Perfect for comparing quantities across categories (Think: regional sales comparison)

↳ 𝐋𝐢𝐧𝐞 𝐂𝐡𝐚𝐫𝐭𝐬: Ideal for showing trends and changes over time (Example: monthly website traffic)

↳ 𝐏𝐢𝐞 𝐂𝐡𝐚𝐫𝐭𝐬: Best for showing parts of a whole as percentages (Use case: market share breakdown)

↳ 𝐇𝐢𝐬𝐭𝐨𝐠𝐫𝐚𝐦𝐬: Great for showing the distribution of continuous data (Like salary ranges across your organization)

↳ 𝐒𝐜𝐚𝐭𝐭𝐞𝐫 𝐏𝐥𝐨𝐭𝐬: Essential for exploring relationships between variables (Perfect for marketing spend vs. sales analysis)

↳ 𝐇𝐞𝐚𝐭 𝐌𝐚𝐩𝐬: Excellent for showing data density with color variation (Think: website traffic patterns by hour/day)

↳ 𝐁𝐨𝐱 𝐏𝐥𝐨𝐭𝐬: Invaluable for displaying data variability and outliers (Great for analyzing performance metrics)

↳ 𝐀𝐫𝐞𝐚 𝐂𝐡𝐚𝐫𝐭𝐬: Shows cumulative totals over time (Example: sales growth across product lines)

↳ 𝐁𝐮𝐛𝐛𝐥𝐞 𝐂𝐡𝐚𝐫𝐭𝐬: Powerful for displaying three dimensions of data (Combines size, position, and grouping)

𝐏𝐫𝐨 𝐓𝐢𝐩: Always consider your audience and the story you want to tell when choosing your visualization type.

I have curated the best interview resources to crack Power BI Interviews 👇👇
https://news.1rj.ru/str/PowerBI_analyst

Hope you'll like it

Like this post if you need more resources like this 👍❤️
👍5
Hey guys 👋

I was working on something big from last few days.

Finally, I have curated best 80+ top-notch Data Analytics Resources 👇👇
https://topmate.io/analyst/861634

If you go on purchasing these books, it will cost you more than 15000 but I kept the minimal price for everyone's benefit.

I hope these resources will help you in data analytics journey.

I will add more resources here in the future without any additional cost.

All the best for your career ❤️
2
Essential Python Libraries for Data Analytics 😄👇

Python Free Resources: https://news.1rj.ru/str/pythondevelopersindia

1. NumPy:
- Efficient numerical operations and array manipulation.

2. Pandas:
- Data manipulation and analysis with powerful data structures (DataFrame, Series).

3. Matplotlib:
- 2D plotting library for creating visualizations.

4. Scikit-learn:
- Machine learning toolkit for classification, regression, clustering, etc.

5. TensorFlow:
- Open-source machine learning framework for building and deploying ML models.

6. PyTorch:
- Deep learning library, particularly popular for neural network research.

7. Django:
- High-level web framework for building robust, scalable web applications.

8. Flask:
- Lightweight web framework for building smaller web applications and APIs.

9. Requests:
- HTTP library for making HTTP requests.

10. Beautiful Soup:
- Web scraping library for pulling data out of HTML and XML files.

As a beginner, you can start with Pandas and Numpy libraries for data analysis. If you want to transition from Data Analyst to Data Scientist, then you can start applying ML libraries like Scikit-learn, Tensorflow, Pytorch, etc. in your data projects.

Share with credits: https://news.1rj.ru/str/sqlspecialist

Hope it helps :)
1👍1
Scenario based  Interview Questions & Answers for Data Analyst

1. Scenario: You are working on a SQL database that stores customer information. The database has a table called "Orders" that contains order details. Your task is to write a SQL query to retrieve the total number of orders placed by each customer.
  Question:
  - Write a SQL query to find the total number of orders placed by each customer.
Expected Answer:
    SELECT CustomerID, COUNT(*) AS TotalOrders
    FROM Orders
    GROUP BY CustomerID;

2. Scenario: You are working on a SQL database that stores employee information. The database has a table called "Employees" that contains employee details. Your task is to write a SQL query to retrieve the names of all employees who have been with the company for more than 5 years.
  Question:
  - Write a SQL query to find the names of employees who have been with the company for more than 5 years.
Expected Answer:
    SELECT Name
    FROM Employees
    WHERE DATEDIFF(year, HireDate, GETDATE()) > 5;

Power BI Scenario-Based Questions

1. Scenario: You have been given a dataset in Power BI that contains sales data for a company. Your task is to create a report that shows the total sales by product category and region.
    Expected Answer:
    - Load the dataset into Power BI.
    - Create relationships if necessary.
    - Use the "Fields" pane to select the necessary fields (Product Category, Region, Sales).
    - Drag these fields into the "Values" area of a new visualization (e.g., a table or bar chart).
    - Use the "Filters" pane to filter data as needed.
    - Format the visualization to enhance clarity and readability.

2. Scenario: You have been asked to create a Power BI dashboard that displays real-time stock prices for a set of companies. The stock prices are available through an API.
  Expected Answer:
    - Use Power BI Desktop to connect to the API.
    - Go to "Get Data" > "Web" and enter the API URL.
    - Configure the data refresh settings to ensure real-time updates (e.g., setting up a scheduled refresh or using DirectQuery if supported).
    - Create visualizations using the imported data.
    - Publish the report to the Power BI service and set up a data gateway if needed for continuous refresh.

3. Scenario: You have been given a Power BI report that contains multiple visualizations. The report is taking a long time to load and is impacting the performance of the application.
    Expected Answer:
    - Analyze the current performance using Performance Analyzer.
    - Optimize data model by reducing the number of columns and rows, and removing unnecessary calculations.
    - Use aggregated tables to pre-compute results.
    - Simplify DAX calculations.
    - Optimize visualizations by reducing the number of visuals per page and avoiding complex custom visuals.
    - Ensure proper indexing on the data source.

Free SQL Resources: https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v

Like if you need more similar content

Hope it helps :)
👍41
🚨Here is a comprehensive list of #interview questions that are commonly asked in job interviews for Data Scientist, Data Analyst, and Data Engineer positions:


➡️ Data Scientist Interview Questions



Technical Questions

1) What are your preferred programming languages for data science, and why?

2) Can you write a Python noscript to perform data cleaning on a given dataset?

3) Explain the Central Limit Theorem.

4) How do you handle missing data in a dataset?

5) Describe the difference between supervised and unsupervised learning.

6) How do you select the right algorithm for your model?


Questions Related To Problem-Solving and Projects

7) Walk me through a data science project you have worked on.

8) How did you handle data preprocessing in your project?

9) How do you evaluate the performance of a machine learning model?

10) What techniques do you use to prevent overfitting?


➡️Data Analyst Interview Questions


Technical Questions


1) Write a SQL query to find the second highest salary from the employee table.

2) How would you optimize a slow-running query?

3) How do you use pivot tables in Excel?

4) Explain the VLOOKUP function.

5) How do you handle outliers in your data?

6) Describe the steps you take to clean a dataset.


Analytical Questions

7) How do you interpret data to make business decisions?

8) Give an example of a time when your analysis directly influenced a business decision.

9) What are your preferred tools for data analysis and why?

10) How do you ensure the accuracy of your analysis?


➡️Data Engineer Interview Questions


Technical Questions


1) What is your experience with SQL and NoSQL databases?

2) How do you design a scalable database architecture?

3) Explain the ETL process you follow in your projects.

4) How do you handle data transformation and loading efficiently?

5) What is your experience with Hadoop/Spark?

6) How do you manage and process large datasets?


Questions Related To Problem-Solving and Optimization

7) Describe a data pipeline you have built.

8) What challenges did you face, and how did you overcome them?

9) How do you ensure your data processes run efficiently?

10) Describe a time when you had to optimize a slow data pipeline.

I have curated best 80+ top-notch Data Analytics Resources 👇👇
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02

Hope this helps you 😊
👍4
𝗔𝗰𝗲 𝗬𝗼𝘂𝗿 𝗗𝗮𝘁𝗮 𝗔𝗻𝗮𝗹𝘆𝘀𝘁 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄 𝘄𝗶𝘁𝗵 𝗧𝗵𝗲𝘀𝗲 𝗠𝘂𝘀𝘁-𝗞𝗻𝗼𝘄 𝗤𝘂𝗲𝘀𝘁𝗶𝗼𝗻𝘀! 🔥

Are you preparing for a 𝗗𝗮𝘁𝗮 𝗔𝗻𝗮𝗹𝘆𝘀𝘁 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄? Hiring managers don’t just want to hear your answers—they want to know if you truly understand data.

Here are 𝟭𝟬 𝗳𝗿𝗲𝗾𝘂𝗲𝗻𝘁𝗹𝘆 𝗮𝘀𝗸𝗲𝗱 𝗾𝘂𝗲𝘀𝘁𝗶𝗼𝗻𝘀 (and what they really mean):

📌 "𝗧𝗲𝗹𝗹 𝗺𝗲 𝗮𝗯𝗼𝘂𝘁 𝘆𝗼𝘂𝗿𝘀𝗲𝗹𝗳."

🔍 What they’re really asking: Are you relevant for this role?

Keep it concise—highlight your experience, tools (SQL, Power BI, etc.), and a key impact you made.

📌 "𝗛𝗼𝘄 𝗱𝗼 𝘆𝗼𝘂 𝗵𝗮𝗻𝗱𝗹𝗲 𝗺𝗲𝘀𝘀𝘆 𝗱𝗮𝘁𝗮?"

🔍 What they’re really asking: Do you panic when you see missing values?

Show your structured approach—identify issues, clean with Pandas/SQL, and document your process.

📌 "𝗛𝗼𝘄 𝗱𝗼 𝘆𝗼𝘂 𝗮𝗽𝗽𝗿𝗼𝗮𝗰𝗵 𝗮 𝗱𝗮𝘁𝗮 𝗮𝗻𝗮𝗹𝘆𝘀𝗶𝘀 𝗽𝗿𝗼𝗷𝗲𝗰𝘁?"

🔍 What they’re really asking: Do you have a methodology, or do you just wing it?

Use a structured approach: Define business needs → Clean & explore data → Generate insights → Present effectively.

📌 "𝗖𝗮𝗻 𝘆𝗼𝘂 𝗲𝘅𝗽𝗹𝗮𝗶𝗻 𝗮 𝗰𝗼𝗺𝗽𝗹𝗲𝘅 𝗰𝗼𝗻𝗰𝗲𝗽𝘁 𝘁𝗼 𝗮 𝗻𝗼𝗻-𝘁𝗲𝗰𝗵𝗻𝗶𝗰𝗮𝗹
𝘀𝘁𝗮𝗸𝗲𝗵𝗼𝗹𝗱𝗲𝗿?"

🔍 What they’re really asking: Can you simplify data without oversimplifying?

Use storytelling—focus on actionable insights rather than jargon.

📌 "𝗧𝗲𝗹𝗹 𝗺𝗲 𝗮𝗯𝗼𝘂𝘁 𝗮 𝘁𝗶𝗺𝗲 𝘆𝗼𝘂 𝗺𝗮𝗱𝗲 𝗮 𝗺𝗶𝘀𝘁𝗮𝗸𝗲."

🔍 What they’re really asking: Can you learn from failure?

Own your mistake, explain how you fixed it, and share what you do differently now.

💡 𝗣𝗿𝗼 𝗧𝗶𝗽: The best candidates don’t just answer questions—they tell stories that demonstrate problem-solving, clarity, and impact.

🔄 Save this for later & share with someone preparing for interviews!
👍1
Data Analyst Interview QnA

1. Find avg of salaries department wise from table.

Answer-
SELECT department_id, AVG(salary) AS avg_salary
FROM employees
GROUP BY department_id;


2. What does Filter context in DAX mean?

Answer - Filter context in DAX refers to the subset of data that is actively being used in the calculation of a measure or in the evaluation of an expression. This context is determined by filters on the dashboard items like slicers, visuals, and filters pane which restrict the data being processed.

3. Explain how to implement Row-Level Security (RLS) in Power BI.

Answer - Row-Level Security (RLS) in Power BI can be implemented by:

- Creating roles within the Power BI service.
- Defining DAX expressions that specify the data each role can access.
- Assigning users to these roles either in Power BI or dynamically through AD group membership.

4. Create a dictionary, add elements to it, modify an element, and then print the dictionary in alphabetical order of keys.

Answer -
d = {'apple': 2, 'banana': 5}
d['orange'] = 3 # Add element
d['apple'] = 4 # Modify element
sorted_d = dict(sorted(d.items())) # Sort dictionary
print(sorted_d)


5. Find and print duplicate values in a list of assorted numbers, along with the number of times each value is repeated.

Answer -
from collections import Counter

numbers = [1, 2, 2, 3, 4, 5, 1, 6, 7, 3, 8, 1]
count = Counter(numbers)
duplicates = {k: v for k, v in count.items() if v > 1}
print(duplicates)
👍3