Irvine, CA interview questions | Glassdoor

# Interview questions in Irvine, CA

Houzz Interviews in Irvine

www.houzz.com /  HQ: Palo Alto

132 Interviews in Irvine (of 518)

2.8 Average

Blizzard Entertainment Interviews in Irvine

www.blizzard.com /  HQ: Irvine, FR

121 Interviews in Irvine (of 272) / Part of Activision Blizzard

3.1 Average

Network Capital Interviews in Irvine

www.networkcapital.net /  HQ: Irvine

99 Interviews in Irvine (of 164)

2.1 Easy

## Interview Questions in Irvine

Sort: RelevancePopular Date

Jul 24, 2011

Feb 27, 2012

### Software Engineer - New Grad at Google was asked...

Oct 6, 2012
 Write a function that finds the median of a set of three numbers, also find the Big O. Can it be done with only 2 comparisons, or do you need 3?11 AnswersPick two numbers: A and B, Add the third number to each of the first two : (A+C), (B+C). Compare these two numbers and take the lesser of the two. Now compare C with the other member of the less number. The greater of these two is the median.I'm not following. Is this: say, B+C is less than A+C, then the larger of B and C is the median? If so, isn't this a counterexample: A = 2, B = 1, C = 3?Actually the answer is the next one: we could have an answer using only two comparisons. The main idea is that we need to examine one of the numbers to get into the segment created by the other two numbers. And another important thing is that one comparison could be used to definitely determine for both two segments created by two numbers. For example we are trying to examine number A and we have two segments formed by B and C numbers: [B; C] and [C; B]. But considering that for determining if A is in the segment created by B an C we need to make the following comparison: (A - B) * (C - A) >= 0. It is easy to notice that if A is in segment [B; C] (B is less or equals to C) we have both multipliers are positive but in an opposite case when A is in segment [C; B] (C is less or equals to B) we have both that multipliers are negative. If former comparison is negative - then number A is not in any of segments [B; C] or [C; B]. And here is a code of function on C/C++: int medianOfThreeNums(int A, int B, int C){ if ((A - B) * (C - A) >= 0) { return A; } else if ((B - A) * (C - B) >= 0) { return B; } else { return C; } }Show More Responsesif (B-A) > 0 if (C-B) then B else C else if (C-A) > 0 then A else C a=b=c ?First get two numbers: x = a - b y = a - c now there are four possible cases for x and y if x & y are both positive => a is bigger than both b and c.=> choose bigger of b & c if x & y are both negative => a is smaller than b and c => choose smaller of b & c if x is positive and y is negative => a is bigger than b but smaller than c => choose a if x is negative and y is positive => a is smaller than b but bigger than c => choose avoid GetMedian(int a, int b, int c) { int small, large; if (a < b) { small = a; large = b;} else {small = b; large = a;} // Check where c lies: if (large < c) return large; else if (c < small) return small; else return c; }@Moy: if the answer turns out to be small, then haven't you done 3 compares?Running Vitalii's code with a = 1, b = 7, and c = 3 produces a median == 7, which is incorrect. Suggestions?Vitalii's solution works for me.def find_median(a, b, c): ab = b - a bc = c - b if -ab * (ab + bc) >= 0: return a if ab * bc >= 0: return b return ccan't you sort the 3 numbers, the median is the middle one...?

### Software Engineer at Google was asked...

Aug 1, 2013
 Phone interview question: Given a string pattern of 0s, 1s, and ?s (wildcards), generate all 0-1 strings that match this pattern. e.g. 1?00?101 -> [10000101, 10001101, 11000101, 11001101]. You can generate the strings in any order that suits you.12 Answerspublic static void generateAllPatterns(String s, int index) { while(index < s.length() && s.charAt(index) != '?') index++; if(index == s.length()) { System.out.println(s); return; } StringBuilder s1 = new StringBuilder(s); s1.setCharAt(index, '0'); generateAllPatterns(s1.toString(),index); s1.setCharAt(index, '1'); generateAllPatterns(s1.toString(),index); } public static void generateAllPatterns(String s) { generateAllPatterns(s,0); }{{{ public static ArrayList getAllString(String str) { if(str==null) return null; int index = str.indexOf('?'); ArrayList res = new ArrayList(); if (index == -1){ res.add(str); return res; } char ch1[] = str.toCharArray(); char ch2[] = str.toCharArray(); ch1[index] = '0'; ch2[index] = '1'; res.addAll(getAllString(new String(ch1))); res.addAll(getAllString(new String(ch2))); return res; } }}}#include #include void findBinPattern(char *data, int i) { if (data[i] == '\0') { printf("%s\n",data); return; } if (data[i] == '?') { data[i] = '0'; findBinPattern(data, i + 1); data[i] = '1'; findBinPattern(data, i + 1); } else findBinPattern(data,i+1); } int main(void) { char data[] = "?1"; findBinPattern(data,0); return EXIT_SUCCESS; }Show More ResponsesHere's a verbose non-recursive solution that can be traded for some of the solutions above (always think about a bad input like ??????????????????) public void generatePatterns(String str) { // Let's assume an incoming input of 1101?0010?1111? // This means we will have 2^3 = 8 combinations // Let's sweep through the input once and identify the number of wildcards // Once you have the number of wildcards you can generate the permutations Ex: 3 wildcards, clearly my list is 000, 001, 010, 011 etc int ctr = 0; for(int i=0; i permList = getPermutations(ctr); ArrayList patterns = new ArrayList(); for (int x = 0; x getPermutations(int ctr) { ArrayList perms = new ArrayList(); String perm = null; int totalPerms = (2 << (ctr - 1)); for(int i =0; iI like my recursive version the best. public static Set allSets = new TreeSet(); public static Set getAllCombos(String str){ if(str == null){ // Error Check return null; }else if(!str.contains("?")){ // Base Case allSets.add(str); return allSets; }else{ getAllCombos(str.replaceFirst("\\?", "0")); getAllCombos(str.replaceFirst("\\?", "1")); } return allSets; }public static void PossibleStrings(String str) { if (str == null) return; else if (str.Contains("?")) { int findex = str.IndexOf("?"); str = str.Remove(findex, 1); PossibleStrings(str.Insert(findex, "1")); PossibleStrings(str.Insert(findex, "0")); } else Console.WriteLine(str); }Dynamic Programming. Create an arraylist that will store intermediate results. Start from end of string. If a 0/1 is encountered, simply append the character in the beginning to all the elements in result array. If a wildcard is encountered, add both 0 and 1 to all the elements.This pass will double the number of elements on the arraylist. Repeat till the first element is reached. Output the result.Well, things are usually easier in python :) def print_wild_string(s,pos): if pos == len(s): print s return if s[pos]=='?': new_str_0 = s[0:pos] + '0' + s[pos+1:] print_wild_string(new_str_0,pos+1) new_str_1 = s[0:pos] + '1' + s[pos+1:] print_wild_string(new_str_1,pos+1) else: print_wild_string(s,pos+1)An even shorter / cleaner python version: def replaceWildcards(str): if str.find("?") < 0: print str else: replaceWildcards(str.replace("?", "0", 1)) replaceWildcards(str.replace("?", "1", 1)) (full disclosure: I did a few tests with the timeit library and the previous python solution is 20% faster than this one, so if time is your major concern, go with the other python solution. Actually, that solution but replacing the "+" for string concats with "".join() format was 5% faster than the original above if you really wanted to optimize.)void Gen(String pattern){ int n = pattern.length() - pattern.replace("?", "").length(); int[] locs = new int[n]; int count=0; for(int i=0;iC# version: public static void GenerateAllPatterns(string input) { if(string.IsNullOrEmpty(input)) { return; } int index = input.IndexOf('?'); if(index > -1) { // From the input string, create two new strings // which have the ? converted to both a 0 and a 1. char[] c1 = input.ToCharArray(); c1[index] = '0'; char[] c2 = input.ToCharArray(); c2[index] = '1'; // Recursively call this function on the two new strings. GenerateAllPatterns(new string(c1)); GenerateAllPatterns(new string(c2)); } else { Console.WriteLine(input); } }void printChars(string s, string soFar) { if(s.size() == 0) { cout<

### Test Engineer at Broadcom was asked...

Apr 17, 2010
 Given Vcc and 2 capacitors A and B in series to ground, what is the voltage in between4 AnswersSomewhere in betweenVb=(Cb/Ca+Cb)VI mean Vb=(Cb/(Ca+Cb))VShow More ResponsesIt depends on the initial condition.... if both capacitors were discharged to 0V at first, and then one side is charged to Vcc, then the answer would be Vb=(Ca/(Ca+Cb))Vcc Vcc---Ca----Cb----gnd However since there was no initial conditions given , the middle voltage could be anything if the capacitors are ideal

### Software Engineer - New Grad at Google was asked...

Oct 6, 2012
 If you had a savings account with \$1, at a 100% interest rate, at what year would you have 15 billion dollars?4 AnswersUse the power of 2's to get to the answer.Log base 2 of 15 billionYou should know offhand that 2^10 is 1024, so 2^20 = 1024^2 is approx a million, 2^30 is approx a billion, then you need four more years to get to 16 billion. Remember that you started with 1, not 2, so the answer is 35 years, not 34.Show More ResponsesAfter 34 years you would have 16 billion. That is to say, you would have 15 billion in the 34th year.

### Personal Banker at Wells Fargo was asked...

Jul 17, 2009
 what do you think is the most important part of sales5 Answersfollow upOthers that would be good, Selling yourself and Building rapport or "Clicking" with the clientMaking sure the client is satisfied and walks away with a positive impactful experience (for referrals and retention).Show More ResponsesListening to the customer and understanding their needs to be able to offer a complete solution of services that ties back and makes sense for the customerBeing able to help the customer with efficiency, respect and patience

### Area Coordinator at Waypoint Homes was asked...

May 29, 2013
 What are you salary requirements?4 Answersi have an interview for the acquisition analyst position in AZ, is there any assessment test you have to take? and do they do background,education check and drug test? any help would be greatly appreciated, thanks.Yes they did make me take an assessment test that is pretty thorough. They also do a full background check, drug test, and credentials.Thank you very much for the quick response, i appreciate that.Show More ResponsesDo they hire people with class b misdemeanor?

### Software Engineer at Google was asked...

Jun 18, 2012
 Get the kth largest number from two sorted arrays3 Answerslet they be a[m]&b[n] int i,j,p=0 for(p=1;p// return kth biggest element from 2 sorted arrays public static int kthElement (int[] a1, int[] a2, int k){ int i1 = a1.length-1; int i2 = a2.length-1; for (int i =1; i a2[i2]) { i1--; } else { i2--; } } if (a1[i1] > a2[i2]) return a1[i1]; else return a2[i2]; }the solutions 1) start looking for the arrays a1 and a2, as they are both sorted. you can move ahead when needed. This solution is O(k). the same as implementation on the above 2 implementation. 2) The interviewer is probably looking to find the following answer. lets say for choosing the k element you choose l element from array a1 and k-l element from a2. the condition to be satisfied here is a1[l]

### Software Engineer at Blizzard Entertainment was asked...

Dec 21, 2009
 Write an application that maps out a large set of data in as little time as possible.3 AnswersThe right answer was a parser that adds things to a map, and evaluating the map as you went for duplicates.I actually did not get the answer. Can you explain yourself better?What is a large set of data? Nowadays, we have solutions such as MapReduce to handle data intensive problems. See: http://en.wikipedia.org/wiki/Data-intensive_computing. For not so large dataset, you can use a simple map (as HashMap in Java) to store each partition of information.
110 of 5,724 Interview Questions