write a program in c/c++/java to print the pattern 1 2*2 3*3*3 4*4*4*4 4*4*4*4 3*3*3 2*2 1
Engineer Interview Questions
933,580 engineer interview questions shared by candidates
How long do you plan to work here?
Given the numbers 1 to 1000, what is the minimum numbers guesses needed to find a specific number if you are given the hint "higher" or "lower" for each guess you make.
how do you get an Elephant in the fridge?
Unexpected: Puzzle question. If you have 2 eggs, and you want to figure out what's the highest floor from which you can drop the egg without breaking it, how would you do it? What's the optimal solution?
Given a string "aaabbbcc", compress it, = "a3b3c2" . Given that output string's length is always smaller than input string, you have do it inplace. No extra space
GIven 9 balls all of which weigh the same except for one, what is the minimum of weighings necessary to find the ball weighs more (or less).
Question was "Given a pattern and a string input - find if the string follows the same pattern and return 0 or 1. Examples: 1) Pattern : "abba", input: "redblueredblue" should return 1. 2) Pattern: "aaaa", input: "asdasdasdasd" should return 1. 3) Pattern: "aabb", input: "xyzabcxzyabc" should return 0.
how would you move mount fuji?
Given an input string S write a function which returns true if it satisfies S = nT. Basically you have to find if a given string can be represented from a substring by iterating it “n” times. n >= 2 An example would suffice – Function should return true if 1) S = “abab” 2) S = “abcdabcd” 3) S = “abcabcabc” 4) S = “zzxzzxzzx” Function should return false if 1) S = “abac” 2) S = “abcdabbd” 3) S = “abcabcefg” 4) S = “zzxzzyzzx” It would be easy to understand if you can give an algo instead of saying use kmp or suffix tree or… I came up with O(n*n) solution. Wondered how to do in O(n)
Viewing 21 - 30 interview questions