Google Interview Question
1,220 Interview Reviews |
Back to all Google Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Software Engineer at Google:
Given two numbers m and n, write a method to return the first number r that is divisible by both (e.g., the least common multiple).
Helpful Question?
Yes |
No
Inappropriate?
Answers & Comments (2)
mod the mulitple of m by n and if the first modulus that is 0 is the least common multiple.
Helpful Answer?
Yes |
No
Inappropriate?
To comment on this
question,
Sign In with Facebook or
Sign Up
4 of 4 people found this helpful
by Saurya:
LCM * HCF = m * n
LCM = (m*n)/HCF
there is a simple way to find( with n > m);
HCF(m,n) = HCF (m%n , m )