Achieve Internet Interview Questions
- 0of 0 votes
AnswersWhat is Vashikaran Service? How it helps?
- petersonadam9 March 29, 2018 in United States for Vashikaran Specialist
https://lovemarriagevashikaranspecialist.com| Report Duplicate | Flag | PURGE
Achieve Internet Consultant - 0of 0 votes
AnswersYou are given an array A = [1, 2, 3, ..., n]:
- praveend806 June 19, 2014 in United States
How many sequences (S1) can you get after exact k adjacent swaps on A?
How many sequences (S2) can you get after at most k swaps on A?
An adjacent swap can be made between two elements of the Array A, A[i] and A[i+1] or A[i] and A[i-1].
A swap otherwise can be between any two elements of the array A[i] and A[j] ∀ 1 ≤ i, j ≤ N, i ≠ j.
Input Format
First and only line contains n and k separated by space.
Output Format
Output S1 % MOD and S2 % MOD in one line, where MOD = 1000000007.
Constraints
1 ≤ n ≤ 2500
1 ≤ k ≤ 2500
Sample Input
3 2
Sample Output
3 6
Explanation
Original array: [1, 2, 3]
1. After 2 adjacent swaps:
We can get [1, 2, 3], [2, 3, 1], [3, 1, 2] ==> S1 == 3
2. After at most 2 swaps:
1) After 0 swap: [1, 2, 3]
2) After 1 swap: [2, 1, 3], [3, 2, 1], [1, 3, 2].
3) After 2 swaps: [1, 2, 3], [2, 3, 1], [3, 1, 2]
==> S2 == 6| Report Duplicate | Flag | PURGE
Achieve Internet Computer Scientist Algorithm - 0of 0 votes
AnswersThe strength of a pair integer sequences is defined by the number of integers that they have in common. You are required to find the strength of several pairs of integer sequences.
- Marey December 10, 2013 in United States for artificial intelligence team
INPUT
The first line of input contains T, the number of test cases. T test cases follow. Each test case contains 3 lines. The first line contains two integers N and M, which are the lengths of the two sequences. The next two lines contain the sequences.
OUTPUT
This should contain T lines, each containing an integer representing the strength of the pair of sequences for the corresponding test case.
CONSTRAINTS
The length of each sequence will be between 1 and 20 inclusive
A sequence can contain an integer between 1 and 100 inclusive
Sequences will not contain duplicate integers
SAMPLE INPUT
3
4 4
1 2 3 4
3 4 5 6
4 5
1 2 3 4
1 2 3 5 6
3 4
1 2 3
5 6 7 4
SAMPLE OUTPUT
2
3
0| Report Duplicate | Flag | PURGE
Achieve Internet Analyst C++ - 0of 0 votes
AnswersThe binary weight of a positive integer is the number of 1's in its binary representation. For example, the decimal number 1 has a binary weight of 1, and the decimal number 7 (which is 111 in binary) has a binary weight of 3.
- Marey December 10, 2013 in United States for artificial intelligence team
Given a positive integer N, find the smallest integer greater than N that has the same binary weight as N.
INPUT
The first line of input contains a number T the number of test cases. The next T lines contain a number N.
OUTPUT
For each test case output a line containing the smallest number greater than N which has the same binary weight as N.
CONSTRAINTS
1 <= N <= 10000
SAMPLE INPUT
2
3
7
SAMPLE OUTPUT
5
11| Report Duplicate | Flag | PURGE
Achieve Internet Analyst C++ - 0of 0 votes
AnswersGiven an integer N, find the smallest integer greater than N which is prime.
- Marey December 10, 2013 in United States for artificial intelligence team
INPUT
The first line of input contains T, the number of test cases. T test cases follow. Each test case contains a single integer N.
OUTPUT
This should contain T lines, each containing the smallest prime integer greater than N.
CONSTRAINTS
1 <= T <= 5
1 <= N <= 100
SAMPLE INPUT
2
6
11
SAMPLE OUTPUT
7
13| Report Duplicate | Flag | PURGE
Achieve Internet Analyst C++ - 0of 0 votes
Answerswrite a program to implement doubly linked list as a circular linked list
- slimshaddy710 April 21, 2012 in India| Report Duplicate | Flag | PURGE
Achieve Internet - 0of 0 votes
AnswersGiven a list of strings say N, how would you write a perfect hash function and ensure 0 collissions?
- Anonymous August 29, 2010| Report Duplicate | Flag | PURGE
Achieve Internet - 0of 0 votes
AnswersWhich data structure would you use to implement a cache (LRU or MFU) and why?
- Mahesh February 13, 2010| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer Data Structures - 0of 0 votes
AnswerWhat function(s) or hook(s) would you use in Drupal to define a url that maps to a function?
- Annonymous.... November 01, 2009
• hook_url
• hook_menu
• hook_form
• hook_uri| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswersWhat function(s) or hook(s) would you use in Drupal to create a link?
- Annonymous.... November 01, 2009
• link()
• url()
• l()
• create_link()| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswerWhat does the GD library do?
- Annonymous.... November 01, 2009| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswersHow can you get round the stateless nature of HTTP using PHP?
- Annonymous.... November 01, 2009| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswerWhich of the following characters anchors a regular expression pattern to the start of a string?
- Annonymous.... November 01, 2009
• ^ (caret)
• $ (dollar)
• % (percentage)
• ! (exclamation mark)
• * (asterisk)| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswerWhat does the following code do? Explain what’s going on there.
- Annonymous.... November 01, 2009
$date='08/26/2003';
print ereg_replace(“([0-9]+)/([0-9]+)/([0-9]+)”,”\\2/\\1/\\3”,$date);| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswersWhat function would you use to pull an associative array of results in mysql? An indexed array?
- Annonymous.... November 01, 2009
• mysql_query
• mysql_fetch_array
• mysql_fetch_row
• mysql_result| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswersWhat function can you use to open a file for reading and writing?
- Annonymous.... November 01, 2009
1. fget();
2. file_open();
3. fopen();
4. open_file();| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswersWhat function would you use to redirect the browser to a new page?
- Annonymous.... November 01, 2009
1. redir()
2. header()
3. location()
4. redirect()| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswerGiven the following code:
- Annonymous.... November 01, 2009
class myclass {
private $var = '';
var $var2 = 'test';
public function print_var() {
if (!empty($this->var)) {
print $this->var .'(Var1)';
}
else {
print $this->var2 .'(Var2)';
}
}
public function __set($string, $value) {
$this->$string = $value;
}
}
$myclass = new myclass();
$myclass->var = 'Hey there!';
$myclass->print_var();
What happens if $myclass->var is replaced with $myclass->var2?
• It prints ‘Hey There(Var2)’ to the screen.
• It prints ‘test’ to the screen because var is never correctly set.
• It throws an error because you haven’t set privacy settings for var2.
• It prints (Var1) to the screen because var is a blank string, not empty.| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswersGiven the following code:
- Annonymous.... November 01, 2009
class myclass {
private $var = '';
var $var2 = 'test';
public function print_var() {
if (!empty($this->var)) {
print $this->var .'(Var1)';
}
else {
print $this->var2 .'(Var2)';
}
}
public function __set($string, $value) {
$this->$string = $value;
}
}
$myclass = new myclass();
$myclass->var = 'Hey there!';
$myclass->print_var();
What happens when the code above is executed?
• It prints ‘Hey There(Var1)’ to the screen.
• It throws a fatal error because var is inaccessible in this context.
• It prints ‘test’ to the screen because var is never correctly set.
• It throws an error because you haven’t set privacy settings for var2.| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswersWhich of the following guarantees that the first letter of a string is capitalized and all other letters of a string are lower case?
- Annonymous.... November 01, 2009
• ucfirst($str);
• strtolower(ucfirst($str));
• strtoupper($str[0]);
• ucfirst(strtolower($str));
• strtoupper(strtolower($str)[0]);| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswersA class is written so that it cannot be extended. Which of the following PHP 5 keywords achieves that goal?
- Annonymous.... November 01, 2009
• Static
• Abstract
• Private
• Terminal
• Final| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswersIf $a = TRUE, $b = 1. What does $a == $b equal? $a === $b?
- Annonymous.... November 01, 2009
• TRUE, FALSE
• TRUE, TRUE
• FALSE, FALSE
• FALSE, TRUE| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswersWhat is the difference between foo() & @foo()?
- Annonymous.... November 01, 2009| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswerWhat functions can you use to add library code to the currently running script?
- Annonymous.... November 01, 2009| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswerIn PHP5, what code would the following print to the browser? Why?
- Annonymous.... November 01, 2009
$string = 'Hello';
function hello(&$string = '') {
$string .= ' World!';
print trim($string);
}
hello();
hello($string);
hello($string);
• World!Hello World!Hello Hello World!
• Hello World!Hello World! World!
• World!Hello World!Hello World! World!
• Hello World!Hello World!Hello World! World!
• Nothing. It would throw an error.| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswersWhat would the following code print to the browser? Why?
- Annonymous.... November 01, 2009
$num = 10;
function multiply(){
$num = $num * 10; }
multiply();
echo $num;| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer PHP - 0of 0 votes
AnswersWhich of the following is true about asort?
- Annonymous.... November 01, 2009
• Sorts highest to lowest by value maintaining key association.
• Sorts lowest to highest by key maintaining key association.
• Sorts highest to lowest by key, re-indexing the array.
• Sorts lowest to highest by value, re-indexing the array.| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer Sorting - 0of 0 votes
AnswerWhich of the following maintain index associations?
- Annonymous.... November 01, 2009
• ksort
• asort
• sort| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer Sorting - 1of 1 vote
AnswersWhich of the following will not add john to the users array?
- Annonymous.... October 29, 2009
1. $users[] = 'john';
2. array_add($users,'john');
3. array_push($users,'john');
4. $users ||= 'john';| Report Duplicate | Flag | PURGE
Achieve Internet Software Engineer / Developer Arrays