Samsung Interview Question for Developer Program Engineers


Country: VN




Comment hidden because of low score. Click to expand.
0
of 0 vote

can you elaborate with an example

- Anonymous August 10, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

or elaborate in english

- Anonymous August 11, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Most probably he means in the increasing sequence as below:
between 100 and 145:
112, 113, 114, 115, 116, 117, 118, 119, 123, 124, 125, 126, 127, 128
basically individual digits of a number in the increasing order but this is just a guess. However people interested can solve this :)

- aka[1] August 11, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

int a,b,c,i=100;
while(i<=145)
{
a=i%10;
c=i/100;
b=(i-c*100-a)/10;
if(c>=b && b>=a)
print(i);
}

- suman August 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

#include<iostream>
using namespace std;

int main()
{

        int num1=100, num2=145;
        //unit digit is num1%10, 10th digit is (num1/10)%10, 100th digit is num1/100
        int digit1,digit10,digit100=1;
        for(;num1<=num2;num1++)
        {
                digit1=num1%10;
                digit10=(num1/10)%10;
                if(digit10>digit100 && digit1>digit10)
                        cout<<num1<<"\t";
        }
        return 0;
}

- kanhaiya.baranwal August 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public void PrintIncreaseDigit(int n1,int n2)
{
int d1, d10, d100 = 1;
for(;n1<=n2;n1++)
{
d1 = n1 % 10;
d10 = (n1 / 10) % 10;
if(d10>=d100 && d1 >=d10)
Console.WriteLine(n1);
}
}

- Ashok Gowla August 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public void PrintIncreaseDigit(int n1,int n2)
{
if (n1 > n2)
return;
if ((n1 / 10) % 10 >= 1 && n1 % 10 >= (n1 / 10) % 10)
Console.WriteLine(n1);
PrintIncreaseDigit(n1 + 1, n2);
}

- Ashok Gowla August 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Solution in C#

public static List<int> Numbers(int lower, int upper)
        {
            List<int> list = new List<int>();
            //(lower < 10 ? 10 : lower) is done for ignoring digits
            for (int i = lower < 10 ? 10 : lower; i <= upper; i++)
            {
                string str = i.ToString();
                bool isOK = true;
                for (int j = 0; j < str.Length - 1; j++)
                {
                    if (str[j] >= str[j + 1])
                    {
                        isOK = false;
                        break;
                    }
                }
                if (isOK == true)
                {
                    list.Add(i);
                }
            }
            return list;
        }

- koray August 12, 2014 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More