Software Developer Interview Questions
- 0of 0 votes
AnswersWrite a program to get the user name and age
- D PRAVEEN KUMAR October 04, 2016 in India
Condition:
The name should be more than six characters and it shouldn’t contain any other characters than alphabet(like !,@,#,$,^,& these are not to be present)
The age of the employee must between 18-35| Report Duplicate | Flag | PURGE
HTC Global Services Software Developer C++ - 1of 1 vote
AnswersGet an 0. From user and display it’s prime factor
- D PRAVEEN KUMAR October 04, 2016 in India
Example 24 is 2,2,2,3 and 55 is 5,11| Report Duplicate | Flag | PURGE
HTC Global Services Software Developer C++ - 0of 0 votes
AnswersIn a college library fines are issued according to the following condition
- D PRAVEEN KUMAR October 04, 2016 in India
If return books exceeds the due date
Up to 5 days 20rs fine
6-10 days 50rs fine
>10 days 100rs fine
More than 30 days membership will be cancelled
Get the due date from the user and calculate| Report Duplicate | Flag | PURGE
HTC Global Services Software Developer C++ - 0of 0 votes
AnswersWrite a program to get a string and to convert the 1st letter of it to uppercase ?
- D PRAVEEN KUMAR October 04, 2016 in India| Report Duplicate | Flag | PURGE
HTC Global Services Software Developer C++ - 0of 0 votes
AnswerWrite a program to create a sentence at runtime and count number of vowels in it ?
- D PRAVEEN KUMAR October 04, 2016 in India| Report Duplicate | Flag | PURGE
HTC Global Services Software Developer C++ - 0of 0 votes
AnswersWrite a program to calculate the following i want a c++program for this condition 1+4+9+16+….+100
- D PRAVEEN KUMAR October 04, 2016 in India| Report Duplicate | Flag | PURGE
HTC Global Services Software Developer C++ - 0of 0 votes
AnswersWrite a class stringOperation to check whether the characters entered by the user are same or not
- D PRAVEEN KUMAR October 04, 2016 in India| Report Duplicate | Flag | PURGE
HTC Global Services Software Developer C++ - 0of 0 votes
Answerswrite default and parameterized constructor accepting two variables
- D PRAVEEN KUMAR October 04, 2016 in India| Report Duplicate | Flag | PURGE
HTC Global Services Software Developer Java - 0of 0 votes
Answerswrite a program to count number of prime number between two numbers entered by the user
- D PRAVEEN KUMAR October 04, 2016 in India| Report Duplicate | Flag | PURGE
HTC Global Services Software Developer C - 0of 0 votes
Answerswrite a function called reverse to print the reverse of the digit entered by the user.
- D PRAVEEN KUMAR October 04, 2016 in India| Report Duplicate | Flag | PURGE
HTC Global Services Software Developer C - 0of 0 votes
Answerwrite a program to implement following logic
- D PRAVEEN KUMAR October 04, 2016 in India
If the price of the book in between 100 to 500 book is “Normal Book”
If the price is between 501 and 5000 book is “Costly book”
If greater than 5000 than book is “precious book”| Report Duplicate | Flag | PURGE
HTC Global Services Software Developer C - 0of 0 votes
Answerwrite a program to add all the non-diagonal elements of a 2D array.
- D PRAVEEN KUMAR October 04, 2016 in India| Report Duplicate | Flag | PURGE
HTC Global Services Software Developer C - 1of 1 vote
AnswerWrite a program to implement following logic
- D PRAVEEN KUMAR October 04, 2016 in India
An employee can be promoted if
a) He has good communication skills
b) He is good in training
c) He is either good in programming or debugging.| Report Duplicate | Flag | PURGE
HTC Global Services Software Developer C - 0of 0 votes
AnswersFind unique integers from list of integers
# Question # Write a function that will return an array of integers that occur exactly once in a given array of integers. # e.g. For a list [1,2,3,5,2,2,3,4], return [1,5,4] since they appear once (order does not matter). def once_integers(integers):
Follow up:
Optimize the code if input is sorted.
- Saurabh October 03, 2016 in United States for Software Developement - Tools# What if the input is sorted, such as [1,2,2,2,3,3,4,5], could the algorithm be further optimized # (e.g. space complexity)? def once_integers_sorted(integers):
| Report Duplicate | Flag | PURGE
Linkedin Software Developer - 0of 0 votes
AnswersString Rotation. Given two string check if String1 is rotating match for String2
- Saurabh October 03, 2016 in United States for Software Developement - Tools# Given two strings. Write a function that will return true if one string is a rotation of the other string. # e.g. 'bca' and 'cab' are rotations of 'abc' and the function should return true # 'barbazfoo', 'oobarbazf' and 'rbazfooba' are rotations of 'foobarbaz' def is_rotation(string1, string2):
| Report Duplicate | Flag | PURGE
Linkedin Software Developer Algorithm - 0of 0 votes
AnswersYou are given a matrix of size n*m and need to count the number of submatrices which which have atleast k occurances of x and atleast two corner elements equal. Submatrices should have minimum two rows and two columns.
- sukhmeet032795 October 01, 2016 in United States
Example:
1 2 3
1 3 6
22 1 33
output: 4
i.e
a)
1 2
1 3
b)
1 2 3
1 3 6
c)
1 2
1 3
22 1
d)
1 3
22 1| Report Duplicate | Flag | PURGE
Sabre Holdings Software Developer Algorithm - 0of 0 votes
AnswersConsider a string A containing exactly X characters. A variant of A, A(k), can be obtained by doing a cyclic shift of A starting from position k (0 <= k < X). The number of characters after the shift in A(k) will remain the same as they were in A. Every j-th character (0 <= j <= X-1) of A(k) is equal to (k+j)%X character of A. We will call A a classic word if there are exactly M positions k such that A(k) = A
- Abhishek.Mathur.CA September 30, 2016 in United States
You are given array Q containing exactly R strings. For each permutation s = (s[0], s[1], ..., s[R-1]) of integers between 0 and R-1, inclusive, we can define a string generated by this permutation as a concatenation Q[s[0]] + Q[s[1]] + ... + Q[s[R-1]]. Find the number of permutations that generate classic words. All indices in this problem are 0-based
Constraints
Set Q will contain between 1 and 8 elements, inclusive. Each element will have 1 to 20 characters, inclusive
M will be between 1 and 200, inclusive
Input Format
Line 1: comma separated strings representing set Q
Line 2: Integer M
Output Format
Number of permutations that generate classic words
Sample Input
CD,QCCD,QC
2
Sample Output
3
Explanation
The classic words are "CDQCCDQC" and "QCCDQCCD". Permutation 0, 1, 2 generates the first, and 1, 2, 0 and 2, 0, 1 generate the second| Report Duplicate | Flag | PURGE
unknown Software Developer - 0of 0 votes
AnswersYour friend has invented a new compound consisting of N elements. However, he has forgotten the amount of each element that goes into the recipe.
- Abhishek.Mathur.CA September 30, 2016 in United States
For N-1 pairs of elements, he remembers the proportion in which the elements within each pair should be added to the compound. Fortunately, these N-1 proportions are sufficient to restore the recipe of the entire compound.
You are given N-1 proportions as String. Each String is formatted "#<a> and #<b> as <p>:<q>" (quotes for clarity), which means that the mass of element <a> divided by the mass of element <b> in the cocktail must be equal to <p>/<q> (all elements are 0-indexed). Print exactly N elements, where the first line is the mass of element 0 and second line is the mass of element 1 and so on... such that all the given proportions are satisfied and the total mass is as small as possible. The total mass must be greater than 0.
Input
Line 1: N
Line 2 .. N: proportion_i
Output
N lines of masses, as stated in the problem statement
Input Explanation
Line 1: N, the number of elements
Line 2 to line N: N-1 proportions, format described in the problem statement
Output Explanation
Output will contain exactly N lines, each line is the mass of the element such that all the given proportions are satisfied and the total mass is as small as possible. The total mass must be greater than 0.
Sample Input
3
#0 and #1 as 9:8
#1 and #2 as 9:8
Sample Output
81
72
64| Report Duplicate | Flag | PURGE
unknown Software Developer - 0of 0 votes
AnswersConsider a social website SocialX, where friends connect to each other, just as they do on Facebook
- Abhishek.Mathur.CA September 30, 2016 in United States
Friendship on SocialX is symmetric (if X is a friend of Z, then Z is also a friend of X) however not transient (if X and Z are friends and Z and Y are friends, then X and Y are not necessarily friends)
The term "k-joined" is defined as follows. If two people are friends, they are called 1-joined. For k >= 1, two people X and Z are called (k+1)-joined if X and Z are k-joined, or if there exists a person Y such that X and Y are k-joined and Y and Z are friends.
"Approachable Score" is defined as follows. If two people X and Z are not friends, then their Approachable Score is the fewest number of people (other than themselves) who must be removed from the network in order for X and Z to not be 3-joined. The higher the Approachable Score, the more likely it is that X and Z know each other.
Given a set of friends containing exactly K elements, where K is the number of people in the network. People are numbered from 0 to K-1. The j-th character of the i-th element of friends is '1' if i and j are friends, and '0' otherwise. Return the Approachable Score for personX and personZ
Constraints
Set of friends will contain exactly K (1 < K < 41) elements, where each element will contain exactly K characters. Each character will either be '0' or '1'
friends[i][j] will always be equal to friends[j][i] and friends[i][i] will always be equal to 0
friend[personX][personZ] will be equal to 0 and personX will never be equal to personZ
Input Format
Line 1: comma separated K elements representing friends
Line 2: Integer representing personX
Line 3: Integer representing personZ
Output Format
Integer representing Approachable Score
Sample Input
0100,1010,0101,0010
0
3
Sample Output
1
Explanation
Either remove person 1 or person 2 to get an Approachable Score of 1 for person 0 and 3| Report Duplicate | Flag | PURGE
unknown Software Developer - 0of 0 votes
AnswerAn instruction pipeline has the speedup factor 10 while operation with 80% efficiency. What could be the number of stages in the pipeline?
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Computer Architecture & Low Level - 0of 0 votes
AnswerConsider a four stage pipeline with the respective delays t1=60nSeconds, t2=70nSeconds, t3=100nSeconds, t4=80nSeconds and the latch delay of 10nSeconds. What is the approximate speedup when the very large number of instructions on pipeline?
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Computer Architecture & Low Level - 0of 0 votes
AnswersSuppose that a system taken 90% of the computation can be parallelized, What is the maximum speedup we can except from 8 processors according to the Amdahl’s law?
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Computer Architecture & Low Level - 0of 0 votes
AnswersWrite a C program to convert date from 24 hrs format to 12 hrd format? Ex: 23:10 = 11:10PM
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer C - 0of 0 votes
AnswersGiven a sorted (increasing order) array, write a program to create a binary tree with minimal height
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Data Structures - 0of 0 votes
AnswersWrite C program such that if an element in an MxN matrix is 0, its entire row and column is set to 0.
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer C - 0of 0 votes
AnswerConsider a system with three processes and four resources. Resource R1 and R3 with one instance, R2 with two instance, process P1 holding an instance of R2 and waiting for r1,process P2 is holding an instance of R1 and R2 and waiting for R3,process P3 is holding an instance of R3. Is it possible to apply the Resource allocation graph algorithm to avoid deadlock? Explain.
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Operating System - 0of 0 votes
AnswersConsider a disk drive with the specifications of 16 platters, 2 surfaces, 512 tracks, 2K sectors and 4KB page or sector size. What is the capacity of the disk drive in terms of bytes?
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Operating System - 0of 0 votes
AnswerConsider a system where counting semaphore initialized to +17, on this semaphore variable the various operations like 23P, 18V, 16P, 14V and 1P are performed. Then what is the final value of semaphore?
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Operating System - 0of 0 votes
AnswersLet the average process size be s bytes and the page size be p bytes. Furthermore, assume that each page entry requires e bytes. Derive the optimal page size.
- D PRAVEEN KUMAR September 26, 2016 in India| Report Duplicate | Flag | PURGE
Skill Subsist Impulse Ltd Software Developer Operating System
Open Chat in New Window