Fragen im Bewerbungsgespräch: Software engineer in Region San Diego, Vereinigte Staaten von Amerika | Glassdoor.de

Fragen im Vorstellungsgespräch: Software engineer in San Diego, Vereinigte Staaten von Amerika

1,661

Fragen aus Vorstellungsgesprächen für software engineer, von Bewerbern geteilt

Top Vorstellungsgespräch-Fragen

Sortieren: RelevanzBeliebtheit Datum

Ein Bewerber für eine Stelle als IOS Developer bei Facebook wurde gefragt...

26. Juni 2017
 Given an array, without using extra space, move all zeros to the end and no-zeros to the beginning. The function should return the number of non-zeros.14 AntwortenQuick sort the count the zeros ...Quicksort doesn’t satisfy the requirements because it’s not a sort-in-place algorithm. The correct solution is to use insertion sort.swapping 2 numbers if one is zero, can be done without any space. assuming array[a] is zero, and array [b] is non zero, array[a] = array[b], array[b] = 0 would simply work. so, have 2 pointers, one from beginning and one from the end, do a while loopMehr Antworten anzeigenfunc moveAllZeros(_ array : inout [Int]) { var left = 0 var right = array.count - 1 while left < right { while array[left] != 0 { left += 1 } while array[right] == 0 { right -= 1 } if left < right { array[left] = array[right] array[right] = 0 left += 1 right -= 1 } } }I use Swift, but not sure it ok or not.... func moveAllZeros(_ arr : [Int]){ arr.sorted() } func ReturnNumberOfnonzeros(_ arr:[Int]) -> Int { return arr.filter{\$0>0}.count }We can use the stride function to iterate input array in reverse order then swap the zero values towards the end.. func moveZerosToEnd(inputArray: inout [Int]) -> [Int] { var zeroIndex = inputArray.count - 1 for index in stride(from: inputArray.count-1, through: 0, by: -1) { if inputArray[index] == 0 { inputArray.swapAt(index, zeroIndex) zeroIndex -= 1 } } return inputArray } var inputArray1 = [1,2,3,4,0,0,4,5,0] print(moveZerosToEnd(inputArray: &inputArray1))func zerosToTheEnd(a: [Int]) -> [Int]{ guard a.count > 1 else {return a} var array = a var l = 0, h = array.count-1 while h >= 0, array[h] == 0 { h -= 1 } while l < h { if array[l] == 0{ array[l] = array[h] array[h] = 0 h -= 1 } l += 1 } return array }-(int)sortZerosAndReturnCountOfThem:(NSMutableArray *)arr { NSLog(@"before: %@", arr); int cursorFromStart = 0; int cursorFromEnd = (int)arr.count - 1; while (cursorFromStart < cursorFromEnd) { while (arr[cursorFromStart].intValue != 0) { cursorFromStart++; } while (arr[cursorFromEnd].intValue == 0) { cursorFromEnd--; } if (cursorFromStart < cursorFromEnd) { arr[cursorFromStart] = arr[cursorFromEnd]; arr[cursorFromEnd] = @(0); } } NSLog(@"after: %@", arr); int counter = 0; for (NSNumber *num in arr) { if (num.intValue == 0) { counter++; } } NSLog(@"counter: %d", counter); return counter; }func moveZeros(input: inout [Int]) -> Int { //reverse sort input = input.sorted { \$0 > \$1 } let countNonZero = input.filter { \$0 != 0 }.count return countNonZero }No need to sort. Can do in O(n) time. Swift: func moveAllZerosToFront(list: inout [Int]) -> Int { var numOfZeros = 0 for i in 0..Don't know why my post got cut off. No need to sort. Can do in O(n) time. Swift: func moveAllZerosToFront(list: inout [Int]) -> Int { var numOfZeros = 0 for i in 0..var input = [1,0,0,1,2,3] var counter = 0 var zerosCounter = 0 while(counter 0){ input.append(0) zerosCounter = zerosCounter - 1 } print(input)Mehr Antworten anzeigenAll of the solutions above require addition storage for counters, variables, etc. This is a solution that does not use any additional in-memory storage, by using an external hash table stored in a relational database. It also has the added benefit of being O(n) getBitwiseShiftedValues( startValue ) setupSQLValueHashTable(); // generate SQL table with key 'valueKey' and value 'sortedBits'. Only done once. result = SELECT sortedBits FROM valueHashTable where valuekey = startValue ; return result; Einer oder mehrere Kommentare wurden entfernt. Weitere Informationen finden Sie in unserem Verhaltenskodex und in unseren Nutzungsbedingungen.

Ein Bewerber für eine Stelle als Senior Software Engineer bei Qualcomm wurde gefragt...

18. Jan. 2011
 Write a C function to return the number of set bits in an integer.7 Antworten32 bits in an integer(int) data type on most systems.static const int NumberOfSetBits[8] = { /* in nibble, half byte */ 0, /* 0x0, b0000 */ 1, /* 0x1, b0001 */ 1, /* 0x2, b0010 */ 2, /* 0x3, b0011 */ 1, /* 0x4, b0100 */ 2, /* 0x5, b0101 */ 2, /* 0x6, b0110 */ 3 /* 0x7, b0111 */ 1 /* 0x8, b1000 */ 2 /* 0x9, b1001 */ 2 /* 0xA, b1010 */ 3 /* 0xB, b1011 */ 2 /* 0xC, b1100 */ 3 /* 0xD, b1101 */ 3 /* 0xE, b1110 */ 4 /* 0xF, b1111 */ }; #define NumBytesInInt 4 /* assumes 32bit system */ int GetNumberOfSetBits(int anInteger) { uint8_t buf[NumBytesInInt ]; int i; int count = 0; memcpy(buf, &anInteger, sizeof(buf)); for (i=0; i> 4]; } return count; }int GetNumSetBits( int anInt ) { int count = 0; for( sizeof( int) ) { count += (anInt & 0x01); anInt >>= 1; } return count; }Mehr Antworten anzeigenThis looks mos efficient, int GetNumSetBits( int anInt ) { int count ; while(anInt) { count += (anInt&0x1); anInt >>= 1; } return count; }while(n) { n = n&(n-1) count++; } return count;#define BITS_IN_BYTE int numSetBits (int// C language implementation, handles different integer sizes #define BITS_IN_BYTE 8L #define LS_BIT_MASK 1L int numSetBits (int intNumber) { int numBits = 0; for (int i = 0; i >= 1; // right shift LS bit out } }

Ein Bewerber für eine Stelle als Software Engineer bei Clutter wurde gefragt...

17. Apr. 2019
 Well aptitude test that requires 45 minutes8 AntwortenStill working on itDid you finish your test ? I got the same test.I too got the same test. What kind of questions can we expect?Mehr Antworten anzeigenI have received a similar assessment on hackerrank. Could anyone please provide some help about the questions.So any one solved the hackerrank challenge? what kind of questions can we expect?hey what was the graph question dkistra ?shortest path all that good stuff?I'm guess everybody here is still working on it, amirite? Einer oder mehrere Kommentare wurden entfernt. Weitere Informationen finden Sie in unserem Verhaltenskodex und in unseren Nutzungsbedingungen.

Ein Bewerber für eine Stelle als Embedded Software Engineer bei Qualcomm wurde gefragt...

21. Mai 2020
 Given the following struct definition in C, what would sizeof(myStruct) return? typedef struct { short a; long b; char c; } myStruct;5 Antworten(Hint: you have to keep in mind the rules of byte padding since #pragma pack(1) is not called)11 byteI guess its 18 as byte padding will happen for the char (2 for short, 8 for long, 8 byte for padded char)Mehr Antworten anzeigenwithout any packing: sizeof struct will 24 bytes .if we using 32 bit the answer defiantly will be 7+1 for padding -> 8 bytes if we using 64 bit the answer will be 17+7 for padding =24 bytes

Ein Bewerber für eine Stelle als Software Engineer bei Workday wurde gefragt...

20. Okt. 2016
 Find the first non-repeating character in a string.4 Antwortenimport java.util.*; class FirstUniq{ public static void main(String[] args){ System.out.println(getFirstUniqChar("12")); } public static Character getFirstUniqChar(String s){ if (s == null || s.length() == 0) {return null;} Map map = new LinkedHashMap(); for(int i = 0; i e : map.entrySet()){ if (e.getValue() == 1) return e.getKey(); } return null; } }For(i=1 to n) If(arr[i] != arr[i-1]) return arr[i-1] // if we get here the string arr has inly onecharacter repeatefdef firstNonDup(s: String): Char = { val map = s.toCharArray.foldLeft(Map[Char, Int]())((map: Map[Char, Int], c: Char) => { var m = map if (m.contains(c)) { m += (c -> m.get(c).get.+(1)) } else { m += (c -> 1) } m }) val a = s.toCharArray.filter(c => map.get(c).getOrElse(0) == 1) a match { case Array() => ' ' case _ => a(0) } }Mehr Antworten anzeigen#include char firstNonDup(char *string, int length) { int i; int cs[256]; for (i = 0; i < length; i++) { cs[string[i]]++; } for (i = 0; i < length; i++) { if (cs[string[i]] == 1) { return string[i]; } } return ' '; } int main(int argc, char **argv) { const char string[] = "hello hellen"; printf("First non-duplicate of %s is %c\n", string, firstNonDup(string, sizeof(string))); }

Ein Bewerber für eine Stelle als Software Engineer bei Qualcomm wurde gefragt...

8. Feb. 2010
 If 4 ants start on four sides of a square at the same time in either direction... whats the probability that they wont collide?4 Antworten12.5% = 2/16if u solve it through binary logic, its pretty easy.... lets say if all ants start moving in same direction(left or right), they wont collide. We can assign these two cases by, "0000", "1111". Each bit representing an ant. In all other cases there will be definite collision. Total cases are 2^4 = 16. Therefore the probability of NOT colliding is 2/16 = 12.5%probability(clockwise)=(1/2)^3 probability(counterclockwise)=(1/2)^3 probability(same direction)=(1/2)^3+(1/2)^3 probability(not colliding)=1-( 1/4)=3/4Mehr Antworten anzeigenAll clockwise: (1/2)^4 All anti clockwise: (1/2)^4 Together: 2/16

Ein Bewerber für eine Stelle als Financial Software Developer bei Bloomberg L.P. wurde gefragt...

7. Sept. 2010
 Given 2 eggs, how would you find the exact floor at which the egg breaks when thrown from a building comprising 100 floors4 Antworten14Only need one egg, but I have two answers. 1) If I stand on the first floor and throw an egg, it will break 2) No matter what floor the egg is thrown from, it will break when it reaches the ground floor. I'm guessing they are looking for something clever having to do with hardboiling one of the eggs, but that isn't necessary. The brute force answer is start at floor one, drop an egg. Repeat until the egg breaksThrow one egg from 50 floor. Depending if egg breaks, will be known if egg breaks between floors 1-50, or above 50. If first egg did not broke, then throw second egg from floor 51, 52, 53, ... until it breaks. Maximum number of attempts to find answer is 51. Problem has another twist. What is least number of steps to find floor from which thrown egg is broken.Mehr Antworten anzeigenI think you guys tried to find a twist in this question, but really I'm pretty sure there's none. Eggs will break if thrown from a human's arm height... not even a first floor. I don't think you need to go further than that. I think the real intent of this question is simply to test the interviewee's level of pragmatism.

Ein Bewerber für eine Stelle als Software Developer bei General Atomics wurde gefragt...

6. Apr. 2012
 What does the operating system do when you call a function?4 AntwortenChecks to see if the user has permission to call the function, processes the function call and the excites the function if permission has been granted. Do they want more indepth detail or are they running windows exclusively?Executes lol, love my iPad :)I did not know... so I cannot really help, sorry :/Mehr Antworten anzeigenfunctions uses stack part of the memory and destroyed when the function is returned.

Ein Bewerber für eine Stelle als Software Developer III bei General Atomics wurde gefragt...

3. Sept. 2010
 phone screen question: what is the derivative of veloctiy?4 Antwortendx/dt; delta of distance over delta of timeAccelerationintegral of velocity is acceleration... derivative of velocity is distance.Mehr Antworten anzeigenGuys...the (time) derivative of velocity is, without a doubt, acceleration.

Ein Bewerber für eine Stelle als Software Developer I bei General Atomics wurde gefragt...

10. Nov. 2011
 1. How many bits in a byte? 2. What's the integral of velocity?4 Antworten1. 8 2. i think acceleration?For number 2, the integral of velocity is the total distance traveled. The derivative is acceleration.there are 8 bits in a byte The indefinite integral is the distance traveled.Mehr Antworten anzeigen1. 8 2. Acceleration is the "derivative" of velocity with respect to time, and the second derivative of distance or displacement with respect to time. This means that the "integral" of velocity is distance. The first passion to answer was confusing integral and derivative.
110 von 1,661 Fragen im Vorstellungsgespräch