Softwareentwickler Interview Questions | Glassdoor.ie

# Softwareentwickler Interview Questions

1,512

softwareentwickler interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

### Software Engineer at Amazon was asked...

28 Dec 2010
 you have array with n elements. How would you do circular shift of k positions? Time and space complexity?6 AnswersMake a circular linklist, and move headpointer K position to do K shifts. It's O(n) time complexity. Space is contant. (circular link list).Well, space isn't constant because you took an array and then copied it somehow to a linked list. Remember, you were given an array? If I understand the question correctly, they're asking to do a circular shift of some range of values, like the first k values in an array of length n? So if you wanted to shift right, temp = array[k] from index=k to 1 array[index] = array[index-1] array[0] = temp this would be O(k)? I mean, it would take k steps, but maybe it's somehow still O(n)oh, sorry, I misunderstood. Not k values, move everything k positions. Praveen Chettypally's answer works but the space complexity would be O(n) since there is a fully copy of the list? The simplest would probably be to make another array and copy in, starting at the (n-k)th element, going to the end, then starting at the beginning. A second array would probably be a better option than a completely different data structure. What if it has to be done in place? is there an O(n) solution?Show more responsesalright - http://stackoverflow.com/questions/876293/fastest-algorithm-for-circle-shift-n-sized-array-for-m-position shiftArray( theArray, M ): size = len( theArray ) assert( size > M ) reverseArray( theArray, 0, size - 1 ) reverseArray( theArray, 0, M - 1 ) reverseArray( theArray, M, size - 1 ) O(n) with no extra storage. Wish I could have thought of that one myself...I beieve this does the trick too: public static String shiftArray(char[] inputArray, int shiftLen) { assert(inputArray != null); int length = inputArray.length; assert(length > shiftLen); int moves = 0, from= 0, to = 0; char next, last; to = (from + shiftLen) % length; next = inputArray[from]; while(moves < inputArray.length) { last = inputArray[to]; inputArray[to] = next; next = last; from = to; to = (from + shiftLen) % length; moves++; } return String.valueOf(inputArray); }I tried the above function - shiftArray and the looks is not working: shiftItemsFromList class: class shiftItemsFromList{ public static String shiftArray(char[] inputArray, int shiftLen) { assert(inputArray != null); int length = inputArray.length; assert(length > shiftLen); int moves = 0, from= 0, to = 0; char next, last; to = (from + shiftLen) % length; next = inputArray[from]; while(moves < inputArray.length) { last = inputArray[to]; inputArray[to] = next; next = last; from = to; to = (from + shiftLen) % length; moves++; } return String.valueOf(inputArray); } } Part of the main function: System.out.println("Circle Shift N size array for M possitions:"); char [] array = {'a', 'b', 'c', 'd', 'e', 'f'}; shiftItemsFromList sh = new shiftItemsFromList(); String s = sh.shiftArray(array, 2); System.out.println("Print the Circle Shift N size array: " + s); System.out.println("DONE"); OUTPUT: Circle Shift N size array for M possitions: Print the Circle Shift N size array: cbadaf DONE

30 Mar 2018
 I show them my IOT project which works with the MQTT protocol. They ask what other protocols are available for IOT.4 AnswersI answered them that I have no idea. (lolz)BTW,what's the content roughly of 1:1 basics coding exercise.If you ask ROUGHLY, it's like a list of incomplete small programs you need to complete/solve. Like a in-class CA. The purpose of this is to understand how you solve problem (logical thinking stuffs).Show more responsesI am not from coding background and have my knowledge limited till functions. Hardly I know anything about classes and objects and other OOPS concepts. So are the questions more inclined towards OOPS concepts or can they be solved without OOPS?

27 Apr 2015
 Give a range of numbers, return 6 different numbers randomly. In O(n).3 AnswersSuppose the range from 0 to 100 1- Create and initialize an array of 101 elements, filled from 0 --> 100 2- Set the max to be the last element in the array i.e max = 100 3- Get a random number between 0 and max. r= rand(0,max) 4- Replace array[r] with array[max] and decrease max by 1(max = max -1) 5- Repeat from step 3As this question is usually posed, there is an additional constraint: the numbers are presented in a stream, and you do not have enough memory to store them all.public static void main(String[] args) { int max = 100; Integer[] nums = new Integer[max]; for (int i = 0; i < nums.length; i++) { nums[i] = i; } Collections.shuffle(Arrays.asList(nums)); for (int i = 0; i < 6; i++) { System.out.println(nums[i]); } }

12 Jul 2014
 Enumerate the following from 1 to 4, being 1 the fastest to execute and 4 the slowest: - read cpu register - disk seek - context switch - read from main memory3 Answersread cpu register-1 context switch-2 read from main memory-3 disk seek-4context switch - 31 CPU 2 Memory 3 Context switching 4 Disk

19 May 2015

1 Jul 2019
 Implement a function to simplify a unix based path. Example: input: /a/b/../c/. output: /a/c2 AnswersImplemented with a stack.Leetcode: simply path

### Software Developer at McAfee was asked...

2 Apr 2013
 Nothing special ...basic questions about my CV. They asked about why you would use SQL stored procedure instead of SQL script in the web application2 Answersmainly around the securityStored procedures give us many advantages over using sql scripts and SQL ... to use Stored Procedures to enable our web and windows applications to ... Our application code that creates a dynamic SQL string might look something like: ... Let us now see why you should use a Stored Procedure rather than in-line SQL

### Software Engineer at Zendesk was asked...

14 Sep 2016
 Write a simple cipher that will take a string and replace each letter in the range a-z with the corresponding character 13 steps along the alphabet.2 Answersdef cipher(string) string.chars.each_with_index do |char, index| string[index] = (char.ord + 13).chr end endDoesn't wrap around. I think what you're looking for is: def cipher(string) a = 'a'.ord string.chars.each_with_index do |char, index| string[index] = ((char.ord - a + 13) % (26) + a).chr end end

### Software Engineer at IBM was asked...

16 Mar 2016
 The first interview was carried out by two team leads. Their questions were general queries into my previous experience and the subjects studied during my time in college. The second interview was carried out by the manager and was used to get to know me on a personal level.2 AnswersHow long did it took you to get an offer letter (after the call from recruiter,confirming your selection) ?It took roughly 4 weeks before I got a confirmation from the recruiter and the letter came immediately afterwards.

### Software Developer at Amazon was asked...

14 Jul 2017
 You have 50 balls, half white and half black. You have to put all the balls in two boxes and then I choose one ball from any of the boxes without seeing. If I choose a black ball I win, if I choose a white one you win. How would you distribute the balls in the boxes in such way that you have more odds to win.2 AnswersPut a single white ball in one box and all other balls in the other. Gives you close to 75% chance...Correct but in this case its the black ball
110 of 1,512 Interview Questions

More