Developer I Interview Questions | Glassdoor.co.in

# Developer I Interview Questions

208

Developer i interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

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

24 Mar 2012
 Find the longest palindrome in a string3 AnswersO(N^2) solution in java: //Now implement the improved method public static String LongestPalindromeImprove(String in) { char[] input = in.toCharArray(); int longestStart = 0; int longestEnd = 0;//we also need global start/end to keep track of the current best as we process //now the key is to scan from mid to both ends for(int mid=0; mid=0 && rightlongestEnd-longestStart)//the longer is found! { longestStart = left; longestEnd = right; } } left--; right++;//sorry added in wrong place, should be in either case per mid choice } //well for even case we need replicate the previous code by making one change left = mid; right = mid+1;//for example 123321 when we choose 33 as mid while(left>=0 && rightlongestEnd-longestStart)//the longer is found! { longestStart = left; longestEnd = right; } } left--; right++; } //do not forget to increase right and decresea left!!! } //after the loop we return return in.substring(longestStart, longestEnd+1); } I also made a demo video to show the whole process to solve this problem with a comparison naive (O(N^3)) method and a test case at http://youtu.be/UhJCXiLSKv0Check out the nice C code.. http://justprogrammng.blogspot.com/2012/05/find-longest-palindrome-in-string-onn-c.html/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package towerofhanoi; import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; /** * * @author sanal */ public class PalindromeEx { public boolean isPalindrome(String str){ char[] chars = str.toCharArray(); int left = 0; int right = chars.length-1; int mid = chars.length/2; for(left=0;left

### Software Development Engineer I at Microsoft was asked...

17 Aug 2012
 You've a singly linked list where every node in the list has a field "random" which points to other node in the same list. Write a function to clone this list (create a new copy of the same). Don't use extra space (just the pointer variables are fine).3 AnswersIf any problem has the condition, "Don't use extra space", it in-directly means that, you can modify the list. Clarify it. It took some time for me to clarify that I'm allowed to modify the source list.didnt get the point can you please elaborate ???There is a singly linked list: A -> B -> C -> D -> E Each node has another variable called "random". It points to another node in the same list. For example, the "random" variable in the node "B", points to some other node in this list. Say, "E". Now the question is to clone this list. Got it?!

### Software Developer I at ANSYS was asked...

10 Jul 2013
 Prove that limit theta tends to zero sin(theta) / (theta) tends to one?3 AnswersIt requires the understanding of trigonometry and circle geometry.Use taylor expansionSimply use L'Hôpital's rule, it's Calculus I.

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

24 Mar 2012
 Determine the anagrams of a word in a file1 Answerthis blog has nice java code.. http://justprogrammng.blogspot.in/2012/06/determine-anagrams-of-word-in-file.html

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

24 Sep 2013
 Describe, in as much detail as possible, everything that happens on a Linux machine from the point when you hit the enter key after typing "./a.out" to the moment when "Hello World!" gets printed on the screen.1 AnswerIt isn't difficult as such, but compared to the algorithmic questions, it is quite subjective. The test here is on how well you know the internal workings of the OS and how it interacts with the hardware.

### Software Development Engineer I at Flipkart was asked...

20 May 2019
 Basically Related to Data Structure and Algorithm.1 AnswerYou have to have basic knowledge of Data structures and Algorithms.

### Software Development Engineer I at D. E. Shaw India was asked...

30 Jul 2014
 Size of market of used diapers in India.1 AnswerCouldn't Answer it properly. No market i said.

### Software Development Engineer I at Microsoft was asked...

17 Aug 2012
 Some other standard questions: 1. Given a BST and a range, print all the numbers that comes in that range. Ex: the function will be something like: print(node * head, int x, int y); It has to print all numbers within the rage x&y 2. Print max height (level) of a binary search tree. 3. Given an array of integers, determine the sub array which makes max sum. 4. Find LCA of the binary search tree.1 AnswerJust do a Google search :)

### Software Development Engineer I at Microsoft was asked...

17 Aug 2012
 Imagine there are n cities (say c1, c2....cn) connected circularly and each of them has a petrol bunk (say p1,p2...pn). The distance between each cities are d1, d2...dn. Here 1unit of petrol will be used to travel 1unit of distance. You can start from any city so that you can go through all of them and reach the same location (city). Find from where we've to begin the navigation. FOR EXAMPLE: c1-->c2-->c3-->c1 p1 has 2ltr p2 has 10ltr p3 has 4ltr and the distance between each cities: c1<-->c2: 3 c2<-->c3: 2 c3<-->c1: 8 Here we've to start at c2 in-order to come back again to the same place. Explain the logic to find whether u can come back to the same location. Find where to start. Write a program for the same. Write test cases for the same.1 AnswerIts already discussed in stackoverflow.

### Software Development Engineer I at Microsoft was asked...

17 Aug 2012
 Write a program to iterate through a 2D grid in a spiral way. Since I can't attach images here, I'll explain it using an array. Imagine you've a nxm matrix of bytes. you've iterate through it in a spiral way. It means, iterate the first row (left to right), then iterate through the right most column (top-bottom) then iterate the bottom most row (right-left) until you reach the center of the matrix. Hope its clear now.1 AnswerI used a recursive function with counters to keep track of the index and identify the direction. (0 -> left-right; 1 -> top-bottom, 2 -> right-left, 3 -> bottom-up). Also did direction "mod%4" during the increment operation.
110 of 208 Interview Questions