Software Analyst Interview Questions
- 1of 1 vote
AnswersGiven a list of URLs entered by a user write a program to print unique and most recently used URLs. For example if user entered the following: -
- ik.yola March 25, 2017 in United States
1. google.com
2. yahoo.com
3. wsj.com
4. google.com
The output should be :-
1. google.com
2. wsj.com
3.yahoo.com| Report Duplicate | Flag | PURGE
Bloomberg LP Software Analyst Algorithm - 1of 1 vote
AnswersWrite a program which will bold the sub-string found in string (HTML Style).
Example: string = "HelloWorld HelloWorld" substringList = ["el", "rl"] Make it like HTML Style:- NewString = "H<b>el</b>loWo<b>rl</b>d H<b>el</b>loWo<b>rl</b>d
But things become more tedious if
- rasmiranjanbabu January 24, 2017 in United StatesExample: string = "HelloWorld HelloWorld AAAAAAABBBBBBBBBBCCCCCCC" substringList = ["el", "rl", "AAAA", "BBBBB", "BC", "BBC"]
| Report Duplicate | Flag | PURGE
Google Software Analyst Algorithm - 0of 0 votes
AnswersFind out the output. Or Correct it if something is wrong.
#include <iostream> #include<typeinfo> using namespace std; class base{ public: int a; base():a(0) {} int getA(){return a;} }; class der:public base { public: int b; der():b(1) {} int getB(){return b;} }; void display(base *obj, int ele) { for(int i = 0; i < ele; i++) { cout << (obj+i)->getA() <<endl; } } int main() { int i = 3; base arrb[i]; display(arrb, 3); der arrd[i]; display(arrd, 3); return 0; }
The output is looking like
0 0 0 0 1 0
To me the output should be
0,0,0,0,0,0 //6 0's
But, how come
1
is coming in?
- rasmiranjanbabu July 12, 2016 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Analyst C++ - 0of 0 votes
AnswersFind out the longest repeated common sub-string(overlapped) in a string.
- rasmiranjanbabu July 05, 2016 in United States
For example:- mystr = banana # The "ana" is the common overlapped sub-string is been used 2 times.| Report Duplicate | Flag | PURGE
Amazon Software Analyst Algorithm - -1of 1 vote
Answershow to handle multiple data from various applications
- rasmiranjanbabu May 20, 2015 in India| Report Duplicate | Flag | PURGE
Snapdeal Software Analyst Algorithm - -1of 1 vote
AnswersThis is the implementation for KMP shift table or the processing of pattern. Is the implementation correct ?Please provide test cases to break the code.
public static String longestPrefSuff(char arr[]) { int k[] = new int[arr.length]; int i = 0, j = 0; for (int m = 0; m < arr.length; m++) { if (m == 0) { j++; k[m] = 0; } else { if (arr[i] == arr[j]) { k[m] = k[m - 1] + 1; i++; j++; } else { i = 0; if (arr[i] == arr[j]) { i++; k[m] = 1; } j++; } } } return Arrays.toString(k);
}
- koustav.adorable April 19, 2015 in India| Report Duplicate | Flag | PURGE
Software Analyst Algorithm - 0of 0 votes
AnswersIn Mutation testing How to replace Operators with another operator , How will you do this just by string operation on program or by creating syntax tree of program , how will you implement mutation testing tools ?
- mohit sharma February 05, 2015 in India
i have not remember exact question , but it was like that ??| Report Duplicate | Flag | PURGE
Adobe Software Analyst - 0of 0 votes
AnswersGiiiven a matrix of -1's and 0's, display a matrix which contains minimum distance to reach nearest 0 for that particular position.
- saran August 08, 2014 in India for Sooftware
Example:
Input: -1 0 -1
-1 -1 -1
-1 -1 -1
Ouutput:
1 0 1
2 1 2
3 2 3| Report Duplicate | Flag | PURGE
Morgan Stanley Software Analyst Algorithm - 0of 0 votes
Answers#include <iostream>
- contact.negi February 17, 2014 in India
using namespace std;
class A
{
int x;
public:
A() { cout << "A's constructor called " << endl; }
};
class B
{
static A a;
public:
B() { cout << "B's constructor called " << endl; }
static A getA() { return a; }
};
A B::a; // definition of a
int main()
{
B b1, b2, b3;
A a1 = b1.getA();
return 0;
}
in the above prog the output is
A's constructor called
B's constructor called
B's constructor called
B's constructor called
the all 4 lines belongs to before the 2nd line in main
my question is that ,in the 2nd line in main, A's constructor is called or not?
if not then why?| Report Duplicate | Flag | PURGE
Software Analyst - 1of 1 vote
AnswersGiven an array A of n numbers we can perform 3 operations on its array elements.Their are n operations in total and ith operation is to be applied on elements from ith index to last element of the array.
- justhack4fun688 January 04, 2014 in United States
1.Reverse(R) : Reverse the elements from A[i..n]
2.Add(A) : Add X to each element from A[i..n]
3.Multiply(M) : Multiply Y to each element from A[i..n]
Note : In 2nd and 3rd operation all calculations done modulo Z.
I need to find final array after nth operation is done.
EXAMPLE : Say n=3 and array has 3 elements [1,1,1] and lets X=2 ,Y=3 , Z=1000 .If sequence of operation is ARM which means 1st operation is Add,2nd operation is Reverse and 3rd one is Multiply.Then resultant array after final operation will be [3,3,9].
I was needed to calculate this array in efficient manner in c++/java| Report Duplicate | Flag | PURGE
Flipkart Software Analyst Algorithm - 0of 0 votes
AnswersHow to find the number of static objects and dynamic objects created for a class?
Let say,class MyClass { public: }; int main() { MyClass cls;//Static Object MyClass *obj = new MyClass();//Dynamic Object ... ... //So on } void NewFun() { MyClass my; MyClass *Obj1; }
It should work for all the cases, like big or small projects
- rasmiranjanbabu November 20, 2013 in United States for Embedded| Report Duplicate | Flag | PURGE
Cognzant Technology Solutions Software Analyst C++ - 0of 0 votes
Answersswap Two Number by using ternary operator
- sunny gupta October 15, 2013 in India| Report Duplicate | Flag | PURGE
National Informatics Centre Software Analyst - 0of 0 votes
AnswersWhen you were in a conflict with a teammate or team member and he persuaded you to go his way? What would you do?
- MrA October 12, 2013 in United States| Report Duplicate | Flag | PURGE
Software Analyst Behavioral - 0of 0 votes
Answerswhat will you do when client is asking you to provide something which doesnt make any sense?
- MrA October 12, 2013 in United States| Report Duplicate | Flag | PURGE
Software Analyst Behavioral - 0of 0 votes
AnswersThe amount of Magical Aura is calculated in terms of "Mana Points".
- ram188490 September 28, 2013 in India
On entering the forest he sees 'n' number of portals in front of him numbered from '0' to 'n-1' arranged in a straight line.
Each portal has a value written over it. He sees that the first and the last portals are damaged and cannot be activated (remain unactivated).
He can perform the following operations repeatedly to gain Magical Aura :
1. He can activate a portal 'x' (obviously not the first and the last one).
2. Let 'l' be the nearest unactivated portal to the left of 'x' and 'r' be the nearest unactivated portal to the right of 'x'.
3. On activating the portal 'x' he gains Mana points equal to the product of value of written over 'l' and the value written over 'r'.
4. A portal once activated cannot be activated again.
He stops when the above process cannot be continued anymore.
Note that 'nearest' is with respect to the portal currently being activated.
Now Sherlock is thinking what is the maximum amount of Magical Aura (Mana points) he can gain in this process.
Help him find this.
Input :
First line contains no of testcases 't'.
Next 't' testcases follow, first line of each is an integer 'n', representing number of portals inside the forest.
Next line contains 'n' space seperated integers which are the values written over the corresponding n portals.
Ouptut :
Output 'n' lines each having one integer denoting the maximum amount of Mana points he can gain for that particular testcase.
Constraints :
1 <= t <= 500
3 <= n <= 80
1 <= Value written over each portal <= 1000
Sample Input :
1
4
1 2 3 4
Sample Output :
12
Explanation :
We have only 2 choices :
1. Activate portal numbered 1 first, and portal numbered 2 next. The total Mana points are 1 * 3 + 1 * 4 = 7.
2. Activate portal numbered 2 first, and portal numbered 1 next. The total Mana points are 2 * 4 + 1 * 4 = 12.
So the answer is 12.| Report Duplicate | Flag | PURGE
Amazon Software Analyst Algorithm - 0of 0 votes
AnswersIN file system count the frequency of a word in descending order ,,plz provide the ans//
- Rustam September 26, 2013 in India| Report Duplicate | Flag | PURGE
MAQ Software Analyst - -1of 1 vote
AnswersGiven a weighted directed graph with n vertices where edge weights are integers (positive, zero, or
- Rahul Sharma September 05, 2013 in India
negative), determining whether there are paths of arbitrarily large weight can be performed in time
(a) O(n)
(b) O(n ยท log(n)) but not O(n)
(c) O(n1.5) but not O(n log n)
(d) O(n3) but not O(n1.5)
(e) O(2n) but not O(n3)| Report Duplicate | Flag | PURGE
Google Software Analyst - 0of 2 votes
AnswersDLL contains N nodes of string data in each node...how you will find the combined string of the nodes is Palindrome or not....?
- advha August 16, 2013 in United States| Report Duplicate | Flag | PURGE
Goldman Sachs Software Analyst C++ - -1of 1 vote
AnswersIf i create 50 Base Class objects and 50 Derived class Objects, then 50 Base Class Virtual Pointers and 50 Derived class virtual pointers created or Static virtual pointer is created one in Base and one in Derived.....?
- advha August 16, 2013 in United States| Report Duplicate | Flag | PURGE
Goldman Sachs Software Analyst C++ - 3of 3 votes
AnswersGiven an array, with positive and negative integers, arrange it in such a way that, positive numbers occupy even positions and negative numbers occupy odd position. All the remaining extra positive or negative integers should be stored at the end of the array. Remember, the elements of the array should remain in the same order.
- technical_123 August 11, 2013 in India
EG: Input array {1,-2,3,-4,-5,-6,-7,8,9,4,10,11,12}
output array {1,-2,3,-4,8,-5,9,-6,4,-7,10,11,12}| Report Duplicate | Flag | PURGE
Amazon Software Analyst - 0of 0 votes
AnswersC# Question.
class Testint x; int y;
Where the memory would be allocated ? Since both are primitive datatypes would it be allocated on stack or heap ?
- Stupid Developer February 18, 2013 in United States| Report Duplicate | Flag | PURGE
Intel Software Analyst C# - 0of 0 votes
Answers#include <iostream> #include <stdio.h> using namespace std; class A{ public: void fun(int& temp){cout<<"am inside fun()"<<endl; temp = 2000; printf("in fun() temp[%p] temp val[%d]\n",&temp, temp); } }; const int temp=100; int main() { A a; printf("in main() temp[%p] temp val[%d]\n",&temp, temp); a.fun(const_cast<int&>(temp)); cout<<"temp:"<<temp<<endl; }
Questions:
- pradeep December 11, 2012 in India
1> when i run this pgm @ line "temp=2000;" pgm will crash. what is the reason for sigsegv in this case?
2> if i make const int temp=100; declaration inside main() then, no crash and value change (i.e. temp=2000;) persists only inside fun(). But in the scope of main() this changed value is not seen. whats happening here? But address of temp in both the cases shows the same!! how is this possible??| Report Duplicate | Flag | PURGE
Wipro Technologies Software Analyst C++ - 1of 1 vote
AnswersPrint a Random word from a file. Input is "path to a file",
- Shobhit November 15, 2012 in United States
constraints- No extra memory like hashing etc. All the words in the file should have equal probability.| Report Duplicate | Flag | PURGE
Adobe Software Analyst Algorithm - 0of 0 votes
AnswerWhat is the base complexity of inserting an item in Binary tree?
- Sudha260983 October 10, 2012 in India| Report Duplicate | Flag | PURGE
CSC Software Analyst - 0of 0 votes
AnswersWhat is the base complexity of searching an item in
- Sudha260983 October 10, 2012 in India
a)Selection sort algorithm
b)Linked list
c)BInary Tree
d) Hash table
e) Queue| Report Duplicate | Flag | PURGE
CSC Software Analyst Data Structures - 1of 1 vote
AnswersYou are given n numbers x1,x2,x3,...,x(n-1) and x(n) and you can only do addition and subtraction operation with numbers, in how many ways can we get x1 S x2 S x3 S ..S x(n-1) = x(n) where S is from set +-
- ashok.singh.sairam September 09, 2012 in India
example X = {1,2,3,4,5,1}
possible solution 1+2-3-4+5
1-2+3+4-5| Report Duplicate | Flag | PURGE
Accenture Software Analyst