## AppPerfect Interview Question for Software Engineers

Country: India
Interview Type: Written Test

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

Python Solution :

``````def isomorpheous(a,b):
if len(a) != len(b):
return False
dicti = {}
for i in xrange(len(a)):
if a[i] in dicti:
if b[i] != dicti[a[i]]:
return False
else:
dicti[a[i]] = b[i]

if len( dicti.values()) != len(set(dicti.values())):
return False
return True

print isomorpheous("abcd","zxyz")``````

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

#include<iostream>
using namespace std;
int main()
{
while(1)
{
char s1[10],s2[10];
int key=1;
cin>>s1;
cin>>s2;
int i=0,j,k,l,m;
while(s1[i])
{
j=0;
while(s1[j])
{
if(s1[j]==s1[i])
{
if(s2[j]!=s2[i])
{
cout<<"False";
key=0;
break;
}
}
else
{
if(s2[j]==s2[i])
{
key=0;
cout<<"False";
break;
}
}
j++;
}

if(key==0)break;

i++;
}
if(key)
cout<<"True";
}

}

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

#include<iostream>
using namespace std;
int main()
{
while(1)
{
char s1[10],s2[10];
int key=1;
cin>>s1;
cin>>s2;
int i=0,j,k,l,m;
while(s1[i])
{
j=0;
while(s1[j])
{
if(s1[j]==s1[i])
{

if(s2[j]!=s2[i])
{
cout<<"False";
key=0;
break;
}
}
else
{
if(s2[j]==s2[i])
{
key=0;
cout<<"False";
break;
}
}
j++;
}

if(key==0)break;

i++;
}
if(key)
cout<<"True";
}

}

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

#include<iostream>
using namespace std;
int main()
{
while(1)
{
char s1[10],s2[10];
int key=1;
cin>>s1;
cin>>s2;
int i=0,j,k,l,m;
while(s1[i])
{
j=0;
while(s1[j])
{
if(s1[j]==s1[i])
{
if(s2[j]!=s2[i])
{
cout<<"False";
key=0;
break;
}
}
else
{
if(s2[j]==s2[i])
{
key=0;
cout<<"False";
break;
}
}
j++;
}

if(key==0)break;

i++;
}
if(key)
cout<<"True";
}

}

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

``````// ZoomBA
def is_isomorphic( s1, s2 ){
if ( (l = size(s1))!= size(s2) ) return false
m = dict()
for ( i : [0:l] ){
if ( s1[i] @ m ){
y = m[ s1[i] ]
} else {
y = m[ s1[i] ] = s2[i]
}
if ( y != s2[i] ) return false
}
true
}
println( is_isomorphic('','' ))  // true
println( is_isomorphic('aabaac','xxtxxw' )) // true
println( is_isomorphic('ac','xxt' )) // false
println( is_isomorphic('acaa','xxtw' )) // false``````

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

import java.util.List;
import java.util.Map;

public class CheckIsomorphic {

public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub

String s1= "abca";
String s2 = "xyzx";
Map<Character, Integer> map = new LinkedHashMap<Character, Integer>();
Map<Character, Integer> map1 = new LinkedHashMap<Character, Integer>();
if(s1.length()!=s2.length()){
throw new IOException("Strings are not Isomorphic");
}
else {
for (int i = 0; i < s1.length(); i++) {
if(!map.containsKey(s1.charAt(i))){
map.put(s1.charAt(i), 1);
}
else {
map.put(s1.charAt(i), map.get(s1.charAt(i))+1);
}
}
for (int i = 0; i < s2.length(); i++) {
if(!map1.containsKey(s2.charAt(i))){
map1.put(s2.charAt(i), 1);
}
else {
map1.put(s2.charAt(i), map1.get(s2.charAt(i))+1);
}
}
}
System.out.println(map);
System.out.println(map1);
List<Integer> list = new LinkedList<Integer>();
List<Integer> list1 = new LinkedList<Integer>();
for (Map.Entry<Character,Integer> x: map.entrySet()) {
}
for (Map.Entry<Character,Integer> x: map1.entrySet()) {
}
System.out.println(list.equals(list1));
}

}

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.

### 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.