Microsoft phone screen but on-site


I didn’t answer well on the machine learning questions, need to prepare better for the decision tree concepts.
Coding questions:Question 1. How to get the average of all the number in a huge table in SQL?He gave me hints that I need to pay attention to the NULL value in the column. So basically, I need to treat all null value as 0 in the table. I didn’t manage to provide the right answer iin SQL.SELECT (SUM(col1) + SUM(col2) + SUM(col3)) / (COUNT(col1) + COUNT(col2) + COUNT(col3))FROM Table
Question 2. set matrix zeros from leetcodeleetcode秒杀
I used the first row and first column to record the status of each row and column. So he asked me what’s the pros and cons of doing so. I said it can save more space, because I didn’t allocate extra arrays to store the status. I didn’t get the right answer for the disadvantage, which is if the file is too large, it cannot be loaded into memory, so it’s not possible to access the first column quickly. Then every time, we need to scan through the whole matrix if we want to set a flag in the first column.

[size=14.6666669845581px]可惜LZ SQL太弱~白白浪费了这么简单的一道题~