Logistic Regression Interview Questions – Part 3

Q1. What is accuracy?
Accuracy is the number of correct predictions out of all predictions made.

Accuracy=True Positives+True NegativesTotal Number of Predictions

Q2. Why is accuracy not a good measure for classification problems?
Accuracy is not a good measure for classification problems because it gives equal importance to both false positives and false negatives. However, this may not be the case in most business problems. For example, in the case of cancer prediction, declaring cancer as benign is more serious than wrongly informing the patient that he is suffering from cancer. Accuracy gives equal importance to both cases and cannot differentiate between them.

Read More…

Logistic Regression Interview Questions – Part 2

Q1. What is the Maximum Likelihood Estimator (MLE)?
 The MLE chooses those sets of unknown parameters (estimator) that maximise the likelihood function. The method to find the MLE is to use calculus and setting the derivative of the logistic function with respect to an unknown parameter to zero, and solving it will give the MLE. For a binomial model, this will be easy, but for a logistic model, the calculations are complex. Computer programs are used for deriving MLE for logistic models.

(Here’s another approach to answering the question.)

Read More…

Basics of OSPF

OSPF is by far the most popular and important protocol in use today.

Most important features of OSPF:

  1. Its open source !
  2. Very fast convergence time, ( a tad close to even EIGRP )
  3. Link-state routing protocol
  4. Supports multiple, equal cost routes to the same destination
  5. Supports both IPv4 and IPv6
  6. Uses Dijkstra’s algorithm to find the shortest path tree and follows that by populating the routing table with resulting best path.
  7. Allows creation of areas and autonomous system
  8. Minimizes routing update traffic
  9. Supports VLSM/CIDR
  10. Unlimited hop count (unlike RIP)
  11. Supports Multi-vendor deployment.
Read More…

Logistic Regression Interview Questions – Part 1

Q1. What is a logistic function? What is the range of values of a logistic function?
The logistic function is as defined below:

                                                                           f(z)=1(1+e−z)

The values of a logistic function will range from 0 to 1. The values of Z will vary from −∞ to +∞.

Read More…

Inferential Statistics – Part 1

Introduction: Inferential Statistics :

The process of “inferring” insights from sample data is called “Inferential Statistics”

Basics of Probability:

In the topic we will go through:

  • Basic definition of probability
  • Multiplication rule of probability
  • Addition rule of probability
  • nCr (Combinatorics)

Random Variables

Random variables are quantities with distinct characteristics and behavior.

  1. Random variables are denoted by capital letters
  2. Random variables are associated with random processes
  3. Random variables give numbers to outcomes of random events.
Read More…

Networking Interview Question – Switching

Top questions for switching !

  1. What is switching?
  2. Explain Ethernet Header?
  3. What is ARP?
  4. Explaining what is Proxy ARP, Gratuitous ARP, and Reverse ARP?
  5. What are the types of ARP packets?
  6. Explain ARP Header?
  7. Explaining end to end flow of ARP?
  8. Explain the ARP table?
  9. What are the important codes of ICMP?
  10. Hubs belong to one collision domain. Why?
  11. How are collision and broadcast domains defined in a L2switch?
  12. What is the standard range of VLANs? What is an extended range of VLANs? What are the reserved VLANs? When to use standard and extended VLANs?
  13. Why is the maximum number of VLANs 4096?
  14. What is the use of Management VLAN?
  15. What is a Native VLAN and why is it used? Do we need Native VLAN in new networks and how to disable it if not needed?
  16. How to configure interfaces in VLANs?
  17. How does the switch store all VLAN information?
  18. What is an access port?
  19. What is a trunk port?
  20. Types of frame tagging protocols?
  21. Explain diff between ISL and 802.1q ?
  22. Explain 802.1q header?
  23. Explain ISL header?
  24. How to configure access port and a trunk port?
  25. Troubleshooting trunk , what parameters should match on both sides of the trunk?
  26. What is VTP? Difference between VTP version 1,2,3?
  27. What are VTP different modes?
  28. What is a revision number and how to change a revision number when implementing a old switch in net network topology?
  29. What is VTP pruning?
  30. What are the advantages of linkgroups?
  31. What are the max number of links supported on a linkgroup when manually configured?
  32. What are max number of linkgroups supported on a switch?
  33. What are the match criteria for ether channel ports to be actve?
  34. Explain load balancing on etherchannel?
  35. Explain load balancing in etherchannel when source IP is used and when destination IP is used?
  36. Why do we use dynamic link aggregation protocol when we have a manual configuration possible?
  37. Which IP address and MAC address are used for link group?
  38. What is LACP
  39. What is the advantage of LACP? 8 ports as active and 8 ports as standby.
  40. How LACP works? How to decide which ports are active and which are standby?
  41. How to configure VRRP?
  42. Explain Packet of VRRP advertisement?
  43. How to load balance using VRRP?
  44. How pre-emption works in VRRP?
  45. What MAC address is used in VRRPs Virtual IP address?
  46. How does VRRP advertisements work?
  47. Explain the states of VRRP?
  48. How to implement switch port security?
  49. What is the use of private VLAN?
  50. What are the types of secondary VLANs?
  51. How to configure Private VLANs?
  52. What is DHCP spoofing? How is it implemented?
  53. What are Dynamic ARP inspections and how is it implemented?
  54. Explain ways of inter-VLAN communication?
  55. What is used by STP to build its topology?
  56. How often are BPDU sent out? To which address? On which interfaces?
  57. Explain the STP convergence process?
  58. Does STP support a backup root bridge?
  59. What is root secondary?
  60. Explain STP convergence with 3 switch, 4 switch and 5 switch diagram?
  61. Explain the STP port states?
  62. Explain STP timers? Explain why they are used and what is the default value of each?
  63. Explain BPDU packet format?
  64. Explain BPDU message types and when they are used?
  65. BPDU Flags?
  66. Explain How STP converges? 1) if direct topology change 2) indirect topology change 3) if insignificant topology change . Explain with diagram of three switch and 5 switch. What happens if a root port goes down? What happens if the designated port goes down?
  67. How to improve STP convergence times? 1) Port fast(blocking to forwarding direct and no TCN bpdu generated ) 2)uplink fast(forwarding delay eradicated by keeping standby port) 3) backbone fast (max age is eradicated)
  68. How will you protect against unexpected loss of BPDU?
  69. Explain RSTP port roles?
  70. Explain RSPT port states?
  71. Explain RSTP types of Ports ?
  72. Explain RSTP convergence process?
  73. Explain how RSTP handles Topology change?
  74. Difference between RSTP and STP?
  75. Explain MSTP .
  76. What is Multi VLAN port ?
  77. What is QinQ ( 802.1Q tunneling ) ?
  78. Explain Dynamic Trunking Protocol (DTP)
  79. What is VLAN Hopping?
  80. Explain Unidirectional Link Detection (UDLD)

Watch out for this space as this is a growing thread !

Categories: Networking, Programming

Data Analysis using SQL – Part 3 – Advanced SQL

Data Analysis using SQL – Part 3 – Advanced SQL

You now know two types of SQL commands, namely:

  • Data Definition Language
  • Data Manipulation Language

The Data Definition Language (DDL) is used to create and modify the schema of the database. Commands like CREATE, ALTER and DROP are part of this language.

As a data analyst, you would always be actively involved in data retrieval activities. Here, the Data Manipulation Language (DML) commands would come in handy, e.g. the DML command SELECT, its purpose, various clauses and filtering operations.

Order by Clause

The SQL ORDER BY clause is used to sort the data in ascending or descending order, based on one or more columns. Some databases sort the query results in an ascending order by default.

The basic syntax of the ORDER BY clause is as follows −

SELECT column-list 
FROM table_name 
[WHERE condition] 
[ORDER BY column1, column2, .. columnN] [ASC | DESC];

The order in which it appears is “select * from table where some_variable = x order by some_variable”. 

Read More…

Data Analysis using SQL – Part 2 – Database design

Data Analysis using SQL – Part 2 – Database design

Defining Data Warehouse

A data warehouse would be a central repository of the data of the entire enterprise.

A data warehouse is a collection of data. It exhibits the following properties:

  • Subject-oriented: A data warehouse should contain information about a few well-defined subjects rather than containing information about the entire enterprise.
  • Integrated: A data warehouse is an integrated repository of data. It contains information from various systems within an organisation.
  • Non-volatile: Data values cannot be changed without a valid reason.
  • Time-variant: A data warehouse contains historical data for analysis.

Structure of Data Warehouse

One of the primary methods of designing a data warehouse is called dimensional modelling.

The two key elements of dimensional modelling are facts and dimensions, which are basically different types of variables used to design a warehouse. They are arranged together in a specific way known as a schema diagram.

OLAP vs. OLTP

What is OLAP?

Online Analytical Processing, a category of software tools which provide analysis of data for business decisions. OLAP systems allow users to analyze database information from multiple database systems at one time.

The primary objective is data analysis and not data processing.

What is OLTP?

Online transaction processing shortly known as OLTP supports transaction-oriented applications in a 3-tier architecture. OLTP administers day to day transaction of an organization.

The primary objective is data processing and not data analysis

Example of OLAP

Any Datawarehouse system is an OLAP system. Uses of OLAP are as follows

  • A company might compare their mobile phone sales in September with sales in October, then compare those results with another location which may be stored in a sperate database.
  • Amazon analyzes purchases by its customers to come up with a personalized homepage with products which likely interest to their customer.

Example of OLTP system

An example of OLTP system is ATM center. Assume that a couple has a joint account with a bank. One day both simultaneously reach different ATM centers at precisely the same time and want to withdraw total amount present in their bank account.

However, the person that completes authentication process first will be able to get money. In this case, OLTP system makes sure that withdrawn amount will be never more than the amount present in the bank. The key to note here is that OLTP systems are optimized for transactional superiority instead data analysis.

Other examples of OLTP system are:

  • Online banking
  • Online airline ticket booking
  • Sending a text message
  • Order entry
  • Add a book to shopping cart

Star Schema

Facts and dimensions are the two key elements of dimension modelling. A typical problem might involve multiple databases with many different variables and we may not be interested in all the variables. Hence, only some facts and dimensions are combined in a specific manner to create the structure of data warehouse. This structure is called as a schema diagram


A schema is an outline of the entire data warehouse. It shows how different data sets are connected and the different attributes of each data being used for the data warehouse.

Summary

You learnt about what a data warehouse is and the difference between a data warehouse and a transactional database. You learnt that OLAP systems are Subject-oriented, Integrated, Non-volatile and Time variant. 

You learnt that the data warehouse gives an integrated view of the entire organisation and the data is organised for efficiently carrying out analysis. You also learnt the difference between a data warehouse and a transactional database.

You also learnt about facts and dimensions. You also learnt how to arrange facts and dimensions to design a data warehouse. You saw how dimension tables act as the metadata that is the data about data and they enhance the facts table to enhance insights about the data.

Data Analysis using SQL – Basics of SQL – Part 1

Data anaylysis using SQL part 1

An introduction to RDBMS and SQL

There are various ways to arrange and manage data in a database. The most common is to arrange the data in tables, which is similar to an Excel file. The table contains multiple columns and rows.

A Database is a collection of related data. But a question still remains unanswered — how do you access this data? The answer is a specific language designed for this purpose, called the Structured Query Language, or SQL.

Concepts

Tables − In relational data model, relations are saved in the format of Tables. This format stores the relation among entities. A table has rows and columns, where rows represents records and columns represent the attributes.

Tuple − A single row of a table, which contains a single record for that relation is called a tuple.

Relation instance − A finite set of tuples in the relational database system represents relation instance. Relation instances do not have duplicate tuples.

Read More…
Categories: Machine Learning Tags: Tags: ,

Euler Problem 4: Largest palindrome product : C Programming Solution

Problem 4: 

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.

Find the largest palindrome made from the product of two 3-digit numbers.

Solution Approach:

Brute force method:

  1. Create a function that checks a number for being a palindrome.
  2. keep multiplying the numbers from 999 X 999 decretmenting one at a time.
  3. Find the multiplication and get the highest product and  print

Read More…

Categories: Programming

Warning: Unknown: write failed: Disk quota exceeded (122) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/cpanel/php/sessions/ea-php74) in Unknown on line 0