Linkedin Interview Question for Software Developers


Team: Software Developement - Tools
Country: United States
Interview Type: Phone Interview




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

>>> def check_string(s1,s2):
...     new_s = s1+s1
...     return s2 in new_s
...

- Durai October 03, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

>>> def check_string(s1,s2):
...     new_s = s1+s1
...     return s2 in new_s
...

- gce.durai October 03, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

bool isRotation(string s1, string s2){
	if (s1.size() != s2.size())
		return false;
	string s = s1+s1;
	if(s.find(s2) != npos)
		return false;
	return true;
}

- Tino April 26, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

import java.util.Scanner;

public class StringCheck {

public static void main(String[] args) {

Scanner sc=new Scanner(System.in);
String s1=sc.next();
String s2=sc.next();
String s=s2+s2;
boolean result=false;
if(s.contains(s1))
result=true;
System.out.println(result);
}

}

- Anonymous October 11, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

import java.util.Scanner;

public class StringCheck {
	
	public static void main(String[] args) {

		Scanner scan=new Scanner(System.in);
		String s1=scan.next();
		String s2=scan.next();
		String s=s2+s2;
		if (s1.length() == s2.length()){
			return s.contains(s1);
		} else {
			return false;
		}
}

}

- Anonymous November 08, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

import java.util.Scanner;

	public class StringCheck {

	public static void main(String[] args) {

		Scanner scan=new Scanner(System.in);
		String s1=sc.next();
		String s2=sc.next();
		if (s1.length() != s2.length()){
			return false;
		}
		String s=s2+s2;
		return s.contains(s1);
}

}

- Keerthan Vasist November 08, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

include<stdio.h>
#include<string.h>

int main()
{


    char str1[100];
    char str2[100];

    printf("enter string1\n");
    scanf("%s",str1);

    printf("enter string2\n");
    scanf("%s",str2);

   if(strlen(str1) != strlen(str2)){
     printf("NO\n");
    return 0;
   }

    char str2dble[strlen(str2)*2+1];

    strcat(str2dble, str2);
    strcat(str2dble, str2);

    if(strstr(str2dble,str1)){
        printf("rotated string\n");
    }   
    else{
        printf("NO\n");
    }   
}

- kaushik November 25, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

bool IsRotation(std::string str1, std::string str2)
{
	int m = 0;
	for (; m < str2.Size() && str2[m] != str1[0]; m++);

	for (int i = 0; i < str1.Size(); i++)
	{
		if (str1[i] != str2[m % str1.Size()])
		{
			return false;
		}
	}
	
	return true;
}

- Gyan Garcia April 06, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

bool IsRotation(string const &s1, string const &s2)
{
	if (s1.size() == s2.size() &&
		s1 != s2)
	{
		string all_s1_rotations = s1 + s1;
		if (all_s1_rotations.find(s2) != string::npos) {
			return true;
		}
	}
	return false;
}

- Alex August 18, 2017 | 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