Given a string of an arithmetic expression, composed of numbers, '+' and '*', calculate the result - e.g. "2+4*5*7"
Engineer Interview Questions
842,532 engineer interview questions shared by candidates
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" ")))(((" -> ""
Find the deepest common ancestor of two nodes in a tree structure.
need to join tomorrow are you ready?
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")
Determine if an array from 1..n has a duplicate in constant time and space.
You have 8 pennies, 7 weight the same, one weighs less. you also have a judges scale. Find the one that weighs less in less than 3 steps.
Find number of ones in an integer.
Write a function(int[]) -> int that returns the lowest unassigned integer. For example [] -> 1 (empty set), [1] -> 2, [5, 3, 1] -> 2. Basically just sort the array, iterate, and compare current and previous. If there is a gap then that's your number.
Viewing 101 - 110 interview questions