In a party of N people, only one person is known to everyone. Such a person may be present in the party, if yes, (s)he doesn’t know anyone in the party. We can only ask questions like “does A know B? “. Find the stranger (celebrity) in minimum number of questions.
Software Developer Interview Questions
709,974 software developer interview questions shared by candidates
Number of 1's in binary representation of integer?
How would you use Yelp to find the number of businesses in the US?
Come out with an algorithm for getting the column number provided the column name in a excel sheet and vice versa. Excel has a naming convention of A,B..Z,AA,AB,AC..ZZ,AAA... This had to be converted to the column numbers. A will be 1 and AA will 27.. Also the algorithm to find the name provided column number.
Given a string with only ')' and '(' find if the string is complete or not. If the string is complete means that each open paranthesis should have a corresponding closed one. Eg: String s= "((()))()"- Complete String String s1=")()()()())))(()()()((" - Incomplete String
Implement a function string balanceParanthesis(string s); which given a string s consisting of some parenthesis returns a string s1 in which parenthesis are balanced and differences between s and s1 are minimum. Eg - "(ab(xy)u)2)" -> "(ab(xy)u)2" ")))(((" -> ""
Given a string of an arithmetic expression, composed of numbers, '+' and '*', calculate the result - e.g. "2+4*5*7"
Find the deepest common ancestor of two nodes in a tree structure.
class A { public A() { foo(); } public void foo() { System.out.println("Class A"); } } class B extends A { public B(){} public void foo() { System.out.println("Class B"); } } class main { public static void main(String[] args) { A a = new B(); } } What does it print? Class A or Class B?
Given two strings representing integer numbers ("123" , "30") return a string representing the sum of the two numbers ("153")
Viewing 91 - 100 interview questions