Epic Systems Interview Question for SDE-2s


Country: United States
Interview Type: In-Person




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

Hey

Was this question asked in usa? I thought the onsite did not consist of technical questions.

- Anonymous March 04, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

The onsite is pretty much the same as on phone interviews. Technical/personal questions galore

- Anonymous April 21, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Can someone please post the solution?

- Anonymous March 06, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Can we use OpenCSV ?

- Anonymous March 06, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

It shouldn't be needed. Java's Scanner class does most of the work here. The real point of this question is to see your OO design skills in action.

- Anonymous April 21, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tiffviewer;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author yoelhafyani
 */
public class NewClass {

    public static void main(String[] args)  {
        String testCaseString = "Type:Employee\nname,age,salary\nAshok,36,20000\nKishor,30,15000\nBharath,25,30000";
        try {
            ArrayList<Object> ee =  (ArrayList<Object>)getArrayListObject(getType(testCaseString),getArgumentType(testCaseString), testCaseString );
            for(Object ob : ee ){
                System.out.println(ob.toString());
            }
        } catch (IllegalArgumentException ex) {
            Logger.getLogger(NewClass.class.getName()).log(Level.SEVERE, null, ex);
        }   
    }

    public static ArrayList<Object> getArrayListObject(String TypeName, String Attributes[], String testCaseString)  {
        ArrayList<Object> objs = new ArrayList<Object>();
        String[] data = testCaseString.split("\n");
        for (int i = 2; i < data.length; i++) {
            System.out.println(data[i]);
            String[] DataValue = data[i].split(",");
            
            try {
                Class<?> c = Class.forName("tiffviewer." + getType(testCaseString));
                Object obj = c.newInstance();
                
                for (int j = 0; j < Attributes.length; j++) {
                    
                    Class[] cArg = new Class[1];
                    cArg[0] = c.getDeclaredField(Attributes[j].toLowerCase().trim()).getType();
                    Method lMethod;
                    lMethod = c.getDeclaredMethod("set" + Capitalize(Attributes[j]), cArg);
                    
                    
                    if (cArg[0].getName() == "java.lang.String"){
                        lMethod.invoke(obj, DataValue[j]);
                    }else{
                        lMethod.invoke(obj, Integer.parseInt(DataValue[j]));
                    }  
                }
                objs.add(obj);
            }catch (ClassNotFoundException ex) {
                    Logger.getLogger(NewClass.class.getName()).log(Level.SEVERE, null, ex);
            } catch (SecurityException ex) {
                    Logger.getLogger(NewClass.class.getName()).log(Level.SEVERE, null, ex);
            }catch(IllegalArgumentException ex){
                    Logger.getLogger(NewClass.class.getName()).log(Level.SEVERE, null, ex);
            }catch(IllegalAccessException ex){
                    Logger.getLogger(NewClass.class.getName()).log(Level.SEVERE, null, ex);
            }catch(NoSuchMethodException ex){
                    Logger.getLogger(NewClass.class.getName()).log(Level.SEVERE, null, ex);
            }catch(InvocationTargetException ex){
                    Logger.getLogger(NewClass.class.getName()).log(Level.SEVERE, null, ex);
            }catch(InstantiationException ex){
                    Logger.getLogger(NewClass.class.getName()).log(Level.SEVERE, null, ex);
            }catch(NoSuchFieldException ex){
                    Logger.getLogger(NewClass.class.getName()).log(Level.SEVERE, null, ex);
            }
            
        
        }
        return objs;
    }
    
    
    public static String Capitalize(String input){
        return input.substring(0, 1).toUpperCase() + input.substring(1);
    }
    
     public static String getType(String testCaseString) {
        return testCaseString.split("\n")[0].split(":")[1].trim();
    }

    public static String[] getArgumentType(String testCaseString) {
        return testCaseString.split("\n")[1].split(",");
    }
}

- J_el May 08, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Was this really one of the coding exam problems? I was told during my phone interview that such problems would be "language agnostic," but this one clearly isn't.

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

I'm so surprised Epic use language other than VB.

- yoyo November 10, 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