Nykaa Data Analyst Interview Questions | Day 9

Nykaa Data Analyst Interview Questions
Name – Nykaa
Designation – Senior Data Analyst
Location – Gurgaon
Salary – 22 LPA (including 10% variable)
Level of questions – 7/10
Nykaa Data Analyst Interview Questions

Nykaa Data Analyst Interview Questions
Nykaa Data Analyst Interview Questions

For the Senior Data Analyst position there were 4 rounds:

Round 1 – Technical Screening (SQL heavy)
Round 2 – Project, Case Study, and SQL
Round 3 – SQL, Python, and Guesstimate/Case Study
Round 4 – Cultural fit with the Hiring manager

Below are some of the questions and analogous concepts asked in the complete recruitment process, the candidate had some experience in the Natural Language Processing domain, so he was asked a few questions on that front:

  1. What is the use of the NVL function in Oracle?
    NVL function is the most important function to replace a null value with another value.
    Example:
    select NVL(null,’ Amit’) from dual;
    which will give you output as Amit.
  2. What is the result of the following query?
    Select
    case when null=null then ‘Amit’ else ‘Rahul’ end as Case_check
    from Table_Name;


    The null=null is always false. So the Answer to this query is Rahul.
  3. What is a parser?

    When SQL Statement has been written and generated the first step is parsing that SQL Statement. Parsing is nothing but checking the syntaxes of SQL queries. All the syntax of Query is correct or not is checked by SQL Parser.
    There are 2 functions of the parser:
    1. Syntax analysis
    2. Semantic analysis
  4. What is lapply and sapply?

    Lapply applies a function to each element of a list and returns the results as a list Sapply applies a function to each element of a list and returns the result in a vector.
  5. Guesstimate – What is the size of the market for disposable diapers in India?

    1.2 billion people x 60% childbearing age = 0.72 B people
    0.72 people x 1/2 are women = 0.36 B women of childbearing age 0.36 women x 2/3 have children = 0.24 women with children
    0.24 women x 1.5 children each = 0.36 children
    0.36 B children x 1/10 under age 2 = 36 million
  6. Count the total salary department number-wise where more than 2 employees exist.

    SELECT deptno, sum(sal) As totalsal
    FROM emp
    GROUP BY deptno
    HAVING COUNT(empno) > 2
  7. How to retrieve the 3 Minimum salaries ?

    SELECT DISTINCT sal
    FROM emp a
    WHERE 3 >= (SELECT COUNT(DISTINCT sal) FROM emp b WHERE a.sal >= b.sal);
  8. Case Study 1 – A client has a Diwali-themed e-commerce shop that sells five items. What are some potential problems you foresee with their revenue streams?

    a. The immediate issue with the client’s revenue stream is that it will take a severe hit once the holiday season is over.
    b. How to generate revenue outside of the holiday season would be a key point to address with the client.
    c. The other concern is with only offering five items.
    d. The client is severely limiting their opportunity to generate revenue
    e. A couple of bad reviews might create a lot of problems for them as they have very limited items
    f. These products are mostly around lighting and crackers, these products have brief shelf-life and the defect in the product is also more than usual
    g. Competitor issue – Since these are themed product that are released once an year, so a competitor might provide a sub-standard product at lower cost to kill the competition
  9. How do you remove your own list of stop words from a line of text given below ‘Book My Show is the best website to book a show’

    dict = [“is”,”the”,”and”,”are”,”you”,”to”,”here”,”this”,”we”,”This”,”a”,”best”]
    def stopy(text):
    words = text.split()
    no_noise = [word for word in words if word not in dict]
    final = ” “.join(no_noise)
    return final

    x = stopy(“Book My Show is the best website to book a show”)
  10. What are the steps involved in a typical Text-Analytics project

    We mostly follow the below steps:-
    -Get the raw data
    -Remove special characters and punctuations after converting the text into tokens
    -Remove stop words. These are the common words which are present in text
    -Stemming and Lemmatization to remove the noise from the filtered data
    -Do a TF-IDF to find out the important words
    -We mostly go for n-gram to see the correlated words
    -Word correlation

    – After this point, it’s mostly about the requirement of the project. There are multiple algorithms that we followed at different points in time
    *Part of Speech Tagging
    *Named Entity Recognition
    *Text Classification
    *Sentiment Analysis

    -How many bi-grams can be generated from a given sentence:
    “Sachin Tendulkar is the best batsman in the World”
    Sachin Tendulkar, Tendulkar is, is the, the best, best batsman, batsman in, in the, the World

The Data Monk services

We are well known for our interview books and have 70+ e-book across Amazon and The Data Monk e-shop page . Following are best-seller combo packs and services that we are providing as of now

  1. YouTube channel covering all the interview-related important topics in SQL, Python, MS Excel, Machine Learning Algorithm, Statistics, and Direct Interview Questions
    Link – The Data Monk Youtube Channel
  2. Website – ~2000 completed solved Interview questions in SQL, Python, ML, and Case Study
    Link – The Data Monk website
  3. E-book shop – We have 70+ e-books available on our website and 3 bundles covering 2000+ solved interview questions. Do check it out
    Link – The Data E-shop Page
  4. Instagram Page – It covers only Most asked Questions and concepts (100+ posts). We have 100+ most asked interview topics explained in simple terms
    Link – The Data Monk Instagram page
  5. Mock Interviews/Career Guidance/Mentorship/Resume Making
    Book a slot on Top Mate

The Data Monk e-books

We know that each domain requires a different type of preparation, so we have divided our books in the same way:

1. 2200 Interview Questions to become Full Stack Analytics Professional – 2200 Most Asked Interview Questions
2.Data Scientist and Machine Learning Engineer -> 23 e-books covering all the ML Algorithms Interview Questions
3. 30 Days Analytics Course – Most Asked Interview Questions from 30 crucial topics

You can check out all the other e-books on our e-shop page – Do not miss it


For any information related to courses or e-books, please send an email to nitinkamal132@gmail.com

Advance SQL topics for Analytics Role | Day 8

Welcome to the 6th Day of Machine Learning Interview Questions – Advance SQL topics for Analytics Role
You can go through the question and answer for
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6

Advance SQL topics for Analytics Role

In this series, all you need to do is to go through the questions and try to attempt it with whatever knowledge you have.

Before or after you attempt the questions, do go through the complete road map about what you need to study to crack an analytics role. We have covered from 3rd years as college student to 8 years of analytics or non-analytic experience. Make sure you understand where to emphasize more(after all by the end of the day you want to crack an interview)

Complete Roadmap for cracking an Analytics Role in the next 30 days

Now, coming back to our questions. Remember, these are the most asked questions in an interview, if you are shy to answer the questions in the comment section, make sure to Google the answer and jot it down in your notebook.

Advance SQL topics for Analytics Role

SQL Advanced Topics and Questions

Some of the most important topics are

– Execution of SQL commands
– Basics of self-join
– Window functions like Row_number, Rank, Dense Rank, Lead, and Lag
– Running sum in a table
– Optimisation of queries
– Partition in SQL
– Hands-on handling JSON and Arrays
– How to extract an element from a JSON table
– Pivoting a table
– Hands-on in applying regular expression in SQL
– Difference between self, left, right, outer and inner join
– Normalization of tables in SQL (1NF, 2NF, 3NF, 3.5 NF, 4NF)

– Exploding a column with Array or JSON data type i.e. UNNESTING a column
– Handling different date and time functions
– Concentrate more on Self Join and Cross join as their concepts and understanding are a bit complex

– Writing optimised query to handle both time and space complexity
– Debugging error in SQL code

The Data Monk services

We are well known for our interview books and have 70+ e-book across Amazon and The Data Monk e-shop page . Following are best-seller combo packs and services that we are providing as of now

  1. YouTube channel covering all the interview-related important topics in SQL, Python, MS Excel, Machine Learning Algorithm, Statistics, and Direct Interview Questions
    Link – The Data Monk Youtube Channel
  2. Website – ~2000 completed solved Interview questions in SQL, Python, ML, and Case Study
    Link – The Data Monk website
  3. E-book shop – We have 70+ e-books available on our website and 3 bundles covering 2000+ solved interview questions. Do check it out
    Link – The Data E-shop Page
  4. Instagram Page – It covers only Most asked Questions and concepts (100+ posts). We have 100+ most asked interview topics explained in simple terms
    Link – The Data Monk Instagram page
  5. Mock Interviews/Career Guidance/Mentorship/Resume Making
    Book a slot on Top Mate

The Data Monk e-books

We know that each domain requires a different type of preparation, so we have divided our books in the same way:

1. 2200 Interview Questions to become Full Stack Analytics Professional – 2200 Most Asked Interview Questions
2.Data Scientist and Machine Learning Engineer -> 23 e-books covering all the ML Algorithms Interview Questions
3. 30 Days Analytics Course – Most Asked Interview Questions from 30 crucial topics

You can check out all the other e-books on our e-shop page – Do not miss it


For any information related to courses or e-books, please send an email to nitinkamal132@gmail.com

SQL and Statistics Interview Questions | Day 7

SQL and Statistics Interview Questions – Day 7 has solved questions from basic statistics, SQL, and a case study. If there is some mistake in the answers, then do comment below. Try to add more points in the case study section.
SQL and Statistics Interview Questions

Welcome to the 6th Day of Machine Learning Interview Questions.
You can go through the question and answer for
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6

Machine Learning Interview Questions

In this series, all you need to do is to go through the questions and try to attempt it with whatever knowledge you have.

Before or after you attempt the questions, do go through the complete road map about what you need to study to crack an analytics role. We have covered from 3rd year college student to 8 years of analytics or non-analytic experience. Make sure you understand where to emphasize more(after all by the end of the day you want to crack an interview)

Complete Roadmap for cracking an Analytics Role in the next 30 days

Now, coming back to our questions. Remember, these are the most asked questions in any interview, if you are shy to answer the questions in the comment section, then do make sure to Google the answer and jot it down in your notebook.

SQL and Statistics Interview Questions

1. What percentage of value lies between the Mean and one Standard deviation(both positive and negative)
~68%

2. Give the relation of Mean, median, and mode in a positively skewed distribution
Mean > Median > Mode

3. Negatively skewed distribution?
Mode > Median > Mean

4. What is the sum of squared deviation?
The Sum of Squared deviation is a measure of the total variability of a set of scores around a specific number

5. Why do we need to square the terms?
We need to square the terms so that the values above the mean do not cancel those below the mean.

6. How to find the Third highest salary in the Employee table using self-join?
Select * from Employee a Where 3 = (Select Count (distinct Salary) from Employee where a.salary<=b.salary

7. What is the difference between the primary key and the candidate key?
To identify each row of a table, a primary key is used. For a table, there exists only one primary key.
A candidate key is a column or a set of columns that can be used to uniquely identify any record in the database without having to reference any other data.

8. What are the measures of spread?
The measures of spread are
a. Variance
b. Standard Deviation
c. Covariance
d. Sample Correlation

9. What is the use of NVL function in Oracle?
NVL function is the most important function to replace a null value with another value.
Example:
select NVL(null,’ Amit’) from dual;
which will give you output as Amit.

10. Case Study
If you have to recommend a product to a customer who has already filled his cart, then what data will you look for? Basically, how will you recommend a product to an e-commerce customer?
There could be multiple things that we can look for
a. If the customer has brought the product A, then we should look in the data to find out the product that compliments that product. We can do this by looking into the purchase history of other customers who have brought the product A
b. We can get the cart information of the customer and look for those items which he has removed from the cart. At the check-out, you can again ask him if he wants to buy it
c. We can also look for a better product option for the customer. Suppose the customer is willing to pay $3 for soap, then we can show then ads or recommendations of a $5 soap with a better review
d. We can also look for the previous cart history of the customer to see if he is missing something which he used to buy regularly

The Data Monk services

We are well known for our interview books and have 70+ e-book across Amazon and The Data Monk e-shop page . Following are best-seller combo packs and services that we are providing as of now

  1. YouTube channel covering all the interview-related important topics in SQL, Python, MS Excel, Machine Learning Algorithm, Statistics, and Direct Interview Questions
    Link – The Data Monk Youtube Channel
  2. Website – ~2000 completed solved Interview questions in SQL, Python, ML, and Case Study
    Link – The Data Monk website
  3. E-book shop – We have 70+ e-books available on our website and 3 bundles covering 2000+ solved interview questions. Do check it out
    Link – The Data E-shop Page
  4. Instagram Page – It covers only Most asked Questions and concepts (100+ posts). We have 100+ most asked interview topics explained in simple terms
    Link – The Data Monk Instagram page
  5. Mock Interviews/Career Guidance/Mentorship/Resume Making
    Book a slot on Top Mate

The Data Monk e-books

We know that each domain requires a different type of preparation, so we have divided our books in the same way:

1. 2200 Interview Questions to become Full Stack Analytics Professional – 2200 Most Asked Interview Questions
2.Data Scientist and Machine Learning Engineer -> 23 e-books covering all the ML Algorithms Interview Questions
3. 30 Days Analytics Course – Most Asked Interview Questions from 30 crucial topics

You can check out all the other e-books on our e-shop page – Do not miss it


For any information related to courses or e-books, please send an email to nitinkamal132@gmail.com


Big Data Interview Questions | Day 5

Welcome to the 5th Day of Big Data Interview Questions.
You can go through the question and answer for
Day 1
Day 2
Day 3
Day 4

Big Data Interview Questions

In this series, all you need to do is to go through the questions and try to attempt it with whatever knowledge you have.

Before or after you attempt the questions, do go through the complete road map about what you need to study to crack an analytics role. We have covered from 3rd year college student to 8 years of analytics or non-analytic experience. Make sure you understand where to emphasize more(after all by the end of the day you want to crack an interview)

Complete Roadmap for cracking an Analytics Role in the next 30 days

Now, coming back to our questions. Remember, these are the most asked questions in any interview, if you are shy to answer the questions in the comment section, then do make sure to Google the answer and jot it down in your notebook.

Big Data Interview Questions


Following are the topic wise questions

SQL

  1. Difference between 2NF and 3NF in Normalizaiton?
  2. There is this Student table with columns – Name, Roll No, Marks, Class.
    Calculate the class for which the average score was the highest?

Python

  1. Import a csv using pandas and then remove all the columns with any null value
  2. Multiple methods or functions to get a gist of the type of data present in the table like number of rows, columns, mean, etc.

Case Study

  1. Flipkart has recently observed that people are falling out of it’s buy funnel i.e. a list of pages following which a customer makes a payment.
    The pages are – Listing page, Description Page, Delivery option page, Payment Page and Redirection page.

    How would you identify the problem faced by the customers

Machine Learning

  1. What is F1 score?
  2. What is ROC and AUC curver?

The Data Monk services

We are well known for our interview books and have 70+ e-book across Amazon and The Data Monk e-shop page . Following are best-seller combo packs and services that we are providing as of now

  1. YouTube channel covering all the interview-related important topics in SQL, Python, MS Excel, Machine Learning Algorithm, Statistics, and Direct Interview Questions
    Link – The Data Monk Youtube Channel
  2. Website – ~2000 completed solved Interview questions in SQL, Python, ML, and Case Study
    Link – The Data Monk website
  3. E-book shop – We have 70+ e-books available on our website and 3 bundles covering 2000+ solved interview questions. Do check it out
    Link – The Data E-shop Page
  4. Instagram Page – It covers only Most asked Questions and concepts (100+ posts). We have 100+ most asked interview topics explained in simple terms
    Link – The Data Monk Instagram page
  5. Mock Interviews/Career Guidance/Mentorship/Resume Making
    Book a slot on Top Mate

The Data Monk e-books

We know that each domain requires a different type of preparation, so we have divided our books in the same way:

1. 2200 Interview Questions to become Full Stack Analytics Professional – 2200 Most Asked Interview Questions
2.Data Scientist and Machine Learning Engineer -> 23 e-books covering all the ML Algorithms Interview Questions
3. 30 Days Analytics Course – Most Asked Interview Questions from 30 crucial topics

You can check out all the other e-books on our e-shop page – Do not miss it


For any information related to courses or e-books, please send an email to nitinkamal132@gmail.com

Business Analytics Interview Questions | Day 3

Welcome to the 2nd Day of Business Analytics Interview Questions Quiz.
You can go through the question and answer for
Day 1 Here
Day 2 Here
The best answer to the quiz was provided by Raahul for both the days
Business Analytics Interview Questions

In this series, all you need to do is to go through the questions and try to attempt it with whatever knowledge you have.

Before or after you attempt the questions, do go through the complete road map about what you need to study to crack an analytics role. We have covered from 3rd year college student to 8 years of analytics or non-analytic experience. Make sure you understand where to emphasize more(after all by the end of the day you want to crack an interview)

Complete Roadmap for cracking an Analytics Role in the next 30 days

Now, coming back to our questions. Remember, these are the most asked questions in any interview, if you are shy to answer the questions in the comment section, then do make sure to Google the answer and jot it down in your notebook.

Business Analytics Interview Questions

SQL

  1. How do you extract a value from column that has a data type of JSON?
  2. How to convert date from yyyy-mm-dd to dd-mm-yyyy
  3. Difference between internal and external table in Hive?

Python

  1. Print if a number/string is palindrome?
  2. Can we access values in a dictionary using index number ?

Case Study

  1. For a particular e-commerce business the number of supplier and user both have grown by 5% week over week, but the revenue has declined by 5 %, what could be the reason?

Machine Learning

  1. Explain multicollinearity ? And why should we avoid it?
  2. Explain null hypothesis?

The Data Monk services

We are well known for our interview books and have 70+ e-book across Amazon and The Data Monk e-shop page . Following are best-seller combo packs and services that we are providing as of now

  1. YouTube channel covering all the interview-related important topics in SQL, Python, MS Excel, Machine Learning Algorithm, Statistics, and Direct Interview Questions
    Link – The Data Monk Youtube Channel
  2. Website – ~2000 completed solved Interview questions in SQL, Python, ML, and Case Study
    Link – The Data Monk website
  3. E-book shop – We have 70+ e-books available on our website and 3 bundles covering 2000+ solved interview questions. Do check it out
    Link – The Data E-shop Page
  4. Instagram Page – It covers only Most asked Questions and concepts (100+ posts). We have 100+ most asked interview topics explained in simple terms
    Link – The Data Monk Instagram page
  5. Mock Interviews/Career Guidance/Mentorship/Resume Making
    Book a slot on Top Mate

The Data Monk e-books

We know that each domain requires a different type of preparation, so we have divided our books in the same way:

1. 2200 Interview Questions to become Full Stack Analytics Professional – 2200 Most Asked Interview Questions
2.Data Scientist and Machine Learning Engineer -> 23 e-books covering all the ML Algorithms Interview Questions
3. 30 Days Analytics Course – Most Asked Interview Questions from 30 crucial topics

You can check out all the other e-books on our e-shop page – Do not miss it


For any information related to courses or e-books, please send an email to nitinkamal132@gmail.com

Data Analytics Interview Questions | Day 2

Welcome to the 2nd Day of Data Analytics Interview Questions Quiz.
You can go through the question and answer for Day 1 Here
The best answer to the quiz was provided by Raahul
Data Analytics Interview Questions

In this series, all you need to do is to go through the questions and try to attempt it with whatever knowledge you have.

Before or after you attempt the questions, do go through the complete road map about what you need to study to crack an analytics role. We have covered from 3rd year college student to 8 years of analytics or non-analytics experience. Make sure you understand where to emphasize more(after all by the end of the day you want to crack an interview)

Complete Roadmap for cracking an Analytics Role in the next 30 days

Now, coming back to our questions. Remember, these are the most asked questions in any interview, if you are shy to answer the questions in the comment section, then do make sure to Google the answer and jot it down in your notebook.

Data Analytics Interview Questions

SQL

  1. Write the sequence of the commands in which it is executed in the backend of SQL. (Most asked interview question)
  2. What is the difference between HAVING and WHERE in SQL?
  3. What is the use of Coalesce() function in SQL?

Python

  1. Create a list of a list
  2. Create a dictionary of list
  3. Is string mutable or immutable? Give an example

Case study

  1. KFC wants to open its first branch in India, what data points should be considered before it entering in a new market?

Machine Learning

  1. Define precision and recall using a simple example
  2. Can we use linear regression for a classification problem?

The Data Monk services

We are well known for our interview books and have 70+ e-book across Amazon and The Data Monk e-shop page . Following are best-seller combo packs and services that we are providing as of now

  1. YouTube channel covering all the interview-related important topics in SQL, Python, MS Excel, Machine Learning Algorithm, Statistics, and Direct Interview Questions
    Link – The Data Monk Youtube Channel
  2. Website – ~2000 completed solved Interview questions in SQL, Python, ML, and Case Study
    Link – The Data Monk website
  3. E-book shop – We have 70+ e-books available on our website and 3 bundles covering 2000+ solved interview questions. Do check it out
    Link – The Data E-shop Page
  4. Instagram Page – It covers only Most asked Questions and concepts (100+ posts). We have 100+ most asked interview topics explained in simple terms
    Link – The Data Monk Instagram page
  5. Mock Interviews/Career Guidance/Mentorship/Resume Making
    Book a slot on Top Mate

The Data Monk e-books

We know that each domain requires a different type of preparation, so we have divided our books in the same way:

1. 2200 Interview Questions to become Full Stack Analytics Professional – 2200 Most Asked Interview Questions
2.Data Scientist and Machine Learning Engineer -> 23 e-books covering all the ML Algorithms Interview Questions
3. 30 Days Analytics Course – Most Asked Interview Questions from 30 crucial topics

You can check out all the other e-books on our e-shop page – Do not miss it


For any information related to courses or e-books, please send an email to nitinkamal132@gmail.com

Analytics Interview Questions | Day 1

Analytics Interview Questions
In this series we will try to solve as many questions as possible in 4 areas, SQL, Python, Machine Learning Algorithms, and Miscellaneous. All you need to do is to comment your answers below and the best answer will get an extra e-book for free 😛

You need to attempt these questions, put everything in one comment, we will evaluate and will announce the winner in the next day’s post

Analytics Interview Questions

Analytics Interview Questions

We will follow the below pattern:
– SQL (3 Questions)
– Python (2 Questions)
– Case Study (1 Question)
– Machine Learning and Statistics (2 Questions)

SQL

  1. There are two tables X and Y, X has a column A that contains 4 rows -1,-1,-1,-1. Y has a column B that contains -1,-1,-1 (Most asked interview question)
    How many rows will be there if we do X left join Y
  2. What is the use of partition in a table?
  3. What is the difference between the Drop and Delete table? (Meesho, OYO rooms)

Python

  1. What is a mutable and immutable data type? (Most Asked Questions)
  2. How do you read a CSV file in Python?
  3. What is the syntax of group by in Python ?

Case Study

  1. For a particular e-commerce company, there has been a decline in the number and value of items stored in the cart. Tell all the possible reasons for this decline?

Machine Learning Concepts

  1. What is the p-value? Explain in a very layman term with simple example
  2. What is correlation? Explain with simple example

The Data Monk services

We are well known for our interview books and have 70+ e-book across Amazon and The Data Monk e-shop page . Following are best-seller combo packs and services that we are providing as of now

  1. YouTube channel covering all the interview-related important topics in SQL, Python, MS Excel, Machine Learning Algorithm, Statistics, and Direct Interview Questions
    Link – The Data Monk Youtube Channel
  2. Website – ~2000 completed solved Interview questions in SQL, Python, ML, and Case Study
    Link – The Data Monk website
  3. E-book shop – We have 70+ e-books available on our website and 3 bundles covering 2000+ solved interview questions. Do check it out
    Link – The Data E-shop Page
  4. Instagram Page – It covers only Most asked Questions and concepts (100+ posts). We have 100+ most asked interview topics explained in simple terms
    Link – The Data Monk Instagram page
  5. Mock Interviews/Career Guidance/Mentorship/Resume Making
    Book a slot on Top Mate

The Data Monk e-books

We know that each domain requires a different type of preparation, so we have divided our books in the same way:

1. 2200 Interview Questions to become Full Stack Analytics Professional – 2200 Most Asked Interview Questions
2.Data Scientist and Machine Learning Engineer -> 23 e-books covering all the ML Algorithms Interview Questions
3. 30 Days Analytics Course – Most Asked Interview Questions from 30 crucial topics

You can check out all the other e-books on our e-shop page – Do not miss it


For any information related to courses or e-books, please send an email to nitinkamal132@gmail.com

Unnest and Sequence in Presto SQL

Unnest Sequence in Presto SQL helps you to create a sequence of numbers, dates, etc. as a table and then to use that table. Unnest and sequence are two different functions but when used in a combination it can be very useful

Where to use Unnest and Sequence in Presto?
Suppose, you have a table where you store restaurant id, revenue, and date. Now, there are chances that some restaurants are not functional on a particular date, but in your query, you need to get the total number of restaurants functional(not operational) on a particular day.

This is a standard real-life problem, basically, you need to have a calendar table in your database where you have only dates. With this date column, you will do a cross join on the restaurant table. Now, you will have all the dates for each restaurant. All, you need to do now is to take up the count distinct of the hotel_ids for a particular day.

Sample SQL code to create a sequence

select x
from unnest(sequence(date ‘2020-01-01’, date ‘2022-03-31’)) t(x)

The above command will create a column x with values starting from 2020 till 31st March 2022. Actually, the sequence will create the data in one row, and unnest will explode that row.

Sequence command
sequence (start, stop, step)
In the sequence function, you can also add steps like below

select x
from unnest(sequence(date ‘2020-01-01’, date ‘2022-03-31’, Interval ‘2’ day)) t(x)

The above code will create the column x for dates separated by 2 days.

SELECT x FROM UNNEST(sequence(200, 120, -3)) t(x)

Unnest Sequence in Presto SQL

Sample code to plug it into your report

select t.id,s.dt
from mytable t
cross join unnest(sequence(date(t.start_dt), date(t.end_dt))) as s(dt)

Now, here you took the column id and did a cross join on the sequence date column. This will result in creating two columns i.e. id and all the dates

This is a simple concept but is asked as a part of a larger problem in an interview.

The Data Monk services

We are well known for our interview books and have 70+ e-book across Amazon and The Data Monk e-shop page . Following are best-seller combo packs and services that we are providing as of now

  1. YouTube channel covering all the interview-related important topics in SQL, Python, MS Excel, Machine Learning Algorithm, Statistics, and Direct Interview Questions
    Link – The Data Monk Youtube Channel
  2. Website – ~2000 completed solved Interview questions in SQL, Python, ML, and Case Study
    Link – The Data Monk website
  3. E-book shop – We have 70+ e-books available on our website and 3 bundles covering 2000+ solved interview questions. Do check it out
    Link – The Data E-shop Page
  4. Instagram Page – It covers only Most asked Questions and concepts (100+ posts). We have 100+ most asked interview topics explained in simple terms
    Link – The Data Monk Instagram page
  5. Mock Interviews/Career Guidance/Mentorship/Resume Making
    Book a slot on Top Mate

The Data Monk e-books

We know that each domain requires a different type of preparation, so we have divided our books in the same way:

1. 2200 Interview Questions to become Full Stack Analytics Professional – 2200 Most Asked Interview Questions
2.Data Scientist and Machine Learning Engineer -> 23 e-books covering all the ML Algorithms Interview Questions
3. 30 Days Analytics Course – Most Asked Interview Questions from 30 crucial topics

You can check out all the other e-books on our e-shop page – Do not miss it


For any information related to courses or e-books, please send an email to nitinkamal132@gmail.com

Python Interview Questions for Analysts – 5-10

Python Interview Questions for Analysts will help you understand the type of questions that you can expect in an analytics interview. Product-based companies mostly focus on asking at least 5-7 Python questions around the basic logic like Palindrome, rotating an array, sum of diagonal, string, Armstrong numbers, etc. to check the experience of the candidate in Python. We will have a complete set of 200 questions to make sure you can handle these questions like a breeze

Python Interview Questions for Analysts



Link to Question 1 to 5

Python Interview Questions for Analysts

6. Check if a number is prime or not

x = int(input("Enter a number = "))
if x > 1:
for i in range(2,int(x/2)+1):
if (x%i == 0):
print("Not a Prime Number")
break
else:
print("Prime Number")
else:
print("Not a prime number, infact it is a negative number")

7. Prime number in a list of numbers with starting and endpoint

x = int(input("Enter a starting point = "))
y = int(input("Enter an ending point = "))
def prime(x,y):
prime = []
for i in range(x,y):
if (i == 0 or i == 1):
continue
else:
for j in range(2,int(i/2)+1):
if(i%j == 0):
break
else:
prime.append(i)
return prime
print("The list of prime numbers are = ", prime(x,y))

8.Fibonacci Series 0,1,1,2,3,5,8,13…

x = int(input("Enter the n-th fibonacci series number = "))
def fib(x):
if x<=0:
print("Incorrect number")
elif x==1:
return 0
elif x==2:
return 1
else:
return fib(x-1)+fib(x-2)
print("Fibonacci number on the n-th place is ", fib(x))

Python Interview Questions for Analysts

9. check if a given number is a perfect square or not

n = int(input("Enter a number = "))
def sq(n):
s = int(math.sqrt(n))
return s*s == n
print("The status of number = " , sq(n))

10. Print ASCII value of a character in python

x = input("Take a character")
print("The ASCII Value of the character is ", ord(x))

The Data Monk services

We are well known for our interview books and have 70+ e-book across Amazon and The Data Monk e-shop page . Following are best-seller combo packs and services that we are providing as of now

  1. YouTube channel covering all the interview-related important topics in SQL, Python, MS Excel, Machine Learning Algorithm, Statistics, and Direct Interview Questions
    Link – The Data Monk Youtube Channel
  2. Website – ~2000 completed solved Interview questions in SQL, Python, ML, and Case Study
    Link – The Data Monk website
  3. E-book shop – We have 70+ e-books available on our website and 3 bundles covering 2000+ solved interview questions. Do check it out
    Link – The Data E-shop Page
  4. Instagram Page – It covers only Most asked Questions and concepts (100+ posts). We have 100+ most asked interview topics explained in simple terms
    Link – The Data Monk Instagram page
  5. Mock Interviews/Career Guidance/Mentorship/Resume Making
    Book a slot on Top Mate

The Data Monk e-books

We know that each domain requires a different type of preparation, so we have divided our books in the same way:

1. 2200 Interview Questions to become Full Stack Analytics Professional – 2200 Most Asked Interview Questions
2.Data Scientist and Machine Learning Engineer -> 23 e-books covering all the ML Algorithms Interview Questions
3. 30 Days Analytics Course – Most Asked Interview Questions from 30 crucial topics

You can check out all the other e-books on our e-shop page – Do not miss it


For any information related to courses or e-books, please send an email to nitinkamal132@gmail.com

Python Analytics interview questions 1-5

Python Analytics interview questions
In this series, we will add some of the basic questions to start with Python. Slowly we will move to moderate level DSA questions followed by Pandas, Numpy, and OS module.
All you need to do is to install Python in your system and start from scratch.

Python Analytics interview questions



We will try to solve each question in multiple ways, if you are missing out on the basics then do consult Tutorialspoint or w3school. Invest around 6 hours on these websites and you should be good to go

Python Analytics interview questions

Python Basic Question

1. Take input of two numbers from users and find out the maximum

a = input("Enter first number :")
b = input("Enter second number ")
if a>b:
print(a + " is greater than " + b)
else:
print(b + " is greater than "+a)

or

a = 30
b = 40
print(a if a>b else b)

or

a = 10
b = 30
c = max(a,b)
print(c)

2. Print the factorial of any number

a = 10
def fact(n):
if (n == 1 or n==0):
return 1
else:
return n*fact(n-1)
print(fact(5))

or

import math
print(math.factorial(5))
Python Analytics interview questions



3. Get square of the number if the number is odd and cube if even

def yoo(n):
if (n%2 == 0):
return nnn
else:
return n*n
print(yoo(3))
print(yoo(2))



4. Print square of first n natural numbers

x = int(input("Enter a natural number = "))
def sum_of_natural(x):
ss = 0
for i in range(1,x):
ss = ss+(i*i)
return ss
print("Sum of square of natural numbers are = " , sum_of_natural(x))
Python Analytics interview questions



5. Find if a number is an Armstrong number.

Example – 153 is an Armstrong number as 1^3+5^3+3^3 = 153

num = int(input("Enter a number = "))
s = 0
x = num
while (x >0 ):
digit = x%10
s = s+(digitdigitdigit)
x = x//10
print(s)
print("Armstrong" if s == num else "Not Armstrong")
Python Analytics interview questions


The Data Monk services

We are well known for our interview books and have 70+ e-book across Amazon and The Data Monk e-shop page . Following are best-seller combo packs and services that we are providing as of now

  1. YouTube channel covering all the interview-related important topics in SQL, Python, MS Excel, Machine Learning Algorithm, Statistics, and Direct Interview Questions
    Link – The Data Monk Youtube Channel
  2. Website – ~2000 completed solved Interview questions in SQL, Python, ML, and Case Study
    Link – The Data Monk website
  3. E-book shop – We have 70+ e-books available on our website and 3 bundles covering 2000+ solved interview questions. Do check it out
    Link – The Data E-shop Page
  4. Instagram Page – It covers only Most asked Questions and concepts (100+ posts). We have 100+ most asked interview topics explained in simple terms
    Link – The Data Monk Instagram page
  5. Mock Interviews/Career Guidance/Mentorship/Resume Making
    Book a slot on Top Mate

The Data Monk e-books

We know that each domain requires a different type of preparation, so we have divided our books in the same way:

1. 2200 Interview Questions to become Full Stack Analytics Professional – 2200 Most Asked Interview Questions
2.Data Scientist and Machine Learning Engineer -> 23 e-books covering all the ML Algorithms Interview Questions
3. 30 Days Analytics Course – Most Asked Interview Questions from 30 crucial topics

You can check out all the other e-books on our e-shop page – Do not miss it


For any information related to courses or e-books, please send an email to nitinkamal132@gmail.com