Horje
Amazon Hackon Interview Experience

Quiz Round:

There were 20 Questions based on C, C++, Java, and Data Structures and algo. Questions were MCQ-based and some patterns were like finding a missing code or something like that.

Level -Easy

Coding Round:

In this round, the total problems were 2. Out of which 1 problem was based on string and the other was based on basic Math.

Problem 1: Find the first non-repeating char from a given string.

Solution link : /archive/given-a-string-find-its-first-non-repeating-character/

Problem 2: Find the difference between the maximum lcm formed by any pairs from an array and the maximum gcd that can be formed by any pairs.

Solution link :

C++

#include <iostream>
using namespace std;
long long max_lcm_gcd_diff(long long n){
  long long max_gcd_pair=n/2;
  long long max_lcm_pair=n*(n-1);
  return max_lcm_pair-max_gcd_pair;
int main() {
    long long n;
      cin>>n;
      long long res=max_lcm_gcd_diff(n);
        
    cout << res<<endl;
    return 0;
}
//programmed by Nazim Qureshi :)Happy Coding

T.C= O(1)

S.C=O(1)

Keep reading ! Keep loving ! Keep sharing !

Happy Coding ????

PS: This is my first article on GFG.




Reffered: https://www.geeksforgeeks.org


Experiences

Related
Verizon Interview Experience for Developer Verizon Interview Experience for Developer
Mamsys Company Interview Experience for Software Developer Mamsys Company Interview Experience for Software Developer
LTIMindtree Interview Experience for GET (On-Campus) LTIMindtree Interview Experience for GET (On-Campus)
Cognizant Interview Experience for GenC / GenC Elevate Cognizant Interview Experience for GenC / GenC Elevate
Accenture Interview Experience for Associate and Adv Software Engineer Accenture Interview Experience for Associate and Adv Software Engineer

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
13