Software Engineer / Developer Interview Questions
- 0of 0 votes
Answerswhat is output for below code and what is purpose of using const type for pointer variable p?
- sharathvadla March 30, 2016 in United States
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char a[10]="HELLO";
char *const p=a;
clrscr();
//puts(p);
printf("%s",p);
*p='n';
//puts(p);
printf("%s",p);
getch();
}| Report Duplicate | Flag | PURGE
Persistent Systems Software Engineer / Developer C - 0of 0 votes
AnswersInt a=10;
- sharathvadla March 29, 2016 in India
Int b=a>15;
Print("%d",b);
a)15
b)10
c)0
d)1| Report Duplicate | Flag | PURGE
Persistent Systems Software Engineer / Developer C - 0of 0 votes
AnswersUsing which data structures the arthematic expressions can be calculated?
- sharathvadla March 29, 2016 in India| Report Duplicate | Flag | PURGE
Persistent Systems Software Engineer / Developer - 0of 0 votes
AnswersFind a sub string in a given string and replace it with another string?
- sharathvadla March 29, 2016 in India| Report Duplicate | Flag | PURGE
Persistent Systems Software Engineer / Developer Coding - 0of 0 votes
AnswersImplement a solution nth_largest( array, n ) that takes in an array of arbitrary size and returns the nth largest element.
- NS March 03, 2016 in United StatesEg. array = [1, 8, 4, 5, 9, 7, 2, 10, 44, 55, 67] nth_largest( array, 2) = 55 nth_largest( array, 5) = 9
| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Problem Solving - 0of 0 votes
AnswersWrite a program to identify if a given binary tree is balanced or not.
- NS March 03, 2016 in United States| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Trees and Graphs - 0of 0 votes
AnswersWrite a program to print all permutations of a given string.
- NS March 03, 2016 in United States| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Problem Solving - 0of 0 votes
AnswersIf you have the chapter of a book and you're supposed to build an index such that given a word, you can tell which pages the word occurs on, what data structure can you use? Optimize for space utilization.
- NS March 03, 2016 in United States| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Data Structures - 0of 0 votes
AnswersWrite a Python program to print numbers from 1 to 100 except for multiples of 3 for which you should print "fuzz" instead, for multiples of 5 you should print 'buzz' instead and for multiples of both 3 and 5, you should print 'fuzzbuzz' instead.
- NS March 03, 2016 in United States| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Python - 0of 0 votes
AnswersImplement a function DoIt( o,a ) such that the following code:
Object o = SomeClass() O.first = 'fizz' O.second = 'buzz' print DoIt( o, 'first) print DoIt(o, 'second')
prints
- NS March 03, 2016 in United States
fizz
buzz| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Python - 0of 0 votes
AnswersWrite a iterative Python function to print the factorial of a number n (ie, returns n!).
- NS March 03, 2016 in United States| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Python - 0of 0 votes
AnswersWrite a recursive Python function to print the factorial of a number n (ie, returns n!).
- NS March 03, 2016 in United States| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Python - 0of 0 votes
AnswersBoard Game:
- NS March 03, 2016 in United States
1) Write a program that can take a board of N x N filled with alphabets and print/return all the words that can be constructed by connecting alphabets together. You're allowed to connect alphabets in any direction including diagonally, the only restriction is that you cannot cross over the same alphabet twice. So for eg:
A,B,C,D
E,K,L,A
C,A,M,N
D,I,N,G
So example words that can be made are: BEAD, CALM, CAN, DAMN, MAKE.
2) What's the run time for your algorithm? Does your algorithm scale for large sizes of the matrix? What optimizations can you make to improve the run time.| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Data Structures - 6of 6 votes
AnswersGiven a non-directed, strongly connected graph where the node values are letters of the alphabet, write an algorithm that prints out all possible permutations of strings. What is this called?
- william.brandon.lee83 January 18, 2016 in United States
For example:
V = A,B,C
Printout
ABC
ACB
BAC
BCA
CAB
CBA
BAC etc.| Report Duplicate | Flag | PURGE
IBM Software Engineer / Developer Algorithm - 1of 1 vote
AnswersGiven a sorted integer array, write a method that builds a balanced binary search tree. What is the runtime complexity?
- william.brandon.lee83 January 18, 2016 in United States
Hint: Recursion.
Follow-up: Non-recursive solution| Report Duplicate | Flag | PURGE
IBM Software Engineer / Developer Algorithm - 1of 1 vote
AnswersGiven a list of tuples {x, y, x' } that describe histograms on the X/Y axis, such that X is the X coordinate, Y is the Y coordinate, and X' is the distance from X, write a function that draws the skyline of these tuples.
- william.brandon.lee83 January 18, 2016 in United States
For example:
{3, 2, 4} , {4,5,3} will give the following points:
{3,0} - trivial
{3,2} - trivial
{4,5} -calculated
{7,0} -if list is done.
You cannot assume that the tuples are sorted. Provide runtime analysis.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven a list of integers of size n, write a method to write all permutations the list; do this in O(1) space
- william.brandon.lee83 January 18, 2016 in United States
Hint: No recursion.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 1of 1 vote
AnswersGiven a decimal number, write a function that returns its negabinary (i.e. negative 2-base) representation as a string.
- JP Ventura January 09, 2016 in United States#!/usr/bin/env python3 assert solution(-15) == '110001' assert solution(2) == '110' assert solution(13) == '11101'
| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Algorithm - 0of 0 votes
AnswersI have an array with 60% sorted and 40% unsorted, which algorithm will give fastest accurate sorted output in C? And for Linked list which sorting algorithm suited?
- The Puzzler 2.0 January 06, 2016 in India| Report Duplicate | Flag | PURGE
Kony India Private Limited Software Engineer / Developer C - 0of 0 votes
AnswerHow can I find factorial of positive integers using structures in C?
- The Puzzler 2.0 January 06, 2016 in India| Report Duplicate | Flag | PURGE
Kony India Private Limited Software Engineer / Developer C - 3of 3 votes
AnswersAssume there are 10000 stars in sky, how would you find which star is closest to the earth? in C
- The Puzzler 2.0 January 05, 2016 in India| Report Duplicate | Flag | PURGE
Software Engineer / Developer C - 0of 0 votes
AnswersCreate a program to compute nth Fibonacci number in O(1) space and faster than O(n) time.
- zr.roman January 02, 2016 in Russia
(Target complexity is O(logn)).| Report Duplicate | Flag | PURGE
Software Engineer / Developer Algorithm - 0of 0 votes
Answersi need to write code that union two nodes from graph G Vi ,Vj
- KabhaD82 December 30, 2015 in Isreal
then new node will generated Vm = ViUVj| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer C - 1of 1 vote
AnswersImage an airport with the control tower having a constantly rotating radar scanning for airplanes. The radar's coordinates in the 2-d plane are (0,0). The radar has an API: void scan(const Plane &P) that is called periodically whenever the radar detects a plane. You can imagine that the Plane structure has x,y coordinates for that plane. You should fill in the function Scan, such that at any given time you are able to return the 100 closest planes to the tower (0,0).
- Johnybegood December 24, 2015 in United States for Derivatives| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven a tree.
Each node is of type:public class Node { public IEnumerable<Node> Children { get; set; } }
Write a function GetAllNodes which returns collection, containing all nodes from given tree. (Given only the root node), i.e.:
IEnumerable<Node> allNodes = GetAllNodes( rootNode );
(The task is given in C#, but this is not a restriction, you may use any language you want).
- zr.roman December 03, 2015 in Russia| Report Duplicate | Flag | PURGE
Software Engineer / Developer Algorithm - 0of 0 votes
AnswersHow do you create your own garbage collector? How do you find whether objects in memory are orphans in order to purge them?
- harry December 02, 2015 in India| Report Duplicate | Flag | PURGE
Citrix System Inc Software Engineer / Developer Java - 2of 2 votes
Answersfor given array
s[] = {5,1,0,4,2,3}
1) length of array is not given.
- idforbc November 24, 2015 in United States
2) If length of array is 5 content is guaranteed to be between 0 to 5. There is no repetition of numbers. Sample example for length(s, 3)
- a[3] = 4 , a[4] = 2, a[2] = 0, a[0] = 5, a[5] =3
returns length of 4 .
For given condition write subroutine
int length (s, 3)
- to find the number of steps it takes to find given value - It's a function api - that I was asked to write with the conditions - I cannot change parameters of the function - I have to make sure return value is correct
Additional Condition:
You cannot use any loop statements like for, while and so on -
You cannot use any global or static variables.
You cannot call other routines inside this routine
You cannot modify given function parameters - it stays length (s, n) only
You cannot change original array too| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm - 1of 1 vote
AnswersGoogle is conducting a contest where they display a special doodle to the user
- dp November 23, 2015 in India
submitting the billionth query of the day. Design a system to achieve this. (NOTE:
Google has thousands of servers and each query can hit a different server).
Optimise it. How will you handle server failures?| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm - 0of 0 votes
AnswersImplement class Queue with help of only 2 stacks.
i.e.:
- zr.roman November 19, 2015 in Russiaclass Queue<T>{ private Stack<T> _stack1; private Stack<T> _stack2; // public methods: Enqueue, Dequeue, Peek, Count // private methods, if any. }
| Report Duplicate | Flag | PURGE
Software Engineer / Developer Algorithm