Software Developer Interview Questions
- 0of 0 votes
AnswersExplain the difference between ORM and JDBC.
- mmoshikoo October 20, 2018 in United States
Provide some examples and when to use one over the other.| Report Duplicate | Flag | PURGE
Microsoft Software Developer General Questions and Comments - 0of 0 votes
Answersgiven two strings s1 and s2 we have to convert s1 into palindrome such that s1 contain s2 as a substring. in a minimum number of operation. wherein a single operation we can replace any word of s1 with any character.
- GB11 October 17, 2018 in India
constraint : |s1| <= 1000
|s2| <= |s1|
ex: s1 = "abaa" , s2 = "bb"
output : 1| Report Duplicate | Flag | PURGE
Walmart Labs Software Developer - 0of 0 votes
AnswersGiven an array which represents columns, find the position of two columns which when removed will trap the maximum amount of water. This is related to trapping raining water problem.
- Ashish October 17, 2018 in India| Report Duplicate | Flag | PURGE
Amazon Software Developer - 0of 0 votes
AnswersGiven an unsorted array find the maximum distance between two elements satisfying the condition A[i] < A[j] where i < j. There will always be a solution.
- Ashish October 17, 2018 in India
For eg. 6, 9, 3, 2, 10, 2, 3| Report Duplicate | Flag | PURGE
Amazon Software Developer - 0of 0 votes
AnswersDatabase query response times have increased. An API which is dependent on this database will see - *
- __Joker October 10, 2018 in India
This is a multi-select answer.
Increase in the latencies.
Increase in RAM utilisation on the API servers
Increase in CPU utilisation on the API servers
Increase in 200 response codes
Increase in 5xx responses| Report Duplicate | Flag | PURGE
unknown Software Developer Software Design - 0of 0 votes
AnswerSetting a value in cache is failing. What are the acceptable production practices? *
- __Joker October 10, 2018 in India
1. Raise an exception immediately
2. Retry in equal intervals of time until the set call succeeds
3. Retry with exponential back off until the set call succeeds
4. Retry 2 or 3 times with exponential back off.
5. Retry 2 or 3 times with equal intervals of time.
This is a multi-select question.| Report Duplicate | Flag | PURGE
unknown Software Developer System Design - 0of 0 votes
AnswerWe have a database that allows 2 concurrent writes and 3 concurrent reads. Each read/write operation takes 10ms to complete. What is the time taken to process all the requests in the orders mentioned (all requests can be assumed to be coming in at the same instant of time and are operating on a single row in a table) - 1. write, write, read, write, read, read, write, read 2. read, write, read, write, read: *
- __Joker October 10, 2018 in India
1. 30 ms 2. 10ms
1. 60 ms 2. 10ms
1. 10 ms 2. 10ms
1. 20 ms 2. 10ms
1. 10ms 2. 20ms
1. 60ms 2. 30ms| Report Duplicate | Flag | PURGE
unknown Software Developer Database - 1of 1 vote
AnswerGiven an array, coin of size n, coin[i] denotes the no. of coins on the position i. Can move any number of coins from the position i to (i+1) or (i-1). What is the minimum no. of moves required to redistribute the coins, so that each position i has at least 1 coin ?
- 00pzz October 06, 2018 in India
Note: Summation of total coins on the array is exactly n.| Report Duplicate | Flag | PURGE
Amazon Software Developer Arrays - 0of 0 votes
AnswersMorse code is a method of transmitting text information as series of long and short sounds or visual signals. Pauses are used during transmission to group letters and words. The common convention for writing morse code is to use dots (.) and dashes (-) for the short and long signals however without including pauses (e.g. as spaces) morse code quickly becomes ambiguous. For example the code -....--.... has 13 valid translations (bans, bates, bath, begs, digs, etc)
- K14 October 03, 2018 in India
Write a function getAllEnglishTranslations which takes a morse code without any pauses and returns all valid translations.
std::vector<std::string> getAllEnglishTranslations(std::string morseCode)
Output must be sorted in ascending alphabetical order.
Assume there are only 7 alphabets and below are their mappings
M = dash-dash (--)
C = dash-dot-dash-dot (-.-.)
O = dash-dash-dash (---)
D = dash-dot-dot (-..)
I = dot-dot (..)
N = dash-dot (-.)
G = dash-dash-dot (--.)
Assume input code is a valid morse code| Report Duplicate | Flag | PURGE
Software Developer - 0of 0 votes
AnswersGiven a bench with n seats and few people sitting, tell the seat number each time when a new person goes to sit on the bench such that his distance from others is maximum?
- shivamdurani220 September 22, 2018 in United States| Report Duplicate | Flag | PURGE
Google Software Developer - 1of 1 vote
AnswersLets there are n stores.
- sam September 18, 2018 in United States
A customer order x items. All the stores might not have all the items from the order list. So find the store/combination of stores that can serve the order request such that the set that contain least number of stores is selected so that there are lesser number of shipments.| Report Duplicate | Flag | PURGE
Software Developer Algorithm - 0of 0 votes
Answersprint hockey stick number in pascal triangle where row of triangle can be upto 30000 and length of stick can be upto 100.
- Randhir September 09, 2018 in India| Report Duplicate | Flag | PURGE
Wissen Technology Software Developer Coding Data Structures Dynamic Programming Java - 1of 1 vote
AnswersFind top 10 most frequent words in the past hour, day and month from twitter service. Given a streaming data such as tweets from twitter service, the objective is to find the top 10 frequent words in the past hour, day and past month at any instant of time.
- Pedro August 07, 2018 in United States for Maps| Report Duplicate | Flag | PURGE
Google Software Developer - 1of 1 vote
AnswersWrite a function that takes a magic number and a list of numbers. It returns true if it can insert add or subtract operations in the list of numbers to get the magic number. Otherwise, it returns false.
- Pedro July 11, 2018 in United States
For example:
f(10, [1,2]) = false. There's no way to add or subtract 1 and 2 to get 10.
f(2, [1,2,3,4]) = true. 1 + 2 + 3 - 4 = 2.
f(0, []) = true
f(1, []) = false
f(1, [1]) = true
f(0, [1]) = false| Report Duplicate | Flag | PURGE
Google Software Developer - 1of 1 vote
AnswersI don't remember perfectly the question, but it was like this
- mmoshikoo July 10, 2018 in Israel
Given a list of 100 songs on your cell phone, find a way for each user to hear the songs without repeating songs, you need to use an algorithm that uses shuffle for songs.| Report Duplicate | Flag | PURGE
Microsoft Software Developer Algorithm - 1of 1 vote
AnswersImplement a rate-limiter-like iterator and how to improve the space complexity
- sun2gz July 05, 2018 in United States
Given a <Word, TimeStamp> pair data type iterator as input. Implement an iterator based on it which can ignore the item if the same word has occurred in the past 10 seconds.
My implementation is to use a HashMap to memorize the word and its latest timestamp + 10s. For each new item, it will be checked against the HashMap to see if it has duplicated word occurred in the past 10s.
The interviewer asked me how to improve the space complexity if the string value varieties are infinite. He mentioned some boundary stuff.
Could anyone share some thoughts?| Report Duplicate | Flag | PURGE
Google Software Developer - 2of 2 votes
AnswersI was asked to design a system on a whiteboard which simulate a executor.
- Patrick July 01, 2018 in United States
This system has a method that is being triggered every second. I need to add logic to the method (i.e. run jobs).
There is also a method called job_arrived() that is called when a new job arrives.. I need to implement it as well.
I needed to implement a system which tries to run each job right when it is arrived (it has a return value that gets a success status from a black box service). if the job ran successfully that's the end of it..
if not I need to re-run it after 2 seconds (and if that fails as well - there will be no re-runs).
of course - more than one job can be accepted each second.
I was asked to describes the system (describe the classes and method) and consider the system to be large scale one (meaning.. threading is in order here..).
The answer I gave was apparently not multi threaded enough..
any idea to what I should have done?
Thanks guys| Report Duplicate | Flag | PURGE
Facebook Software Developer Java - 2of 2 votes
AnswersGive m balls and n bins. Find out how many ways to assign balls to bins. Notice the buckets has no order. Like (1,2,3) and (3,2,1) are considered the same.
- aonecoding June 24, 2018 in United States
eg, m = 3, n = 2, return 2. (1, 2) and (3, 0)| Report Duplicate | Flag | PURGE
Amazon Software Developer - -4of 4 votes
AnswerTwo Sum. Then follow up three sum
- James666 June 23, 2018 in United States| Report Duplicate | Flag | PURGE
Amazon Software Developer - 0of 0 votes
AnswersConsider a game similar to tennis. The game can be palyed by 'N' number of players. The player has to win atleast 'M' games to win a set.
- kumar June 05, 2018 in United States
Print all the possible combination of winning set for all the payers.
Where
2 <= N
1 <= M
For Example if [A, B] are the players and
if M = 2 The player has to win atleast '2' games to win a set.
The output will be
A A
A B A
B A A
B B
B A B
A B B
if M = 3 The player has to win atleast '3' games to win a set.
The output will be
A A A
A B A A
A A B A
B A A A
B B B
B A B B
B B A B
A B B B
Write an algorithm to print all the possible combination of winning set for all the payers| Report Duplicate | Flag | PURGE
Oracle Software Developer - 0of 0 votes
AnswersFind Duplicate number from a huge amount of data which cannot fit in the memory.
- CodeNinja June 03, 2018 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Developer Algorithm - 1of 1 vote
AnswersFind kth-largest number from a huge amount of data which cannot fit in the memory.
- CodeNinja June 03, 2018 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Developer Algorithm - 0of 0 votes
AnswersHow you will design and make a website like Hackerrank? How you will measure and limit the running time and memory usage of the program.
- johnallen582 May 25, 2018 in India for AWS| Report Duplicate | Flag | PURGE
Amazon Software Developer System Design - 0of 0 votes
AnswersWrite a function that receives string with decimal number (i.e. all characters are decimal digits) and prints the sum of all possible substring-numbers, example:
- leonid.ge May 04, 2018 in UK
sum(“123”) = 123 + 12 + 23 + 1 + 2 + 3 = 167| Report Duplicate | Flag | PURGE
Credit Suisse Software Developer Algorithm - 0of 0 votes
AnswersGiven N number of Strings, generate all combination of these String's characters, these Strings must be N long, and must contain only one number of char from each string.
- sapadt May 04, 2018
example: "abc", "def", "ghi" --> adg, adh, adi, aeg ... cfg| Report Duplicate | Flag | PURGE
Morgan Stanley Software Developer Algorithm - 0of 0 votes
AnswersYou are given the length and time of occurrence of packet and Queues which process packets. Total processing time for a packet is equal to the length of packet plus the waiting time in queue. For eg lets say we have only one queue for now, and A packet of length 5 comes at t = 1, and another packet of length 4 comes at t = 3. Total processing time for first packet is 5( no waiting time as queue is empty at t = 1) and at t = 3, 2 units of first packet is processed and 3 units remaining so, for second packet 3 units will be waiting time in queue plus 4 units for its length. Total processing time for 2nd packet is 7 units. If there are multiple queues you can add new packet in any of the other queues. Given the time and length of all incoming packets, we need to find the minimum no. of queues required such that total processing time of each packet is less than 10 units. Maximum possible no. of queues are 5. If you require more than 5 queues print -1.
Test Cases Format: First Line contains the number N, the total no. of packets and N following line contains two numbers ti, li where li is length of packet coming at time = ti units.
Test case1:
2
2 7
5 8
Test Case 2:
3
1 3
2 3
3 5
Test Case 3:
3
1 5
2 4
3 8
Output:
Case1: 2
Case2: 1
Case3: 2
Consider the following time table of incoming packets:time packets-length 1 8 2 5 3 2 4 6
If you put the packet in queue with minimum time then this will lead to 3 queues:
- ak4017 April 25, 2018 in United States
t = 1:
q1: 8
t = 2:
q1: 7
q2: 5
t = 3:
q1: 6
q2: 4, 2
t = 4:
q1: 5
q2: 3, 2
q3: 6
But its output should be 2 queues:
1) 8 in queue 1
2) 5 in queue 2
3) 2 in queue 1
4) 6 in queue 2| Report Duplicate | Flag | PURGE
Samsung Software Developer Algorithm - 0of 0 votes
AnswersYou are given an array of strings. For example, ["AB", "BC", "FOO", "ZA", "BAZ"]
- thriver April 22, 2018 in United States
- Output strings where you can get from one to the other using any ROT transformation.
ROT_1(AB) = BC
ROT_1(BC) = CD
ROT_25(AB) = ZA
AB,BC you can go from one to the other using ROT_1
Input: list of strings
Output: strings where you can get from one to the other using any ROT transformation.
Example:
Input : ["AB", "BC", "FOO", "ZA", "BAZ"]
Output: [ [ab, bc] , [ab, za] ]
AB,BC because you can go from one to the other using ROT_1
AB,ZA because you can go from one to the other using ROT_25
Do not return FOO, BAZ you can’t get from one to the other.| Report Duplicate | Flag | PURGE
Google Software Developer - 0of 0 votes
AnswersGiven an array of elements print even and odd numbers out of it using 2 threads . even_thread and odd_thread.
- anaghakr89 April 19, 2018 in United States
int arr[] = {3,1 ,2, 5, 6, 7, 8, 10, 9};| Report Duplicate | Flag | PURGE
Qualcomm Software Developer - 1of 1 vote
AnswersInterleave list of lists in Java
- npkatre102 April 18, 2018 in United States
Example:
input = [[1,2,3], [9, 0], [5], [-4,-5,-2,-3,-1]];
output = [1,9,5,-4,2,0,-5,3,-2,-3,-1]| Report Duplicate | Flag | PURGE
Facebook Software Developer
Open Chat in New Window