Software Development Engineer I Interview Questions | Glassdoor.co.in

Find jobs for Software Development Engineer I

Software Development Engineer I Interview Questions

172

Software development engineer i interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

Find the longest palindrome in a string

3 Answers

O(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/UhJCXiLSKv0

Check 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

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 Answers

1. Copy a linked list with random pointer. 2. Find an element in a sorted 2-D array top to bottom and left to right 3. Find cycle in a liked-list

1 Answer

Determine the anagrams of a word in a file

1 Answer

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 Answer

Bar raiser round with Given that the input is a binary tree connect all the elements in the same level or depth using links.

1 Answer

Diagonals of a tree

1 Answer

It was easy interview, just be confident

1 Answer

Size of market of used diapers in India.

1 Answer

1) Difference in Angular JS 1 and Angular JS 2 2) Impact of Angular JS 2 for Ionic framework. 3) Which version of Angular JS are you using? 4) Which version of Bootstrap are you using? 5) What is the difference between Phongap and Cordova? 6) Given: var a = [1,2, 3]; Ho do you implement : a.sum() returns summation of the values in that array.

1 Answer