Software engineer Interview Questions in Sunnyvale, CA | Glassdoor

Software engineer Interview Questions in Sunnyvale, CA

Software engineers write programs to design and develop computer software. Interviews are highly technical, so come ready to work through coding problems and math brainteasers. The specific questions you are asked will depend on what type of programming position you are looking for. Try researching a specific software discipline such as web development, application development, or system development.

Top Interview Questions

Sort: RelevancePopular Date

Partition an array in such way zeros to be moved on the left side of the array, other numbers on the right side of the array. Extra storage not allowed, only in-place.

6 Answers

int j = 0; for (int i = 0; i j) { vec[i] = vec[j]; vec[j++] = 0; } }

correction: the loop body should be: if (vec[i] == 0) { if (i > j) { vec[i] = vec[j]; vec[j] = 0; } j++; }

I progress a zero pointer from right to left, and a non-zero pointer from left to right, then swap them until they meet in the middle. int j=N-1; int i=0; for(i=0; i=0; j--) if(array[j]==0) break; //j points to right-most zero while(j>i){ swap(i,j) for(; i=0; j--) if(array[j]==0) break; }

Some probability question 1) given a rand5() function which provide a random number between 1-5 at equal probability. Write a rand7() fuction to provide a random number between 1-7 with equal probability...

5 Answers

Write a function in Java that will take a sorted array of ints, possibly with duplicates, and compact the array removing all the duplicate numbers. That is, if the contains the numbers - 1, 3, 7, 7, 8, 9, 9, 9, 10, then when the function returns, the contents should be - 1, 3, 7, 8, 9, 10. Be sure your answer is as efficient as possible. Describe the efficiency of your algorithm using big O notation.

5 Answers

1. You have n doors in a row that are all initially closed. You make n passes by the doors starting with the first door every time. The first time through you visit every door and toggle the door (if the door is closed, you open it, if its open, you close it). the second time you only visit every 2nd door (door #2, #4, #6. third pass you toggle 3rd, 6th, 9th door. What state are the doors in after the last pass? which doors are open ?

7 Answers

Design a data structure to store sparse 2D matrix which contains only 0 or 1. then write function to add 2 such matrix.

4 Answers

Basic data structure and design questions.

6 Answers

why should i not hire you

4 Answers

fair, lot of position related tech questions. Given a string "Keyword" find whether the characters exist in a String "Target" in the same order but not necessarily next to each other Keyword cat aaa Target cbate abcde Output YES NO

4 Answers

There are many conference room at Amazon, your manager want you to book a conference room for a meeting. The number of people and time is given. Please return a list of rooms which are available at that time and have enough capacity.

4 Answers

2. /** * A tournament tree is a binary tree * where the parent is the minimum of the two children. * Given a tournament tree find the second minimum value in the tree. * A node in the tree will always have 2 or 0 children. * Also all leaves will have distinct and unique values. * 2 * / \ * 2 3 * / \ | \ * 4 2 5 3 * * In this given tree the answer is 3. */ class Node { Integer value; Node left, right; Node(Integer value, Node left, Node right) { this.value = value; this.left = left; this.right = right; } } class Solution { /** * This should return the second minimum * int value in the given tournament tree */ public static Integer secondMin(Node root) { } }

5 Answers