Interview Questions වලට Support එකක් දෙමුද ?

Interview Questions වලට Support එකක් දෙ&#3512

  • support එකක් දෙනවා

    Votes: 133 85.3%
  • වෙලාවක් නැ

    Votes: 23 14.7%

  • Total voters
    156

amilabanuka

Well-known member
  • Sep 30, 2006
    7,298
    892
    113
    Thama math hoyanooo....
    Ironman wants to travel from Avengers tower to stark tower. on the way, he has to make stops and rest (he has fought extraterrestrials and is weak). on every stop there is either charging device for his suit or he needs to vanquish a stray alien consuming his power. charging devices increase the suit power and fighting the alien drains it. if any given time his power goes below 1 he dies. given an array of stop with values (positive mean charging places with capacity and negative being the power requires to kill the alien) calculate the minimum power capacity he needs to have before starting the journey in order to safely reach stark tower. write the pseudo code and explain.
     

    හෙනයා

    Well-known member
  • May 23, 2014
    16,872
    17,084
    113
    Kottawa
    Ironman wants to travel from Avengers tower to stark tower. on the way, he has to make stops and rest (he has fought extraterrestrials and is weak). on every stop there is either charging device for his suit or he needs to vanquish a stray alien consuming his power. charging devices increase the suit power and fighting the alien drains it. if any given time his power goes below 1 he dies. given an array of stop with values (positive mean charging places with capacity and negative being the power requires to kill the alien) calculate the minimum power capacity he needs to have before starting the journey in order to safely reach stark tower. write the pseudo code and explain.


    for 0 to n-1 {
    sum += ar
    if ( sum < 1 ) {
    power += amount that needs to bring up sum to 1
    sum = 1​
    }
    }
    return power

    හරිද දන්නේ නෑ.. :sorry::confused:
     

    JokerFan

    Well-known member
  • May 29, 2016
    15,849
    9,539
    113
    Arkham City
    Ironman wants to travel from Avengers tower to stark tower. on the way, he has to make stops and rest (he has fought extraterrestrials and is weak). on every stop there is either charging device for his suit or he needs to vanquish a stray alien consuming his power. charging devices increase the suit power and fighting the alien drains it. if any given time his power goes below 1 he dies. given an array of stop with values (positive mean charging places with capacity and negative being the power requires to kill the alien) calculate the minimum power capacity he needs to have before starting the journey in order to safely reach stark tower. write the pseudo code and explain.

    :baffled::baffled::baffled:
     

    amilabanuka

    Well-known member
  • Sep 30, 2006
    7,298
    892
    113
    Thama math hoyanooo....
    හෙනයා;23004583 said:

    for 0 to n-1 {
    sum += ar
    if ( sum < 1 ) {
    power += amount that needs to bring up sum to 1
    sum = 1​
    }
    }
    return power

    හරිද දන්නේ නෑ.. :sorry::confused:


    if initial values of power and sum are 1, yeah. this will give the correct answer. better if you can justify why it is correct.


    there are other solutions as well. try. try to solve it using 1 additional variable instead of 2
     
    Last edited:

    amilabanuka

    Well-known member
  • Sep 30, 2006
    7,298
    892
    113
    Thama math hoyanooo....
    we have bot with us. it can travel from his current coordinate to another coordinate following eith one of the below rules at any given movement.
    1) if current coordinate is (x,y) next coordinate is (x+y,y)
    2) if current coordinate is (x,y) next coordinate is (x,x+y)

    assume start at (1,3) -> (4,3) -> (4,7) -> (4,11) -> etc

    given start coordinate (x1,y1) and target coordinate (x2,y2), write an algorithm code to check if (x2,y2) is reachable from (x1,y1)

    x1,y1,x2,y2 >0 and <1000
     
    • Like
    Reactions: saja

    හෙනයා

    Well-known member
  • May 23, 2014
    16,872
    17,084
    113
    Kottawa
    we have bot with us. it can travel from his current coordinate to another coordinate following eith one of the below rules at any given movement.
    1) if current coordinate is (x,y) next coordinate is (x+y,y)
    2) if current coordinate is (x,y) next coordinate is (x,x+y)

    assume start at (1,3) -> (4,3) -> (4,7) -> (4,11) -> etc

    given start coordinate (x1,y1) and target coordinate (x2,y2), write an algorithm code to check if (x2,y2) is reachable from (x1,y1)

    x1,y1,x2,y2 >0 and <1000


    PHP:
    // starting coordinates 
    x1 <- 
    y1 <- 
    
    lookup(x, y){
       if (x==x1 && y == y1){
                sout("reachable");
                return;
            } else if (x == 0 || y == 0){
                sout("cannot reachable");
                return;
            }
            if(x1 - y1 < x - y){
                lookup(x-=y, y);
            } else {
                lookup(x, y-=x);
            }
    }
    
    lookup(x, y);   <--- target coordinates
    සාමන්යෙන් මේ වගේ එකකට interview එකකදී කොච්චර වෙලාවක් දෙනවද? :confused: recursion නිසා ටිකක් වෙලා ගියා හිතන්න.. :dull: :oo: :sorry:
     
    Last edited:

    amilabanuka

    Well-known member
  • Sep 30, 2006
    7,298
    892
    113
    Thama math hoyanooo....
    හෙනයා;23011993 said:

    PHP:
    // starting coordinates 
    x1 <- 
    y1 <- 
    
    lookup(x, y){
       if (x==x1 && y == y1){
                sout("reachable");
                return;
            } else if (x == 0 || y == 0){
                sout("cannot reachable");
                return;
            }
            if(x1 - y1 < x - y){
                lookup(x-=y, y);
            } else {
                lookup(x, y-=x);
            }
    }
    
    lookup(x, y);   <--- target coordinates
    සාමන්යෙන් මේ වගේ එකකට interview එකකදී කොච්චර වෙලාවක් දෙනවද? :confused: recursion නිසා ටිකක් වෙලා ගියා හිතන්න.. :dull: :oo: :sorry:

    can x-=y, y and x, y-=x results in negative numbers? if so you might have to fix the boundary condition

    oya dapu eka nam machan coding test ekaka apu ekak. but oya wage ewa awith thiyenawa interview wala. normally about 20~30 mins. depending one how much complete code they need.
    Find the logest pallendrom in a String was a question for about 30 minutes worth in Amazon interview once.
     

    Jolly_Roger

    Well-known member
  • May 2, 2009
    10,600
    1,606
    113
    Colombo XOR Matara
    lagadi ahapu ewa tikak (SSE .NET)

    Whats the difference between FirstOrDefault and SingleOrDefault ?
    What are the supported endpoints in WCF
    Explain Factory design pattern
    Explain Singleton
    Explain OO concepts with examples
    Whats the difference between Protected and Internal ?
    Whats the difference between Session and TempData ?
    Whats the difference between Scalar and Table functions ?
    Can you call a stored procedure inside a function ?
     
    • Like
    Reactions: saja

    dula_wiky

    Junior member
  • Jun 17, 2018
    37
    39
    18
    Sri Lanka
    Category: Android
    Target Group: Android Developer

    - What is the difference between activity and fragment?

    - What will happen to an activity
    i) if the device got a call?
    ii) When device is tilted?
    iii) What if it's a video?

    - Explain version management in Android

    - Explain the difference between Parceable & serializable?
     
    • Like
    Reactions: saja

    JoeBarron

    Member
    Oct 18, 2018
    1
    1
    0
    I have been to many C++ interviews and it is a must to be proficient of the following


    Linked List
    Stack
    Queues
    Binary Trees
    Heaps
    Basic Graph Traversal
    Hashing

    Virtual keyword related questions in C++, virtual destructor, virtual inheritance, virtual function and pure virtual function, run time polymorphism, VTABLE ,VPTR, dynamic_cast.

    Rule of 3 in C++.

    STL Containers

    Custom data types in STL containers

    OOPS concept in C++ with examples of all.

    Inheritance types ,

    How Multiple inheritance works in C++, use of virtual keyword

    Smart Pointers in C++ .

    Functors in C++, Function Pointers.

    Basic template concepts of C++

    C++ keywords extern ,const , static ,

    this & types of this *

    pointer vs references

    friend class & friend functions



    https://www.quora.com/What-are-the-...nd-algorithms-to-prepare-for-Google-Interview

    https://www.quora.com/What-are-the-...ch-can-be-asked-in-a-Qt-C-developer-interview
     
    • Like
    Reactions: saja