Epic Systems Interview Question for Software Developers


Country: United States
Interview Type: Written Test




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

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;


public class pixel {
	
	public static void main(String[] args){
		try{
		FileInputStream f = null;
		String line;
		int linecount=0;
		ArrayList  rows=new ArrayList();
		int checker=0;
		boolean flag=true;
		f = new FileInputStream("sample.txt");
		BufferedReader br = new BufferedReader(new InputStreamReader(f));
		while ((line = br.readLine()) != null) {
			if(line.length()==1000){
				for(int i=0;i<line.length();i++){
					if(!(line.charAt(i)=='1')){
						flag=false;
						checker++;
						break;
					}
				}
				if(flag || checker>1000){
					if(checker>1000){
					rows.add(linecount);
					}
					else{
						rows.add(linecount+1);
					}
					checker=0;
				}
				linecount++;
				flag=true;
			}
		}
		for(int i=0;i<rows.size();i++){
			System.out.print(rows.get(i) + "\n");
		}
		}
		catch(Exception e){
			System.out.print("Error");
		}
		}
	}

- Sam February 22, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Can you explain your code.

- Career January 09, 2016 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Can you explain your code?

- careercupuser January 09, 2016 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;


public class pixel {
	
	public static void main(String[] args){
		try{
		FileInputStream f = null;
		String line;
		int linecount=0;
		ArrayList  rows=new ArrayList();
		int checker=0;
		boolean flag=true;
		f = new FileInputStream("sample.txt");
		BufferedReader br = new BufferedReader(new InputStreamReader(f));
		while ((line = br.readLine()) != null) {
			if(line.length()==1000){
				for(int i=0;i<line.length();i++){
					if(!(line.charAt(i)=='1')){
						flag=false;
						checker++;
						break;
					}
				}
				if(flag || checker>1000){
					if(checker>1000){
					rows.add(linecount);
					}
					else{
						rows.add(linecount+1);
					}
					checker=0;
				}
				linecount++;
				flag=true;
			}
		}
		for(int i=0;i<rows.size();i++){
			System.out.print(rows.get(i) + "\n");
		}
		}
		catch(Exception e){
			System.out.print("Error");
		}
		}
	}

- sam.guest947 February 22, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Please comment, if my understanding is wrong and if you find any issues in the code.

- sam.guest947 February 22, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

anyone elaborate on this question? I don't understand the question

- newbieallen February 23, 2015 | 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