Coding Interview ⛥
1.5K subscribers
115 photos
215 files
30 links
This channel contains the free resources and solution of coding problems which are usually asked in the interviews.
Download Telegram
2nd principle of software design

KISS (Keep It Simple, Stupid): Simple solutions are easier to understand, maintain, and extend. This principle encourages avoiding unnecessary complexity and favoring straightforward, easy-to-understand designs.
🔥1
Guys, kindly Add this folders -> https://t.me/addlist/wcoDjKedDTBhNzFl
1
Date: 15-02-2024
Company name : Walmart
Role: ML Engineer
Topic: Cross validation, bagging, boosting, sampling

1. What is Cross-validation in Machine Learning?

Cross-validation is a resampling method that uses different portions of the data to test and train a model on different iterations. It is mainly used in settings where the goal is prediction, and one wants to estimate how accurately a predictive model will perform in practice This sampling process is done to break the dataset into smaller parts that have the same number of rows, out of which a random part is selected as a test set and the rest of the parts are kept as train sets. Cross-validation consists of the following techniques:
• Holdout method
• K-fold cross-validation
• Stratified k-fold cross-validation
• Leave p-out cross-validation


2. What is bagging and boosting in Machine Learning?

Bagging is a homogeneous weak learners’ model that learns from each other independently in parallel and combines them for determining the model average.

Boosting is also a homogeneous weak learners’ model but works differently from Bagging. In this model, learners learn sequentially and adaptively to improve model predictions of a learning algorithm.


3.What is systematic sampling and cluster sampling ?

Systematic sampling is a type of probability sampling method. The sample members are selected from a larger population with a random starting point but a fixed periodic interval. This interval is known as the sampling interval. The sampling interval is calculated by dividing the population size by the desired sample size.

Cluster sampling involves dividing the sample population into separate groups, called clusters. Then, a simple random sample of clusters is selected from the population. Analysis is conducted on data from the sampled clusters.

4.What is market basket analysis?

Market Basket Analysis is a modeling technique based upon the theory that if you buy a certain group of items, you are more (or less) likely to buy another group of items.
Answers for this👀

🔺Basic SQL Concepts:
SQL vs NoSQL: SQL is relational, structured, and uses a predefined schema. NoSQL is non-relational, flexible, and schema-less.
Common Data Types: Examples include INT, VARCHAR, DATE, and BOOLEAN.

🔺Querying:
Retrieve all records from "Customers": SELECT * FROM Customers;
SELECT vs SELECT DISTINCT: SELECT retrieves all rows, while SELECT DISTINCT returns only unique values.
WHERE clause: Filters data based on specified conditions.

🔺Joins:
Types of Joins: INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN.
INNER JOIN example: SELECT * FROM Table1 INNER JOIN Table2 ON Table1.ID = Table2.ID;

🔺Aggregate Functions:
Aggregate Functions: Examples include COUNT, AVG, SUM.
Calculate average, sum, count: SELECT AVG(column), SUM(column), COUNT(column) FROM Table;

🔺Grouping and Filtering:
GROUP BY clause: Groups results based on specified columns.
HAVING clause: Filters grouped results.

🔺Subqueries:
Subquery: A query within another query. Example: SELECT column FROM Table WHERE column = (SELECT MAX(column) FROM Table);

🔺Indexes and Optimization:
Importance of Indexes: Improve query performance by speeding up data retrieval.
Optimize slow query: Add indexes, optimize queries, and consider database design.

🔺Normalization and Data Integrity:
Normalization: Organizing data to reduce redundancy and dependency.
Data Integrity: Enforce rules to maintain accuracy and consistency.

🔺Transactions:
SQL Transaction: A sequence of one or more SQL statements treated as a single unit.
ACID properties: Atomicity, Consistency, Isolation, Durability.

🔺Views and Stored Procedures:
Database View: Virtual table based on the result of a SELECT query.
Stored Procedure: Precompiled SQL code stored in the database for reuse.

🔺Advanced SQL:
Recursive SQL query: Used for hierarchical data.
Window Functions: Perform calculations across a set of rows related to the current row.

React❤️👉 to this if you like the post
👍1
SQL Cheat Sheet for Data Analysts.pdf
6.8 MB
SQL Cheat Sheet for Data Analysts.pdf
Let's start with Python Learning Series today 💪

Complete Python Topics for Data Analysis

Introduction to Python.

1. Variables, Data Types, and Basic Operations:
   - Variables: In Python, variables are containers for storing data values. For example:
   
     age = 25
     name = "John"
    

   - Data Types: Python supports various data types, including int, float, str, list, tuple, and more. Example:
   
     height = 1.75  # float
     colors = ['red', 'green', 'blue']  # list
    

   - Basic Operations: You can perform basic arithmetic operations:
   
     result = 10 + 5
    

2. Control Structures (If Statements, Loops):
   - If Statements: Conditional statements allow you to make decisions in your code.
   
     age = 18
     if age >= 18:
         print("You are an adult.")
     else:
         print("You are a minor.")
    

   - Loops (For and While): Loops are used for iterating over a sequence (string, list, tuple, dictionary, etc.).
   
     fruits = ['apple', 'banana', 'orange']
     for fruit in fruits:
         print(fruit)
    

3. Functions and Modules:
   - Functions: Functions are blocks of reusable code. Example:
   
     def greet(name):
         return f"Hello, {name}!"

     result = greet("Alice")
    

   - Modules: Modules allow you to organize code into separate files. Example:
   
     # mymodule.py
     def multiply(x, y):
         return x * y

     # main script
     import mymodule
     result = mymodule.multiply(3, 4)
    

Understanding these basics is crucial as they lay the foundation for more advanced topics.


Hope it helps :)
This is how ML works
Java interview questions.pdf
506.4 KB
Java interview questions.pdf
👍2🎉1
Date: 23-02-2024
Company name: Oracle
Role: Data Analyst
Topic: outlier, dax, filter, recursive stored procedure

1. What are the ways to detect outliers?

Outliers are detected using two methods:

Box Plot Method: According to this method, the value is considered an outlier if it exceeds or falls below 1.5*IQR (interquartile range), that is, if it lies above the top quartile (Q3) or below the bottom quartile (Q1).

Standard Deviation Method: According to this method, an outlier is defined as a value that is greater or lower than the mean ± (3*standard deviation).


2. What is a Recursive Stored Procedure?

A stored procedure that calls itself until a boundary condition is reached, is called a recursive stored procedure. This recursive function helps the programmers to deploy the same set of code several times as and when required.


3. What is the shortcut to add a filter to a table in EXCEL?

The filter mechanism is used when you want to display only specific data from the entire dataset. By doing so, there is no change being made to the data. The shortcut to add a filter to a table is Ctrl+Shift+L.

4. What is DAX in Power BI?

DAX stands for Data Analysis Expressions. It's a collection of functions, operators, and constants used in formulas to calculate and return values. In other words, it helps you create new info from data you already have.

————————————————————-


Stay Safe & Happy Learning💙
👍2
Date: 22-02-2024
Company name: IKEA
Role: Data Analyst
Topic: Statistics, SQL

1. How can we deal with problems that arise when the data flows in from a variety of sources?

There are many ways to go about dealing with multi-source problems. However, these are done primarily to solve the problems of:

Identifying the presence of similar/same records and merging them into a single recordRe-structuring the schema to ensure there is good schema integration


2.  Where is Time Series Analysis used?

Since time series analysis (TSA) has a wide scope of usage, it can be used in multiple domains. Here are some of the places where TSA plays an important role:

Statistics
Signal processing
Econometrics
Weather forecasting
Earthquake prediction
Astronomy
Applied science


3. What are the ideal situations in which t-test or z-test can be used?

It is a standard practice that a t-test is used when there is a sample size less than 30 and the z-test is considered when the sample size exceeds 30 in most cases.


4. What is the usage of the NVL() function?

The NVL() function is used to convert the NULL value to the other value. The function returns the value of the second parameter if the first parameter is NULL. If the first parameter is anything other than NULL, it is left unchanged. This function is used in Oracle, not in SQL and MySQL. Instead of NVL() function, MySQL have IFNULL() and SQL Server have ISNULL() function.


5. What is the difference between DROP and TRUNCATE commands?

If a table is dropped, all things associated with that table are dropped as well. This includes the relationships defined on the table with other tables, access privileges, and grants that the table has, as well as the integrity checks and constraints. 

However, if a table is truncated, there are no such problems as mentioned above. The table retains its original structure and the data is dropped.

————————————————————-

Stay Safe & Happy Learning💙
🔥1
Date - 26-02-2024
Company name: IBM
Role: Data Analyst
Topic: rank vs dense rank, Join, OLTP, Joining vs blending, worksheet excel

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 is the difference between the RANK() and DENSE_RANK() functions?

The RANK() function in the result set defines the rank of each row within your ordered partition. If both rows have the same rank, the next number in the ranking will be the previous rank plus a number of duplicates. If we have three records at rank 4, for example, the next level indicated is 7. The DENSE_RANK() function assigns a distinct rank to each row within a partition based on the provided column value, with no gaps. If we have three records at rank 4, for example, the next level indicated is 5.
🔥1
Google announces VideoPrism

A Foundational Visual Encoder for Video Understanding
👎1
Date: 01-03-2024
Company Name - Nestle
Role: Data Analyst
Topic - SQL and Tableau

1. Explain character-manipulation functions? Explains its different types in SQL.

Change, extract, and edit the character string using character manipulation routines. The function will do its action on the input strings and return the result when one or more characters and words are supplied into it.

The character manipulation functions in SQL are as follows:

A) CONCAT (joining two or more values): This function is used to join two or more values together. The second string is always appended to the end of the first string.

B) SUBSTR: This function returns a segment of a string from a given start point to a given endpoint.

C) LENGTH: This function returns the length of the string in numerical form, including blank spaces.

D) INSTR: This function calculates the precise numeric location of a character or word in a string.

E) LPAD: For right-justified values, it returns the padding of the left-side character value.

F) RPAD: For a left-justified value, it returns the padding of the right-side character value.

G) TRIM: This function removes all defined characters from the beginning, end, or both ends of a string. It also reduced the amount of wasted space.

H) REPLACE: This function replaces all instances of a word or a section of a string (substring) with the other string value specified.


2. How Do You Calculate the Daily Profit Measures Using LOD?

LOD expressions allow us to easily create bins on aggregated data such as profit per day.

Scenario: We want to measure our success by the total profit per business day.

Create a calculated field named LOD - Profit per day and enter the formula:

FIXED [Order Date] : SUM ([Profit])

Create another calculated field named LOD - Daily Profit KPI and enter the formula:

IF [LOD - Profit per day] > 2000 then “Highly Profitable.”

ELSEIF [LOD - Profit per day] <= 0 then “Unprofitable”

ELSE “Profitable”

END

To calculate daily profit measure using LOD, follow these steps to draw the visualization:

Bring YEAR(Order Date) and MONTH(Order Date) to the Columns shelf
Drag Order Id field to Rows shelf. Right-click on it, select Measure and click on Count(Distinct)
Drag LOD - Daily Profit KPI to the Rows shelf
Bring LOD - Daily Profit KPI to marks card and change mark type from automatic to area.

3. What are Superkey and candidate key?

A super key may be a single or a combination of keys that help to identify a record in a table. Know that Super keys can have one or more attributes, even though all the attributes are not necessary to identify the records.

A candidate key is the subset of Superkey, which can have one or more than one attributes to identify records in a table. Unlike Superkey, all the attributes of the candidate key must be helpful to identify the records.

Note that all the candidate keys can be Super keys, but all the super keys cannot be candidate keys.


4.What is Database Cardinality?

Database Cardinality denotes the uniqueness of values in the tables. It supports optimizing query plans and hence improves query performance. There are three types of database cardinalities in SQL, as given below:

Higher Cardinality
Normal Cardinality
Lower Cardinality

————————————————————-
👍1🔥1
🔥2
Interview QnA | Date: 09-03-2024
Company name: Fractal Analytics
Role: Data Scientist
Topic : Machine learning, deep learning

1.What is the difference between Deep Learning and Machine Learning?

Deep Learning allows machines to make various business-related decisions using artificial neural networks that simulate the human brain, which is one of the reasons why it needs a vast amount of data for training. Machine Learning gives machines the ability to make business decisions without any external help, using the knowledge gained from past data. Machine Learning systems require relatively small amounts of data to train themselves, and most of the features need to be manually coded and understood in advance.

2.What is Cross-validation in Machine Learning?

Cross-validation allows a system to increase the performance of the given Machine Learning algorithm. This sampling process is done to break the dataset into smaller parts that have the same number of rows, out of which a random part is selected as a test set and the rest of the parts are kept as train sets. Cross-validation consists of the following techniques:
•Holdout method
•K-fold cross-validation
•Stratified k-fold cross-validation
•Leave p-out cross-validation

3.What is Epoch in Machine Learning?

Epoch in Machine Learning is used to indicate the count of passes in a given training dataset where the Machine Learning algorithm has done its job. Generally, when there is a large chunk of data, it is grouped into several batches. All these batches go through the given model, and this process is referred to as iteration. Now, if the batch size comprises the complete training dataset, then the count of iterations is the same as that of epochs.

4. What is Dimensionality Reduction?

In the real world, Machine Learning models are built on top of features and parameters. These features can be multidimensional and large in number. Sometimes, the features may be irrelevant and it becomes a difficult task to visualize them. This is where dimensionality reduction is used to cut down irrelevant and redundant features with the help of principal variables. These principal variables conserve the features, and are a subgroup, of the parent variables.
Here are the 50 JavaScript interview questions for 2024

1. What is JavaScript?
2. What are the data types in JavaScript?
3. What is the difference between null and undefined?
4. Explain the concept of hoisting in JavaScript.
5. What is a closure in JavaScript?
6. What is the difference between “==” and “===” operators in JavaScript?
7. Explain the concept of prototypal inheritance in JavaScript.
8. What are the different ways to define a function in JavaScript?
9. How does event delegation work in JavaScript?
10. What is the purpose of the “this” keyword in JavaScript?
11. What are the different ways to create objects in JavaScript?
12. Explain the concept of callback functions in JavaScript.
13. What is event bubbling and event capturing in JavaScript?
14. What is the purpose of the “bind” method in JavaScript?
15. Explain the concept of AJAX in JavaScript.
16. What is the “typeof” operator used for?
17. How does JavaScript handle errors and exceptions?
18. Explain the concept of event-driven programming in JavaScript.
19. What is the purpose of the “async” and “await” keywords in JavaScript?
20. What is the difference between a deep copy and a shallow copy in JavaScript?
21. How does JavaScript handle memory management?
22. Explain the concept of event loop in JavaScript.
23. What is the purpose of the “map” method in JavaScript?
24. What is a promise in JavaScript?
25. How do you handle errors in promises?
26. Explain the concept of currying in JavaScript.
27. What is the purpose of the “reduce” method in JavaScript?
28. What is the difference between “null” and “undefined” in JavaScript?
29. What are the different types of loops in JavaScript?
30. What is the difference between “let,” “const,” and “var” in JavaScript?
31. Explain the concept of event propagation in JavaScript.
32. What are the different ways to manipulate the DOM in JavaScript?
33. What is the purpose of the “localStorage” and “sessionStorage” objects?
34. How do you handle asynchronous operations in JavaScript?
35. What is the purpose of the “forEach” method in JavaScript?
36. What are the differences between “let” and “var” in JavaScript?
37. Explain the concept of memoization in JavaScript.
38. What is the purpose of the “splice” method in JavaScript arrays?
39. What is a generator function in JavaScript?
40. How does JavaScript handle variable scoping?
41. What is the purpose of the “split” method in JavaScript?
42. What is the difference between a deep clone and a shallow clone of an object?
43. Explain the concept of the event delegation pattern.
44. What are the differences between JavaScript’s “null” and “undefined”?
45. What is the purpose of the “arguments” object in JavaScript?
46. What are the different ways to define methods in JavaScript objects?
47. Explain the concept of memoization and its benefits.
48. What is the difference between “slice” and “splice” in JavaScript arrays?
49. What is the purpose of the “apply” and “call” methods in JavaScript?
50. Explain the concept of the event loop in JavaScript and how it handles asynchronous operations.
👍1