Senior software engineer im test sollicitatievragen

250

Sollicitatievragen voor Senior Software Engineer Im Test gedeeld door sollicitanten

Meest gestelde sollicitatievragen

Sorteren: Relevantie|Populair|Datum
LinkedIn
Er werd een Senior Software Engineer In Test gevraagd...20 september 2015

Search a sorted array for the first element larger than k

6 antwoorden

#!/usr/bin/env python """Search a sorted array for the first element larger than k. """ def srch(list1, srchItem): """Perform Binary search and find the first element that is larger than the arg srchItem @list1: The sorted list @srchItem: The element to be searched for finding next greater value than that """ len1 = len(list1) startIdx = 0 stopIdx = len1 - 1 stop = False # saveIdx the index of the lowest value in the sorted list saveIdx = -1 while not stop and startIdx >= 0 and stopIdx srchItem: # found greater item, but the previous one also could be greater stopIdx = midIdx - 1 saveIdx = midIdx elif list1[midIdx] srchItem: saveIdx = startIdx break elif startIdx >= len1 or stopIdx < 0: break if saveIdx == -1: return -1 # not found return list1[saveIdx] def testAll(): testList = [3, 6, 9, 34, 67] print 'Test: %s SrchItem: %d' %(testList, 34) print 'Result: %d' %srch(testList, 34) testList = [3, 6, 9, 34, 67, 69] print 'Test: %s SrchItem: %d' %(testList, 34) print 'Result: %d' %srch(testList, 34) # test for result to be the 1ast item in the list testList = [3, 6, 9, 34, 67, 69] print 'Test: %s SrchItem: %d' %(testList, 68) print 'Result: %d' %srch(testList, 68) # test for result to be the ist item in the list testList = [3, 6, 9, 34, 67, 69] print 'Test: %s SrchItem: %d' %(testList, 1) print 'Result: %d' %srch(testList, 1) # item not in the iist testList = [3, 6, 9, 34, 67, 69] print 'Test: %s SrchItem: %d' %(testList, 70) print 'Result: %d' %srch(testList, 70) if __name__ == '__main__': testAll() Minder

//Run time complexity is logn public class FirstGreatestNumberThanK { public int prepareFirstGrtst(int[] a, int k) { return firstGrtst(a, 0, a.length - 1, k); } public int firstGrtst(int[] a, int start, int end, int k) { if (end == start + 1) { if (a[start] > k) return a[start]; else return a[end]; } else { int mid = (start + end) / 2; if (k == a[mid]) return a[mid + 1]; if (k > a[mid]) { start = mid; return firstGrtst(a, start, end, k); } else { end = mid; return firstGrtst(a, start, end, k); } } } public static void main( String[] args){ FirstGreatestNumberThanK f = new FirstGreatestNumberThanK(); // int[] a = {2,4,6,8,9,12,14,16}; // even length int[] a = {2,4,6,8,9,12,14}; // odd length // System.out.println(f.prepareFirstGrtst(a, 11)); // System.out.println(f.prepareFirstGrtst(a, 3)); // System.out.println(f.prepareFirstGrtst(a, 7)); // System.out.println(f.prepareFirstGrtst(a, 15)); // execute for even length data // System.out.println(f.prepareFirstGrtst(a, 14)); // execute for even length data // System.out.println(f.prepareFirstGrtst(a, 4)); System.out.println(f.prepareFirstGrtst(a, 12)); System.out.println(f.prepareFirstGrtst(a, 2)); } } Minder

def find_greater(aList, item): high = len(aList) low = 0 while low < high: mid = (high + low) // 2 if item < aList[mid]: high = mid else: low = mid + 1 return aList[low] Minder

Meer reacties weergeven
Netflix

How would you translate input string into sequence of movements through on screen keyboard? What if you can loop through rows and columns?

3 antwoorden

Keep in mind that using matrix will leave you with quadratic running time. Using looping rows and columns will make algorithm slightly more complex, just have to decide which direction is it faster to move. Quite interesting optimal path question overall. Minder

So if I'm understanding correctly, you're given a string (e.g. "Star Wars") and an on-screen keyboard accessible through an up-down-left-right controller. The goal is to be able to convert a given string into a sequence of UDLR commands that will enter that string through the keyboard. What if you pre-calculated a map of the optimal path between any two keys? Store it in a hashmap where the key is "current_position+desired_position" (e.g. from "Star Wars", you would have entries for "S+t", "t+a", "a+r", etc.) and the value is a sequence of U+D+L+R indicating the cursor moves. You could even get clever and store it as some kind of routing table, similar to what is used for internet routers. Think of each letter on the keyboard as a router that has a route to each of its neighbors in the UDLR directions. Then, inject a dictionary of strings into the network based on movie titles, actor names, etc. from each "endpoint" and let it learn the most efficient way to enter each of them. This way, when you go to internationalize or change keyboard layouts, you can re-create an efficient map automatically. Minder

It's essential to demonstrate that you can really go deep... there are plenty of followup questions and (sometimes tangential) angles to explore. There's a lot of Senior Software Engineer In Test experts who've worked at Netflix, who provide this sort of practice through mock interviews. There's a whole list of them curated on Prepfully. prepfully.com/practice-interviews Minder

LinkedIn

Find indices start and end for a particular value in a sorted integer array with duplicates

3 antwoorden

Explained simple way to do this using linear search and binary search and coded up using binary search Minder

public int firstOccur(int[] arr, int k) { if (arr == null || arr.length combinedOccur(int[] arr, int k) { BinarySearchOccurences obj = new BinarySearchOccurences(); int startIndex = obj.firstOccur(arr, k); int endIndex = obj.lastOccur(arr, k); if (startIndex == -1 || endIndex == -1) { throw new IllegalArgumentException("k does not exist in array"); } ArrayList result = new ArrayList(); result.add(startIndex); result.add(endIndex); return result; } Minder

public int firstOccur(int[] arr, int k) { if (arr == null || arr.length combinedOccur(int[] arr, int k) { BinarySearchOccurences obj = new BinarySearchOccurences(); int startIndex = obj.firstOccur(arr, k); int endIndex = obj.lastOccur(arr, k); if (startIndex == -1 || endIndex == -1) { throw new IllegalArgumentException("k does not exist in array"); } ArrayList result = new ArrayList(); result.add(startIndex); result.add(endIndex); return result; } Minder

LinkedIn

Coding: Create a stack with the usual push() & pop(), but with an additional function getMiddle() that returns the middle element of the stack in constant time.

3 antwoorden

import os import re import sys class Stack: def __init__(self): self.arrList = [] def isEmpty(self): if len(self.arrList): return False else: return True def push(self, val): self.arrList.append(val) def pop(self): if not self.isEmpty(): self.arrList[len(self.arrList)-1] self.arrList = self.arrList[:len(self.arrList)-1] else: print "Array list is empty" def returnMiddle(self): if not self.isEmpty(): mid = len(self.arrList)/2 return self.arrList[mid] else: print "Array list is empty" def listStack(self): print self.arrList s = Stack() s.push(5) s.push(6) s.listStack() print s.returnMiddle() s.pop() s.listStack() s.push(20) s.push(45) s.push(435) s.push(35) s.listStack() print s.returnMiddle() s.pop() s.listStack() Minder

public int getNext(int[] ar, int k) { int low = 0; int high = ar.length-1; int mid = low+(high-low)/2; if (ar[high] k && (mid==0 || ar[mid-1]<=k)) { return ar[mid]; } if(ar[mid]<=k) { low = mid+1; } else { high = mid; } mid = low+(high-low)/2; } return -1; } Minder

public class CreateStack { List l = new LinkedList(); public void push(Integer i) { l.add(i); } public void pop(){ l.remove(l.size()-1); } public Integer getMiddle(){ return l.get((l.size()-1)/2); } } Minder

Pearson

Couple of questions asked at the interview I could not get my head around and never expected in an interview in a company like Pearson which is internationally recognized. 1.You are just 2 years in United States and looking for a job change? 2.Why are you looking for a full time opportunity?(Seems the person did not read my resume carefully that I am full-time employee with Cognizant for more than 8 years now) These questions asked does not support the claim of Pearson that it is a equal opportunity employer.And proves there are discriminations made.

3 antwoorden

I think those 2 are valid questions. When they asked about moving out in 2 yrs, they might be trying to get handle on you whether you have any cultural issues working in United States. When they asked about full time. They did fully understood your resume and asked that question. You are full time to cognizant, and might be working at some client location as contractor to client from cognizant and not working at Cognizant location and on a Cognizant product. The interviewer fully understood how cognizant, TCS and Wipro full time employees work in United states. Moreover, I dont think these 2 questions and answers to questions make them to take different decision. I disagree with your comment on equal opportunity employer and discrimination comment. I know lot of people from different background and different countries working at Pearson. I hope you will find a good opportunity in future. All the best. Minder

To add more to what i have said above. The banking company and the broadcasting i mentioned in my earlier post both have employees coming from different background and countries but my experience was completely different. It is the people who represent an organisation and i still believe this kind of questions represents Pearson that it is not 'fully' equal opportunity employer and discrimination are made. Thanks Minder

To begin with this was not my first onsite interview in the united states. Early last year i got a full time offer of senior developer with the largest broadcasting and cable television company in the world.Due to personal reason i did not join that company.And i have an open invitation from the Director of Engineer (the hiring manager)of that company to consider working with that company in future.There were four rounds of technical interview and then interview with the hiring manager,none of them asked how long have i been in the united states instead the hiring manager took me to lunch with him (the very first day i met with this person). The second onsite interview was with the eighth-largest bank holding company in the United States. And this time to my utter surprise one of the hiring managers told me "Now a days Indian IT companies like Tata Consultancy Services no longer bringing their employees on H-1B instead they are bringing employees on L1 Visa so that employees can not change their jobs in USA".I do not think any sane interviewer can tell all this in an interview.Well this time i did not get an offer and i was happy that i did not. Now coming to interview at Pearson, the question "You are just 2 years in United States and looking for a job change?" is not at all valid to the best of my knowledge. If the interviewer had intention of knowing whether i have any cultural issues he could have asked the question in thousand different ways but not the way i was asked And you know it better. This short of questions comes out of prejudice not ignorant. I can challenge if there were a single wrong answer given during technical phone screen and in the onsite technical round.So where is the feedback of my technical interview. Just saying " we have decided to concentrate our attention on other candidates who we believe best meet the current needs of our organization" does not put proper light into the evaluation process. My advice is try to hire 'Characters' not skills because skills are cheap these days. Best of luck with finding talent!!! Thank You. Minder

LTI

Public int compareTo(object o) { Employee emp = (Employee)o; return this.id - e.id; }

3 antwoorden

Output should be 0. Since compareTo() implements Comparable interface.

Have you received offer.?

Have you received offer?

Typeform

Code a FizzBuzzRazz test. If it's divisible by 3 print "Fizz" if it's divisible by 5 print "Buzz" if it's divisible by 7 print "Razz" if it's divisible by 3 and 5 print "FizzBuzz" if it's divisible by 3 and 7 print "FizzRazz" if it's divisible by 5 and 7 print "BuzzRazz"

2 antwoorden

Same as FizzBuzz but if it's divisible by 7 and 5 and 3 print FizzBuzzRazz. You'll have to concatenate strings. public static String fizzBuzzRazz(int number) { String result = ""; if (number % 3 == 0) { result +="Fizz"; } if (number % 5 == 0) { result += "Buzz"; } if (number % 7 == 0) { result += "Razz"; } return result.isEmpty() ? String.valueOf(number) : result; } Minder

const FIZZ = 'Fizz'; const BUZZ = 'Buzz'; const RAZZ = 'Razz'; const fizzBuzzRazz(number) { if (number % 3 == 105) { return `${FIZZ}${BUZZ}${RAZZ}`; } else if (number % 15 == 0) { return `${FIZZ}${BUZZ}`; } else if (number % 21 == 0) { return `${FIZZ}${RAZZ}`; } else if (number % 35 == 0) { return `${BUZZ}${RAZZ}`; } else if (number % 7 == 0) { return RAZZ; } else if (number % 3 == 0) { return FIZZ; } else if (number % 5 == 0) { return BUZZ; } return number; } Minder

TechChefs Software

Selenium - system test to login into web application with combination of username and password reading excel

1 antwoorden

Use data provider annotations and declare username and password as the variables. and from excel extract the username name and password in form for list or array. and using data provider you can test it for both valid and non valid username and password. NOTE:- @dataprovider annotation follow one to one mapping do care of that while providing values in your test case. Minder

Netflix

Given the functions Up(), Down(), Left(), Right(), Enter() write the function that would take Str (like Hobbit:_Unexpected_Journey) and type it using keypad (the kind you have on Smart TVs, etc.)

1 antwoorden

In these sorts of interviews you really need to drill down and understand what the interviewer is looking for. A good way to simulate a real interview experience is to do a mock with one of the Netflix Senior Software Engineer In Test experts on Prepfully, rated super strongly on TrustPilot... prepfully.com/practice-interviews Minder

OpenX

maximum contiguous subarray problem..

1 antwoorden

extremely well and interviewer was happy with my solution as it passed the testcases (we tried with all -ve numbers) Minder

Weergave: 1 - 10 van 250 sollicitatievragen