rjoydip / oportun-interview-questions

Created with StackBlitz ⚡️

Home Page:https://stackblitz.com/edit/vitejs-vite-ujcujp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Oportun interview questions

Problem 1 - Reverse number

Input 1 - x = 123
Output - x = 321

Input 1 - x = -123
Output - x = -321

Input 1 - x = 120
Output - x = 21

Problem 2 - Right rotation

Input - [2, 3, 4, 5, 6, 7], 
Index - 3
Output - [4, 5, 6, 7, 2, 3]

Problem 3 - String concat

Input - 45 + 35 + ‘111’
Output - ????  

Input - ‘111’ + 45 + 69
Output - ???? 

Problem 4 - Hoisting

var x = 24

(function() {
	var x = 43
  (function () {
    x++
    console.log(x) // Output - ???
    var x = 21
  })()
})()

Problem - Object binding

let x = {
  opertorName: 'hello'
  getOperatorName: function () {
    return this.operatorName
  }
}
console.log(x.getOperatoName()) // Output - ???
x.getOperatorName().apply(this, {
  operatorName: 'world'
})
console.log(x.getOperatoName())

About

Created with StackBlitz ⚡️

https://stackblitz.com/edit/vitejs-vite-ujcujp


Languages

Language:CSS 52.0%Language:TypeScript 35.9%Language:HTML 12.1%