Skip to content

Tag Archives: sieve

Given a number n, print all primes smaller than n. For example, if the given number is 10, output 2, 3, 5, 7. Recommended: Please… Read More
Round 1 (Coding round): 1) Range [L, R] is given. Need to find what is the maximum repeating digit in prime numbers between L and… Read More
Given a range [low..high], print the smallest twin numbers in given range (low and high inclusive). Two numbers are twins if they are primes and… Read More
Euler’s Totient function Φ(n) for an input n is the count of numbers in {1, 2, 3, …, n} that are relatively prime to n,… Read More
Online round: [60 mins] 1. given a number N. print in how many ways it can be represented as N = a+b+c+d , 1< =a<… Read More
I was interviewed for Senior Software Engineer position in Walmart (6-8 years of experience,even people with 4yrs exp were also shortlisted) Written Test (Hacker Earth)… Read More
Euler’s Totient function Φ (n) for an input n is the count of numbers in {1, 2, 3, …, n} that are relatively prime to… Read More
Given a number n, write an efficient function to print all prime factors of n. For example, if the input number is 12, then output… Read More
  Given a number n, print all primes smaller than or equal to n. It is also given that n is a small number.  Example: … Read More