I implemented as below using recursion: def check(n, k): temp = k//10 if temp*temp > n: return check(n, temp) elif temp*temp < n: for i in range(temp, k): if i*i == n: return True else: return False check(16, 16)
first i was going to directly look at the solution but then sir said to give it a good try and dont give up , i patiently tried and got the solution with the same basic intuition thank you sir
n = 25 lst = [] for i in range(1,n): if n % i == 0: lst.append(i) print(lst) for x1 in lst: if x1*x1 == n: print(f"{n} is a perfect square of {x1}") break else: print("Not a perfect square")
Sir this is an eye-opener for me. I never thought of converting any problem into an optimization problem. Sir did I missed any live session on such topics where you have discussed?
Love these videos! I have a general question. Will getting the TensorFlow developer certification help me get better oppurtunities as a fresher? I'm thinking of doing it parallelly with the course.
Yes, it will help showcase to recruiters that you understand TensorFlow well. Its acceptability in the industry is still not yet validated as the certification itself is very recent.
Sir pl do more this sort of videos. I'm also doing interviews prep course and finding dynamic programming a bit challenging specifically bottom up iterative approaches.
That’s why, in the interview prep course, we have 40-50 solved problems related to dynamic programming. We have another 80-100 problems to practice from. It is through persistent practice of these DP problems that you will be able to solve these problems over a period of time.
Is it possible using prime factorization? First find prime factors and check if unique prime factors are even in number..for exampe 16= 2×2x2x2,, 2 is 4 in number...100= 2x5x2x5 both 2 and 5 both are 2 in number...48= 2×2x2x2x3 here 3 is only 1 time hence not perfect square.. basically find frequency of prime factors and if every number is even in frequency distribution then it is perfect square..
n=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] num=16 for i in n: if i*4==num: print('true') else: print('FALSE', i) # here i will show the number whose sqrt is given integer by giving true and everything else false Is it the correct way?
I’ve a question, I’m in the eu. I’ve a bsc/msc in cs. By taking your course, will it help in getting into fang within the eu? Is the content/prep fang level/orientated? Thanks. Also, You’re an excellent educator.
The hiring bar at FAANG companies is more or less similar across the world for the same roles. Our course content is at the level of Applied Scientist level roles at FAANG like companies across the world.
Interviewers will ask for the most optimal solution you can build. Obviously improving the linear search to O(sqrt(n)) is a good starting point. But using binary search based method is better.
Count the number of distinct prime factors for that number other than 1. If all the counts are even then it is a perfect sqaure else it is not a perfect square E.g: 16->2,2,2,2 -number of 2's is 4(even) Then it is a perfect square E.g 18->2,3,3-number of 2 is even but 3 is odd ,hence not a perfect square Is this approach valid?
n=256 flag = False for i in range(1,n//2): if(i**2 == n): print('True') flag = True break if(flag == False): print('False') Hi Team, Please give feedback for the above code
This depends a lot on the prior experience of the candidate and how well they’ve learnt from the course. The course content itself is sufficient to crack most of the roles, including those at the top best companies. Most freshers or those with less than two years experience get in the 6-12L range with a median of 8L. For experienced professionals, the range of compensation increment can be anywhere from 30 to 250% based on how well they picked up the foundational skills.
@@AppliedAICourse sir for 1year experienced in web app developmenter will the placement is guaranteed after completion of course I mean a full time job placement or an internship
It will be a full-time role. In the worst case, you might end up joining as an intern and then get converted to a full time. Very often, people with experience do not join as interns unless they have career gaps.
There are many possible metrics that can be used for recommendation system problems. A popular option is mean average precision at K. You can read more about it and various kaggle competitions that use it at: datascience.stackexchange.com/questions/82463/metric-mapk-for-what
Very nice video sir , I have one question like ""how much of cloud/ devOps/ API technologies as an (1)ML engineer (2)Data Scientist and (3) Applied Scientist, you are supposed to know in a good tech company (like FAANG, Microsoft, Adobe ) ?"
Most of these companies expect strong core skills and programming knowledge. Even if you don’t know Cloud/DevOps/APIs, they will hire you if you have strong mathematical, programmatic and applied knowledge of data science and machine learning.
This is exactly like the linear search that we described in the video. Please try and implement binary search on your own as it has a better time complexity.
Sir I will be in 1st year of college this year as I got decent marks in jee mains and 100 percent sure of getting MNNIT ALLAHABAD cse . I am learning c++ as a beginner what should I do to improve my coding skills , I want to be a game developer??
Focus on being a good programmer and learn data structures and algorithms. Write as much code as possible in your first year and become really good at coding and related problem-solving using data structures and algorithms. That will build a very strong foundation to whatever career you want to pursue as your interests will evolve and change over the next four years.
@@shivamjalotra7919 will do it ,cause I dropped a year even after getting nit jamshedpur civil just for cse in some decent nit computer science because I don't want to crush my dream..and yeah I took the decision of drop in December 2020 after counseling...
these coding questions can be solved using only python? or there are other language preferences? Which language is usually preferred for coding rounds in Data science roles?
1. The gradient descent method is also called Newton's Method of finding roots. cp-algorithms.com/num_methods/roots_newton.html 2. There is one more O(sqrt(n)) solution based on prime factorisation of n.
Yes, there are many such good methods to solve this problem. Note that O(sqrt(n)) is worse than O(log(n)). The Newton’s method of finding roots is often taught at undergraduate level in the first year coursework.
Actually, the gradient descent isn't called Newton method. It's however, in another way called steepest-descent or cauchy's method. It was first proposed by a great Mathematician named Augustin Lious Cauchy around 1847.
But in a typical interview, the interviewer will quickly point out and say that it is equivalent to using SQRT function. He would ask you to rewrite it without using it.
Is this code is more optimized then binary search solution , check it. And also tell , is this code can be more optimized with linear search only ? n=[4,9,8,7,36,35,49,0,10001,10000,100000] a = max(n) lst=[] x=0 y=1 while x
I implemented as below using recursion:
def check(n, k):
temp = k//10
if temp*temp > n:
return check(n, temp)
elif temp*temp < n:
for i in range(temp, k):
if i*i == n:
return True
else:
return False
check(16, 16)
first i was going to directly look at the solution but then sir said to give it a good try and dont give up , i patiently tried and got the solution with the same basic intuition thank you sir
n = 25
lst = []
for i in range(1,n):
if n % i == 0:
lst.append(i)
print(lst)
for x1 in lst:
if x1*x1 == n:
print(f"{n} is a perfect square of {x1}")
break
else:
print("Not a perfect square")
Sir this is an eye-opener for me. I never thought of converting any problem into an optimization problem. Sir did I missed any live session on such topics where you have discussed?
You can find such live sessions on numerical programming on a RUclips channel or on course website in module one under live sessions.
It's Phenomenol!! Thank you sir!
Love these videos! I have a general question. Will getting the TensorFlow developer certification help me get better oppurtunities as a fresher? I'm thinking of doing it parallelly with the course.
Yes, it will help showcase to recruiters that you understand TensorFlow well. Its acceptability in the industry is still not yet validated as the certification itself is very recent.
Sir pl do more this sort of videos. I'm also doing interviews prep course and finding dynamic programming a bit challenging specifically bottom up iterative approaches.
That’s why, in the interview prep course, we have 40-50 solved problems related to dynamic programming. We have another 80-100 problems to practice from. It is through persistent practice of these DP problems that you will be able to solve these problems over a period of time.
Is it possible using prime factorization? First find prime factors and check if unique prime factors are even in number..for exampe 16= 2×2x2x2,, 2 is 4 in number...100= 2x5x2x5 both 2 and 5 both are 2 in number...48= 2×2x2x2x3 here 3 is only 1 time hence not perfect square.. basically find frequency of prime factors and if every number is even in frequency distribution then it is perfect square..
This also works. Good idea.
@@AppliedAICourse not sure about the complexity though..
n=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
num=16
for i in n:
if i*4==num:
print('true')
else:
print('FALSE', i) # here i will show the number whose sqrt is given integer by giving true and everything else false
Is it the correct way?
This code would not work is num=25.
@@AppliedAICourse Ok sir...got the point
I’ve a question, I’m in the eu. I’ve a bsc/msc in cs. By taking your course, will it help in getting into fang within the eu? Is the content/prep fang level/orientated? Thanks. Also, You’re an excellent educator.
The hiring bar at FAANG companies is more or less similar across the world for the same roles. Our course content is at the level of Applied Scientist level roles at FAANG like companies across the world.
Can we also do our linear search till the square of the i is less or equal to our no
Yes, we can terminate the loop early in the linear search which will result in a time complexity of O(sqrt(n)) which is worse than binary search.
Yes but if interviewer asked for optimized solution of linear search we can go for this also
Interviewers will ask for the most optimal solution you can build. Obviously improving the linear search to O(sqrt(n)) is a good starting point. But using binary search based method is better.
Count the number of distinct prime factors for that number other than 1. If all the counts are even then it is a perfect sqaure else it is not a perfect square
E.g: 16->2,2,2,2 -number of 2's is 4(even)
Then it is a perfect square
E.g 18->2,3,3-number of 2 is even but 3 is odd ,hence not a perfect square
Is this approach valid?
This would work. But, how would you find the prime factorisation? What is the time complexity to find that?
i'm beginer but i can try...
n = int(input('enter num'))
if type(n**0.5) == int :
return 'perfect_square'
else:
return 'not perfect_square'
n=256
flag = False
for i in range(1,n//2):
if(i**2 == n):
print('True')
flag = True
break
if(flag == False):
print('False')
Hi Team,
Please give feedback for the above code
This is exactly like the linear search, right. You can always test it fairly easily against the test cases that we discussed in the above video.
Sir can you please tell what is the avg package of students who are placed after completing AAIC???
This depends a lot on the prior experience of the candidate and how well they’ve learnt from the course. The course content itself is sufficient to crack most of the roles, including those at the top best companies. Most freshers or those with less than two years experience get in the 6-12L range with a median of 8L. For experienced professionals, the range of compensation increment can be anywhere from 30 to 250% based on how well they picked up the foundational skills.
@@AppliedAICourse when you say experience people...does people from non data science experience also get 30-250% hike
Yes, work experience. Not necessarily in ML/DS.
@@AppliedAICourse sir for 1year experienced in web app developmenter will the placement is guaranteed after completion of course
I mean a full time job placement or an internship
It will be a full-time role. In the worst case, you might end up joining as an intern and then get converted to a full time. Very often, people with experience do not join as interns unless they have career gaps.
Sir can please tell me which metric we should use in Recommendation systems
There are many possible metrics that can be used for recommendation system problems. A popular option is mean average precision at K. You can read more about it and various kaggle competitions that use it at: datascience.stackexchange.com/questions/82463/metric-mapk-for-what
@@AppliedAICourse Ok sir I'll check it out and Thank you very much for your great concern regarding this RUclips community.
Very nice video sir , I have one question like ""how much of cloud/ devOps/ API technologies as an (1)ML engineer (2)Data Scientist and (3) Applied Scientist, you are supposed to know in a good tech company (like FAANG, Microsoft, Adobe ) ?"
Most of these companies expect strong core skills and programming knowledge. Even if you don’t know Cloud/DevOps/APIs, they will hire you if you have strong mathematical, programmatic and applied knowledge of data science and machine learning.
@@AppliedAICourse Thanks a lot Team for the fast response !!! It is very helpful
def perfsq(n):
if n < 0:
return False
isperf = False
for i in range(n+1):
if i**2 == n:
isperf = True
break
return True if isperf else False
n = int(input())
print(perfsq(n))
Can you please provide feedback on this code?
This is exactly like the linear search that we described in the video. Please try and implement binary search on your own as it has a better time complexity.
Sir I will be in 1st year of college this year as I got decent marks in jee mains and 100 percent sure of getting MNNIT ALLAHABAD cse .
I am learning c++ as a beginner what should I do to improve my coding skills , I want to be a game developer??
Focus on being a good programmer and learn data structures and algorithms. Write as much code as possible in your first year and become really good at coding and related problem-solving using data structures and algorithms. That will build a very strong foundation to whatever career you want to pursue as your interests will evolve and change over the next four years.
@@AppliedAICourse sir is there any course of yours for competitive coding??
Game Developer + 1st Year, Hmmm Makes Sense.
interviewprep.AppliedRoots.com
@@shivamjalotra7919 will do it ,cause I dropped a year even after getting nit jamshedpur civil just for cse in some decent nit computer science because I don't want to crush my dream..and yeah I took the decision of drop in December 2020 after counseling...
these coding questions can be solved using only python? or there are other language preferences? Which language is usually preferred for coding rounds in Data science roles?
Most top product-based companies would be okay with you implementing in any of the major programming languages.
@@AppliedAICourse does this apply irrespective of the role we're applying for?
In most cases, you are given flexibility to choose a language.
@@AppliedAICourse thanks!!
1. The gradient descent method is also called Newton's Method of finding roots.
cp-algorithms.com/num_methods/roots_newton.html
2. There is one more O(sqrt(n)) solution based on prime factorisation of n.
Yes, there are many such good methods to solve this problem. Note that O(sqrt(n)) is worse than O(log(n)). The Newton’s method of finding roots is often taught at undergraduate level in the first year coursework.
Actually, the gradient descent isn't called Newton method. It's however, in another way called steepest-descent or cauchy's method. It was first proposed by a great Mathematician named Augustin Lious Cauchy around 1847.
why can not we use simple math-
res = ((x)**(1/2))%1
if res>0:
not perfect square
x**0.5 is an indirect way to computing the sqrt() function, which we suggested should be avoided in the problem definition.
@@AppliedAICourse But its not explicitly mentioned. That power of 0.5 has to be avoided.
But in a typical interview, the interviewer will quickly point out and say that it is equivalent to using SQRT function. He would ask you to rewrite it without using it.
Is this code is more optimized then binary search solution , check it.
And also tell , is this code can be more optimized with linear search only ?
n=[4,9,8,7,36,35,49,0,10001,10000,100000]
a = max(n)
lst=[]
x=0
y=1
while x