Interesting answers to some of the template questions in tech interviews.
Segment One. Let's start with the most common question of all time.
Introduce yourself?| Tell me about yourself?
If the interviewer is experienced and has adequate exposure in interview-taking, he would most likely give a soft introduction about himself before asking you to introduce yourself.
This, I believe, is your golden moment to glory. Your story is unique and should demonstrate your professional journey. Make sure to include all key achievements and at the same time keep it interesting. Limit it to 2 minutes, so it does not seem too preachy.
Start with a quick Summary < Over the course of XX years, I have built versatile skills in many tools and technologies and garnered a varied experience in delivering resilient products to customers >
Education <I have a Bachelor’s degree in Computer Science from University >
Career < I started my career with XXX Company and worked from Intern to Senior QA Engineer. I moved to YYY Company/Onsite to challenge my capabilities and grow from a Team player to a Team Leader. During my time with the AAA project, I worked closely with development teams to understand the pain points. I brought order to the non-functional testing process, resulting in a 50% reduction of production bugs and more than 80% of human effort. I carried the same momentum to many other projects resulting in highly robust outcomes. I was doing exceptionally well here, but I had to quit and move to ZZZ Company to take further responsibilities as a Delivery Manager. In my current role, I help projects in digital transformation and work with cross-functional teams to shift left the performance testing, thereby ensuring delivery of quality products across all agile sprints>
Personal/Personality < I am a person who believes in getting things done smartly. I am positive that I can complement the teams I work with by bringing my unique flavor of navigating through different testing tools and technologies with ease.
My interests include writing, gardening, and hiking uneven terrains >
End And Smile!
Bonus Tip: Your hobbies exemplify your personality.
Talking about at least one productive interest in nature instead of hobbies that are merely consuming. Stating that you listen to songs in your free time makes you sound lethargic. However, mentioning that you play a particular musical instrument sets you aside from your competition.
Segment 2. Technical questions.
Q: How to identify the factors for Slowness in a Web Application?
First, use DevTools such as Chrome Tools that come inbuilt with Chrome Browser.
- Run the application with Chrome tools and verify the Page size, Network Resources being and number of requests for the page to fully load. From here, verify if the different pages have Content-Encoding enabled (compression enabled or not)
- Use the command ‘window.performance.timing’ to evaluate the different segments of the page load time. For example, ascertain the different load times.
- Calculate the TTFB: Time to First Byte
Response start — request start = TTFB * last five digits of the timestamp
From the above: 28136–27570= 0.566 seconds (TTFB: 566 milliseconds)
- Calculate the time taken from the navigation to the last event in the browser
Load event end — Navigation start = Load Time of Page * last five digits of the timestamp
From the above: 28868–26076 = 2.792 seconds (Page load time: 2792 milliseconds)
Second, Load Testing Tool
- Use any load testing tool such as LoadRunner or open-source JMeter to record business-critical user journeys/workflows [Gmail — business-critical tx: Check inbox; Compose email; Non-critical workflows: Password reset, Change theme, etc]
Q: Why is Performance testing important or critical to the success of application systems?
- To experience how the systems respond to incoming traffic
- To optimize the system infrastructure
- To baseline and benchmark for future releases
- To make an informed go-live
Q: What are the common performance bottlenecks?
- High Response Times
- Slower TTI (Time to Interactive)
- CPU spikes
- Memory leak or ineffective memory utilization
- Expensive SQL queries
- Application Crashes
Q. What are the different types of Performance Testing?
- Stress Testing: To identify the breaking point of application
- Load Testing: Identify application’s ability under anticipated user load
- Endurance Testing: To ensure the application can handle the load over a long period of time
- Scalability Testing: Application’s effectiveness in scaling up to support an increase in user loads with the current infrastructure in place
Volume Testing: Database is populated with large volumes of data and load tested to see the database performance
Q: Is the end-user experience in the Browser equal to the Testing Tools such as LoadRunner or JMeter response time metric?
No. Load Testing tools calculate the response time until the Time to First Byte received from Server (TTFB). End-user experience also includes client-side processing such as unzipping the resource files, Image/Text Compression/Decompression, Layout calculations, Page size, Resource download, cache retrievals, and processing images/dynamic content.
Q: Given an application for Performance testing, what is your process?
There is more than one way to answer this. One common approach is to detail the Testing process from start to end, which is PTLC (Performance Testing Life cycle).
Requirement Gathering Phase: Meet the different external and internal stakeholders and gather information about the Application architecture, technical stack it was built on, critical business scenarios/use cases, the objective of the testing assignment, and the timelines.
Test Plan and Design: Identify the testing tool and do a proof of concept to establish the compatibility between the application and the testing tool.
Identify the different tests required to meet the objective of the testing
Come up with detailed entry and exit criteria for the testing approach and get the sign-off.
Test Development/Execution Phase
- Assessment Phase:
Use ChromeDev Tools to validate the single user response time of the application against different functionalities. Use Auditing tools such as Lighthouse, webhint.io in order to get a performance score for the application in the test (AUT).
Then work on the test scripts and model the test scenarios to align the different load conditions to different functionalities. Use Pacing and think times wisely. Perform the testing and analyze the client-side metrics such as Response times, Hits per second, throughput, and errors.
- Server Monitoring: Measure application performance in terms of system availability, CPU Utilization, and Memory management
Gauge user experience across Web and mobile devices.
- Tuning Phase: Work with development teams to report the bugs/anomalies identified in the test runs and provide detailed recommendations. Once the application is tuned, reiterate the test runs and quantify the improvement in percentage (%) before and after the testing footprint.
Q. What is the difference between roles of Performance testing and Performance Engineering?
A high-level snapshot -
Q: How do you diagnose a memory leak?
The Worst way to find a memory leak is when the app crashes with an Out of Memory error.
Inefficient programming usually leads to anywhere between 30–70% of memory wastage
- Memory Leak
- Out of Memory errors
- Allocation failures
- Memory Hogs — wrong DS choice; Suboptimal data type usage(‘long’ instead of ‘int’); Redundant data
To analyze and understand the situation better, we need Heap logs/heap dump.
Ways to Download Heap Dump:
- Triggers automatically when Out of memory is encountered in the working directory of VM or specifying a path: XX:HeapDumpPath=path. Parameter for trigger: XX:+HeapDumpOnOutOfMemoryError
- Using jmap utility of JVM. jmap -dump:format=b,file=heap.bin <pid>
- Download manually with the help of the Dev team
After the retrieval of logs, either manually or via tools like https://heaphero.io/ analyze and identify the factors behind the memory issues.
Sample Report: https://heaphero.io/heap-report2_0.jsp
Q: How do you identify the cause of sudden CPU spikes?
Step 1: First Identify the process ID behind the high CPU %
- Log in to the Linux server or the system on which the app is deployed and with the help of the top command, identify the process id of the top %CPU consuming process
- Map the processID to the ThreadID.
Cmd: top –h <pid> //Pid identified from Step 1
- This command results in a new PID which you should then convert into a hexadecimal value using online converters.
- Download the thread dumps using Jstack [Available in the latest JDK] using the below command.
jstack –l/f <pid> /opt/tmp/threadDump.txt
Use alternate methods to download if jstack is unavailable by asking the dev team.
- In the thread dump, look for the stack trace or error log against the ThreadID retrieved from Step 2(hexadecimal value)
- Send the error logs to the dev team to get them fixed
Step 5 (Eliminate the Step 1 through 4 )
Can also analyze the thread dumps using the below popular tools for detailed recommendations/suggestions and share the info with the development team
Q: Garbage Collection
Java heap memory stores objects, and GC or Garbage Collection periodically clears the references to the unused or unreachable objects. The memory leak is usually a case when garbage collection cannot do its job in cleaning up or creating objects at such a high rate that GC is unable to sweep them effectively.
GC Log Anatomy
Format dependent on JVM and GC version
- Type of GC: Full GC/Minor GC
- Memory Segment : PSYoungGen/PSPermGen/PSOldGen
- Execution time in second (3.4230220 secs)
- Details of MemoryUtilized->MemoryAfterGC(TotalMemoryspaceallocatedforMemorySegment)
Download GC Logs
- -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/opt/app/gc.log
- Use GC Log Analyzer(IBM)
Log analyzer to get recommendations and suggestions on the possible issues
- Visualvm [JDK]
Q: What is Indexing?
When SQL queries are slower, it is often advised to index them. However, what exactly is an Index?
An index is a data structure that improves the speed of data retrieval operations on a database table. Indexes are also used to define a primary key or unique index, guaranteeing that no other columns have the same values.
Once you have created an index, you can select or sort your rows faster than before.
The goal is to index the heavy searching and ordering columns.
Some tips to improve SQL queries
- Index the long-running queries
- Avoid loops that tend to become recursive or run indefinitely. They often end up causing sudden CPU spikes.
Potential Cause of High Logical Reads in SQL statements
- Select statements without Where clauses
- Nested Select statements
The above factors lead to millions of data retrievals during a load test. Generate AWR reports and compare before, during, and after test stats to analyze the patterns
Hiring Manager: Do you have any questions for us?
1. Can you please run me through a typical day for a person in this role. I am keen to understand the responsibilities better. < Make this a discussion by asking more questions like do the People work in silos or more collaborative space, what kind of R&D is happening concerning onboarding new industry tools, and what kind of projects the team foresees in the future, any AI in scope? >
2. What should a person in this role accomplish in the first three to six months?
3. <Mid to senior positions> what is the most common reason for resignations in this company? [This helps in establishing the company’s low points in case you have multiple offers and you are weighing them]
Final Note: Thank the Interview Panel most sincerely.
< It was a great discussion; I mainly enjoyed talking about this topic and love to explore it further.
Thank you for your generous time. I appreciate it >
I hope this helps. I know interviews can be stressful, but an offer letter is not too far with a proper plan and an excellent execution. Be confident (they say fake it until you make it) and optimistic. All the very best!