Skill Subsist Impulse Ltd Interview Question for Software Developers


Country: India
Interview Type: Written Test




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

test(int hr,int min)
{
if(hr>12 && hr<25)
{
hr=hr-12;
min=min;

}
day(char day){
if(hr>12){day=PM}
else day=AM;

}
swap(int hr,int min){
cout<<" Hr" <<hr
cout<<" min"<<min
cout<<" "<<day

}

}

- Ashish Kamble September 27, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

package algorithm;

public class Algos {
	public static void main(String args[]) {
		Algos algos = new Algos();
		System.out.println(algos.toHour("00:00"));
	}
	
	public String toHour(String hrs24)
	{
		if (hrs24 == null) {
			return "";
		}
		
		String[] time = hrs24.split(":");
		Integer hour = Integer.parseInt(time[0]);
		if (hour < 0 || hour > 24) return "Invalid hour provided";
		
		Integer formatted = hour <= 12 ? hour : hour-12;
		String meridian = hour < 12 ? "AM" : "PM";
		return formatted + ":" + time[1] + meridian;
	}
}

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

package algorithm;

public class Algos {
	public static void main(String args[]) {
		Algos algos = new Algos();
		System.out.println(algos.toHour("00:00"));
	}
	
	public String toHour(String hrs24)
	{
		if (hrs24 == null) {
			return "";
		}
		
		String[] time = hrs24.split(":");
		Integer hour = Integer.parseInt(time[0]);
		if (hour < 0 || hour > 24) return "Invalid hour provided";
		
		Integer formatted = hour <= 12 ? hour : hour-12;
		String meridian = hour < 12 ? "AM" : "PM";
		return formatted + ":" + time[1] + meridian;
	}
}

- ethioer September 27, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

int hr = int.parse(a[0])*10 + int.parse(a[1]);
int min = int.parse(a[3])*10 + int.parse(a[4]);

int newhr = (hr / 13) * ((hr % 13) + 1) + abs(hr / 13 - 1) * ((hr + 23) % 12 + 1); //
string ampm = hr <= 11 ? "AM" : "PM";

string newTime = newhr + ":" + min + ampm

- mv October 02, 2016 | 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