Programmer Interview Questions

24,057 programmer interview questions shared by candidates

What are data types? What is mutable and immutable? Write a small program to create a list or array and perform basic operations using two variable How would you secure an application from cyber attacks? What are the key measures to protect a system or network?
avatar

Programmer Analyst

Interviewed at Cognizant

3.6
Oct 14, 2025

What are data types? What is mutable and immutable? Write a small program to create a list or array and perform basic operations using two variable How would you secure an application from cyber attacks? What are the key measures to protect a system or network?

package com.interview; public class Threading { int counter; class Mythread extends Thread{ @Override public void run(){ for(int i=0; i < 10000; i++) counter++; System.out.println("run = " + counter); } } public static void main(String[] args) throws InterruptedException { // TODO Auto-generated method stub Threading a = new Threading(); Mythread t1 = a.new Mythread(); t1.start(); t1.join(); System.out.println("" + a.counter); } }
avatar

Java Programmer

Interviewed at Barclays

4
Jan 15, 2010

package com.interview; public class Threading { int counter; class Mythread extends Thread{ @Override public void run(){ for(int i=0; i < 10000; i++) counter++; System.out.println("run = " + counter); } } public static void main(String[] args) throws InterruptedException { // TODO Auto-generated method stub Threading a = new Threading(); Mythread t1 = a.new Mythread(); t1.start(); t1.join(); System.out.println("" + a.counter); } }

You are on the first floor of two-level building. On the second floor, there are three lamps while all the switches are on the first floor. How can you define which switch is associate with the lamps on the second floor with only going to the second floor once?
avatar

Software Engineer (Junior Programmer)

Interviewed at Mitrais

4.5
Jun 9, 2015

You are on the first floor of two-level building. On the second floor, there are three lamps while all the switches are on the first floor. How can you define which switch is associate with the lamps on the second floor with only going to the second floor once?

Viewing 1101 - 1110 interview questions

Glassdoor has 24,057 interview questions and reports from Programmer interviews. Prepare for your interview. Get hired. Love your job.