Technical Interview Questions
interview questions shared by candidates
Technical Interview Questions
Describe and code an algorithm that returns the first duplicate character in a string? Simple Python example. Not sure it's most efficient. def findDup(str): match=[] i=1 while (i<len(str) and len(match)==0): for j in range(i): if str[j]==str[i]: match=[j,i] i+=1 return match if __name__ == '__main__': print findDup('asdf') print findDup('asdfasdf') pass first clarify if it is ASCII or UNICODE string For ASCII, create BOOL checkArray [128] = {false}; walk the string and update the index of checkArray based of the character. for (int index=0;index< strlen(str); index++) { if (checkArray[str[index]] == true) { printf (str[index]); return; } else { checkArray[str[index]] = true; } } public class FirstDupCharacter { public static void main(String[] args) { System.out.println(findDupCharacter("abcdefghiaklmno")); } private static Character findDupCharacter(final String input) { final Set set = new HashSet(); Character dup = null; for (int i = 0; i < input.length(); i++) { if (set.contains(input.charAt(i))) { dup = input.charAt(i); break; } else { set.add(input.charAt(i)); } } return dup; } } Show More Responses |
Why would you recommend Monster HDMI cables versus generic brand? |
Given a very large existing network with thousands of external connections, how would you add an additional few hundred connections? |
What is your idea of reasonable turn around time for a project? |
How do you represent a real-world quantity in a digital system? |
They presented a demo page and asked me to streamline it to make it more interactive and presentable for a user (open to interpretation). |
What is your experience in operating tools to assess the security of IT networks? |
50,000 shoppers with a 0.5% conversion rate for a chair that costs $250. Wayfair makes a 27% profit. Next, 50,000 shoppers will get a 10% discount. What is the conversion rate they must achieve to achieve the same profits as before? |
How would you handle a system outage? |
Discuss what advantages and disadvantages there are to Web 2.0 |