Given an integer, if the number is prime, return 1. Otherwise return its smallest divisor greater than 1. e.g. if n = 24, its divisors are [1, 2, 3, 4, 6, 8, 12, 24]. The smallest divisor greater than 1 is 2.
Senior Developer Interview Questions
94,508 senior developer interview questions shared by candidates
Given an array of int[] like 1,2,3 Find the next largest integer than can be made with these digits (e.g.: 2,1,3)
Given and array. How do you find if there are such three numbers whose sum is Zero. What is the cost of this algorithm?
Find the least common root for 2 numbers in a BST
whats the angle between the minute pointer and hour pointer at 3:15
Write algorithm to compute a Log to the base 2 of a number (integral results no need for floating point). Solution should not assume a particular size of integer
Look for a string in a very long string - a needle in a haystack. Write the program in pseudo-code.
Implement a method called printNonComments() which prints out a extract of text with comments removed. For example, the input: hello /* this is a multi line comment */ all Should produce: hello all You have access to a method called getNextLine() which returns the next line in the input string.
Why Accenture?
1. Given a string, find the smallest window with greatest no. of distinct characters 2. k sorted array. 3. longest distance between a node and its ancestor.
Viewing 61 - 70 interview questions