palak.chokshi
BAN USER
- 2of 2 votes
AnswersBasic background questions, describe a situation where you proposed a design and it was opposed. What did you do to convince people that your design was sound. Describe a situation where something you suggested resulted in improved process or caused a big positive impact on the company, etc.
- palak.chokshi in United States| Report Duplicate | Flag | PURGE
Linkedin Senior Software Development Engineer Experience - 0of 0 votes
AnswersImplement a TwoSum interface that has 2 methods: Store and Test. Store adds an integer to an internal data store and Test checks if an integer passed to Test is the sum of any two integers in the internal data store. Once you provide an answer interviewer will ask the O complexity of the solution and ask you to optimize it.
I provided 2 solutions, one with O(n-square) and another O(n). However the O(n) solution used 2 internal data stores. I was asked to preserve O(n) but not use the second internal store
- palak.chokshi in United Statespublic interface TwoSum { /* * Stores input in an internal data structure. */ public void Store(int input); /* * Returns true if there is any pair of numbers in the internal data structure which * have sum val, and false otherwise. * For example, if the numbers 1, -2, 3, and 6 had been stored, * the method should return true for 4, -1, and 9, but false for 10, 5, and 0 */ public bool Test(int val); } public class TwoSumImpl : TwoSum { private List<int> _store = new List<int>(); private List<int> _sums = new List<int>(); public void TwoSumImp() { } //-3,-2,3,5,7 //-5,0,1,-2,-3,8, public void Store(int input) { if(!_store.Contains(input)) { _store.Add(input); } } public bool Test(int val) { for(int i=0; i<_store.Count;i++) { if(_store[i] < 0) //store[i] is negative { diff = val + Math.Abs(_store[i]); if(_store.Contains(diff)) { return true; } } else //store[i] is positive { diff = val - _store[i]; if(_store.Contains(diff)) { return true; } return false; } } }
| Report Duplicate | Flag | PURGE
Linkedin Senior Software Development Engineer Algorithm
RepJanetCKeel, Accountant at ABC TECH SUPPORT
Hey i am Janet i am from Us and i leave here from last 4 years .My job is truck ...
Repkalerkant98, abc at ADP
I am DennisRue, seeking an entry level position where my strong work ethics and ability to learn quickly will contribute ...
Repnasliebaker, Solutions Engineer at Edinprotechnologies
Je suis Naslie , un chercheur interdisciplinaire et collaboratif axé sur l'amélioration de la santé humaine et le mentorat de ...
RepAidenKim, business planner manager at GPU
Expert business strategist with a sound understanding of organizational development and sales. Persuasive negotiator who uses integrity and professionalism in ...
Rephugaliuli, Nurse at 8x8
Registered nurse with experience in delivering quality care to patients. Professional with more than 3 years in emergency room care ...
Replusinisa67, Secretary at Melbourne
Skilled and experienced secretary in Teiscom company. Highly organized with a strong attention to detail and the ability to monitor ...
Repangilafinch, Applications Developer at Aristocrat Gaming
I am Angila, expert system operator in Linens'n from 2017, Where I interact with network providers and perform troubleshooting ...
Repremiflo4, Dyeing at Fabric Dyeing Service
Mid-level hair stylist with five years of experience working with men’s and women’s hair as well as children ...
RepMiaMiller, abc at A9
Experienced software engineer with a passion for developing innovative programs that expedite the efficiency and effectiveness of organizational success. Well-versed ...
Repjeniakant, Android test engineer at AMD
Hey I am working as a actor in Film industry from last 10 years.I start My last carrier after ...
Repjoeevansjoe6, Repairer at Monlinks
I have been functioning as a repairman at monlinks organization for a long time . Here I learn numerous things . My ...
Repamritatorr, Paramedic at Capital Medical Billing
By profession, I am a paramedic in Chicago. I want to know about Indian ayurvedic treatment. I like to explore ...
Rephizahula, abc at 8x8
I am Erica and have lived in the US for the last 4 years.I did my degree in the ...
RepFurryReign, Questions - Problem Solving Round at Cerberus Capital
Furry , An Athletic Trainer with confidence that my 7 years of experience in various organizations and industries have given me ...
Repbeverlybgill, Accountant at 247quickbookshelp
Hello, Beverly Gill and am health services manager. And I have completed all my studies in California and Nowadays am ...
Repbungayasorya, Accountant at BrowserStack
An archeologist is an expert on history who gains expertise through experience with historical documents and artifacts. The archaeological record ...